1、安装LAMP环境,并安装依赖包。
[root@localhost ~]# yum -y install httpd php mysql-server [root@localhost ~]# yum -y install mysql-devel gcc net-snmp-devel crul-devel libxml2-devel perl-DBI php-gd php-mysql php-bcmath php-mbstring php-xml [root@localhost ~]# chkconfig httpd on [root@localhost ~]# chkconfig mysqld on
2、添加用户,创建数据库,添加授权账户
[root@localhost ~]# useradd zabbix [root@localhost ~]# mysqladmin -u root -h localhost password "password" [root@localhost ~]# mysql -uroot -p mysql> create database zabbix character set utf8; mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'password';
3、编译安装zabbix,下载地址:http://www.zabbix.com/download.php
[root@localhost ~]# tar -zxvf zabbix-2.2.4.tar.gz [root@localhost ~]# cd zabbix-2.2.4 [root@localhost zabbix-2.2.4]# ./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-mysql --with-net-snmp --with-liburl --with-libxml2 [root@localhost zabbix-2.2.4]# make install
4、导入数据库。
[root@localhost zabbix-2.2.4]# mysql -uzabbix -pzabbix -hlocalhost zabbix < database/mysql/schema.sql [root@localhost zabbix-2.2.4]# mysql -uzabbix -pzabbix -hlocalhost zabbix < database/mysql/p_w_picpaths.sql [root@localhost zabbix-2.2.4]# mysql -uzabbix -pzabbix -hlocalhost zabbix < database/mysql/data.sql
5、修改配置文件,添加服务端口,启动服务。
[root@localhost zabbix-2.2.4]# cp misc/init.d/fedora/core/zabbix_server /etc/init.d/ [root@localhost zabbix-2.2.4]# cp misc/init.d/fedora/core/zabbix_agentd /etc/init.d/ [root@localhost zabbix-2.2.4]# cp -R frontends/php /var/www/html/zabbix [root@localhost ~]# vim /usr/local/zabbix/etc/zabbix_server.conf DBUser=zabbix DBPassword=zabbix [root@localhost ~]# vim /etc/init.d/zabbix_server BASEDIR=/usr/local/zabbix [root@localhost ~]# vim /etc/init.d/zabbix_agentd BASEDIR=/usr/local/zabbix [root@localhost ~]# vim /etc/services zabbix-agent 10050/tcp Zabbix Agent zabbix-agent 10050/udp Zabbix Agent zabbix-trapper 10051/tcp Zabbix Trapper zabbix-trapper 10051/udp Zabbix Trapper [root@localhost ~]# /etc/init.d/zabbix_server start [root@localhost ~]# /etc/init.d/zabbix_agentd start [root@localhost ~]# echo "/etc/init.d/zabbix_server start" >> /etc/rc.local [root@localhost ~]# echo "/etc/init.d/zabbix_agentd start" >> /etc/rc.local
6、web登录:http://ip/zabbix
如有fail需要完善系统要求
[root@localhost ~]# vim /etc/php.ini post_max_size = 30M max_execution_time = 300 max_input_time = 300 date.timezone = Asia/Shanghai [root@localhost ~]# service httpd restart
然后重新检测
转载于:https://blog.51cto.com/liang178/1436141