您的位置:首页 > 运维架构 > Linux

centos7安装Zabbix3.4

2018-02-27 15:51 260 查看
参考网址: 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-develconfigure: error: LIBXML2 library not found           #yum -y install libxml2-develconfigure: error: unixODBC library not found        # yum -y install unixODBC-develconfigure: error: Invalid Net-SNMP directory - unable to find net-snmp-config #yum -y install net-snmp-develconfigure: error: Invalid OPENIPMI directory - unable to find ipmiif.h #yum -y install OpenIPMI-develconfigure: 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.sql
mysql -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=localhost
DBName=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/503493966.启动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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: