参考网址:
https://www.zabbix.com/documentation/3.4/manual/installation/install
http://blog.csdn.net/mr_rsq/article/details/78457587
http://www.21yunwei.com/archives/5941
http://blog.csdn.net/yu757371316/article/details/55271762
http://blog.51cto.com/cesar/1631313
https://www.5ibc.net/centos/2572.html
下载地址:
https://excellmedia.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/3.4.7/zabbix-3.4.7.tar.gz
$ tar -zxvf zabbix-3.4.7.tar.gz
groupadd zabbix useradd -g zabbix zabbix
#可能会出现以下的报错信息,建议直接全部安装
yum install gcc* mysql-devel libxml2-devel net-snmp* java* curl-devel -y
yum install libevent-devel -y
yum install unixODBC-devel mysql-devel net-snmp-devel libxml2-devel libcurl-devel libevent-devel
yum install mariadb-devel
yum install -y php-mysql.x86_64 php-devel
yum install php-bcmath
configure: error: Not found mysqlclient library #yum -y install mysql-devel
configure: error: LIBXML2 library not found #yum -y install libxml2-devel
configure: error: unixODBC library not found # yum -y install unixODBC-devel
configure: error: Invalid Net-SNMP directory - unable to find net-snmp-config #yum -y install net-snmp-devel
configure: error: Invalid OPENIPMI directory - unable to find ipmiif.h #yum -y install OpenIPMI-devel
configure: error: Curl library not found #yum -y install curl-devel
$ cd zabbix-3.4.7
./configure --enable-server --enable-agent --with-mysql=/usr/bin/mysql_config --enable-ipv6 --enable-java --with-net-snmp --with-libcurl --with-libxml2 --with-unixodbc --with-ssh2 --with-openipmi --with-openssl --prefix=/usr/local/zabbix
make install
3 Create Zabbix database
shell> mysql -uroot -p<password> mysql> create database zabbix character set utf8 collate utf8_bin; mysql> grant all privileges on zabbix.* to zabbix@localhost identified by '<password>'; mysql> quit;
mysql -uroot -pbimd zabbix3 < /data/local/zabbix-3.4.7/database/mysql/schema.sql
mysql -uroot -pbimd zabbix3 < /data/local/zabbix-3.4.7/database/mysql/images.sqlmysql -uroot -pbimd zabbix3 < /data/local/zabbix-3.4.7/database/mysql/data.sql
修改配置文件zabbix_server.conf
#vi /usr/local/zabbix/etc/zabbix_server.conf
DBHost=localhostDBName=zabbix
DBUser=zabbix
DBPassword=zabbix888
添加Zabbix服务器和Zabbix代理启动脚本
cp /data/local/zabbix-3.4.7/misc/init.d/fedora/core/zabbix_server /etc/init.d/zabbix_server
cp /data/local/zabbix-3.4.7/misc/init.d/fedora/core/zabbix_agentd /etc/init.d/zabbix_agentd
$vi /etc/init.d/zabbix_server
$vi /etc/init.d/zabbix_agentd
修改BASEDIR=/usr/local/zabbix
安装apache,php
https://www.cnblogs.com/zakun/p/5840073.html
2 Installing Zabbix web interface
vi /etc/httpd/conf/httpd.conf #修改端口为8889
cp -rf /data/local/zabbix-3.4.7/frontends/php /var/www/html/zabbix
cp -rf /data/local/zabbix-3.4.7/frontends/php /var/www/html/zabbix3
systemctl start httpd.service
启动所有服务,并设置开机自启
#启动Apache服务
service httpd start
#启用mysql服务
service mysqld start
/etc/init.d/zabbix_server start
/etc/init.d/zabbix_agentd start
#设置开机自启
chkconfig httpd on
chkconfig mysqld on
chkconfig --add /etc/init.d/zabbix_server
chkconfig --add /etc/init.d/zabbix_agentd
chkconfig zabbix_server on
chkconfig zabbix_agentd on
#查看端口号80、3306、10050(zabbix_agentd)、10051(zabbix_server)是否监听
ss -tnul
systemctl status zabbix_server #启动zabbix-server服务
systemctl status zabbix_agentd #启动zabbix-agent服务
http://blog.csdn.net/slovyz/article/details/50349396
6.启动zabbix_agent
#/usr/local/zabbix/sbin/zabbix_agentd
查看是否启动:
#netstat -tnlp | grep 'zabbix'
安装web
http://www.book.com:8889/zabbix
http://www.book.com:8880/zabbix3