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
[root@zabbix111 ~]# /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密码
[root@zabbix111 ~]# /usr/bin/mysqladmin -u root password '123456'
创建zabbix数据库
[root@zabbix111 ~]# 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用户与组
[root@zabbix111 ~]# groupadd zabbix
[root@zabbix111 ~]# useradd -g zabbix -m zabbix
解压zabbix包
[root@zabbix111 ~]# tar zxvf zabbix-2.0.3.tar.gz
导入数据库到mysql
[root@zabbix111 ~]# cd zabbix-2.0.3/database/mysql/
[root@zabbix111 mysql]# mysql -uroot -p123456 zabbix <./schema.sql
[root@zabbix111 mysql]# mysql -uroot -p123456 zabbix <./p_w_picpaths.sql
[root@zabbix111 mysql]# mysql -uroot -p123456 zabbix <./data.sql
2.编译安装zabbix
[root@zabbix111 mysql]# cd ../../
[root@zabbix111 zabbix-2.0.3]# ./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-mysql --with-net-snmp --with-libcurl
[root@zabbix111 zabbix-2.0.3]# make install
3.修改配置文件
[root@zabbix111 zabbix-2.0.3]# vi /etc/services
在最后增加
zabbix-agent 10050/tcp
zabbix-agent 10050/udp
zabbix-trapper 10051/tcp
zabbix-trapper 10051/udp
4.修改配置文件
服务端修改
[root@zabbix111 misc]# vi /usr/local/zabbix/etc/zabbix_server.conf
DBPassword=123456
本机客户端修改
[root@zabbix111 misc]# vi /usr/local/zabbix/etc/zabbix_agentd.conf
hostname=zabbix111 #主机名
[root@zabbix111 zabbix-2.0.3]# cd frontends/
[root@zabbix111 frontends]# cp -r php /var/www/html/zabbix
修改php配置文件
[root@zabbix111 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
[root@zabbix111 frontends]# service httpd restart
[root@zabbix111 frontends]# /etc/init.d/iptables stop #防火墙关闭
[root@zabbix111 frontends]# chkconfig iptables off
开机启动
[root@zabbix111 frontends]# chkconfig mysqld on
[root@zabbix111 frontends]# chkconfig httpd on
打开浏览器
Next
Next
Next
Next
Download下来放在/var/www/html/zabbix/conf目录下后面点击Retry后,在点击Finish
[root@zabbix111 frontends]# cd /var/www/html/zabbix/conf
用户名: admin 密码:zabbix 默认的
说明zabbix服务没有启动
启动zabbix服务端
[root@zabbix111 conf]# /usr/local/zabbix/sbin/zabbix_server
启动zabbix客户端
[root@zabbix111 conf]# /usr/local/zabbix/sbin/zabbix_agentd