1.zabbix安装环境准备
zabbix安装需要LAMP环境支持
采用yum源安装LAMP快速构建。
yum -y install httpd php php-devel php-gd php-bcmath php-mbstring mysql mysql-devel mysql-server php-xml php-mysql gd net-snmp net-snmp-devel net-snmp-utils curl-devel
安装后,启动mysql
[[email protected] ~]# /etc/init.d/mysqld start
Initializing MySQL database: Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password ‘new-password‘
/usr/bin/mysqladmin -u root -h zabbix111 password ‘new-password‘
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/bin/mysqlbug script!
The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
[ OK ]
Starting mysqld: [ OK ]
设置mysql密码
[[email protected] ~]# /usr/bin/mysqladmin -u root password ‘123456‘
创建zabbix数据库
[[email protected] ~]# mysql -uroot -p123456
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.0.95 Source distribution
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.
mysql> create database zabbix;
Query OK, 1 row affected (0.06 sec)
创建zabbix用户与组
[[email protected] ~]# groupadd zabbix
[[email protected] ~]# useradd -g zabbix -m zabbix
解压zabbix包
[[email protected] ~]# tar zxvf zabbix-2.0.3.tar.gz
导入数据库到mysql
[[email protected] ~]# cd zabbix-2.0.3/database/mysql/
[[email protected] mysql]# mysql -uroot -p123456 zabbix <./schema.sql
[[email protected] mysql]# mysql -uroot -p123456 zabbix <./images.sql
[[email protected] mysql]# mysql -uroot -p123456 zabbix <./data.sql
2.编译安装zabbix
[[email protected] mysql]# cd ../../
[[email protected] zabbix-2.0.3]# ./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-mysql --with-net-snmp --with-libcurl
[[email protected] zabbix-2.0.3]# make install
3.修改配置文件
[[email protected] zabbix-2.0.3]# vi /etc/services
在最后增加
zabbix-agent 10050/tcp
zabbix-agent 10050/udp
zabbix-trapper 10051/tcp
zabbix-trapper 10051/udp
4.修改配置文件
服务端修改
[[email protected] misc]# vi /usr/local/zabbix/etc/zabbix_server.conf
DBPassword=123456
本机客户端修改
[[email protected] misc]# vi /usr/local/zabbix/etc/zabbix_agentd.conf
hostname=zabbix111 #主机名
[[email protected] zabbix-2.0.3]# cd frontends/
[[email protected] frontends]# cp -r php /var/www/html/zabbix
修改php配置文件
[[email protected] frontends]# vi /etc/php.ini
date.timezone = Asia/Shanghai
max_execution_time = 300
max_input_time = 300
post_max_size = 32M
mbstring.func_overload = 2
修改完成后重启apache
[[email protected] frontends]# service httpd restart
[[email protected] frontends]# /etc/init.d/iptables stop #防火墙关闭
[[email protected] frontends]# chkconfig iptables off
开机启动
[[email protected] frontends]# chkconfig mysqld on
[[email protected] frontends]# chkconfig httpd on
打开浏览器
Next
Next
Next
Next
Download下来放在/var/www/html/zabbix/conf目录下后面点击Retry后,在点击Finish
[[email protected] frontends]# cd /var/www/html/zabbix/conf
用户名: admin 密码:zabbix 默认的
说明zabbix服务没有启动
启动zabbix服务端
[[email protected] conf]# /usr/local/zabbix/sbin/zabbix_server
启动zabbix客户端
[[email protected] conf]# /usr/local/zabbix/sbin/zabbix_agentd
zabbix2.0.3 安装与配置,布布扣,bubuko.com