安装zabbix之前,请先安装配置lamp环境。(上篇文章有写)
参考:https://blog.csdn.net/SilenceViking/article/details/80168715
# vi /etc/selinux/config
SELINUX=disabled
:wq!
# systemctl stop firewalld
# systemctl disable firewalld
# yum install iptables-services -y
# vi /etc/sysconfig/iptables
-A INPUT -p tcp --dport 3306 -j ACCEPT
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 10050 -j ACCEPT
-A INPUT -p tcp --dport 10051 -j ACCEPT
-A INPUT -p udp --dport 10050 -j ACCEPT
-A INPUT -p udp --dport 10051 -j ACCEPT
# vi /etc/locale.conf
LANG="zh_CN.UTF-8"
:wq!
# reboot
# yum install telnet vim wget -y
# yum install openssh-clients
# yum install -y gcc gcc-c++ openssl-devel
# yum install vixie-cron
# yum install mariadb-server mariadb -y
# systemctl start mariadb
# systemctl enable mariadb
# rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
# yum install zabbix-server-mysql zabbix-web-mysql -y
创建数据库
# mysql -uroot -p'123456' -e "create database zabbix default character set utf8 collate utf8_bin;"
# mysql -uroot -p'123456' -e "grant all on zabbix.* to 'zabbix'@'%' identified by '123456';"
导入数据
# zcat /usr/share/doc/zabbix-server-mysql-3.4.8/create.sql.gz | mysql -uzabbix -p2wsxzaq1 zabbix
# grep -n '^'[a-Z] /etc/zabbix/zabbix_server.conf
38:LogFile=/var/log/zabbix/zabbix_server.log
49:LogFileSize=0 72:PidFile=/var/run/zabbix/zabbix_server.pid
82:SocketDir=/var/run/zabbix
101:DBName=zabbix
117:DBUser=zabbix
330:SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
448:Timeout=4
490:AlertScriptsPath=/usr/lib/zabbix/alertscripts
500:ExternalScripts=/usr/lib/zabbix/externalscripts
536:LogSlowQueries=3000
# vi /etc/zabbix/zabbix_server.conf
DBPassword=123456
:wq!
# vim /etc/httpd/conf.d/zabbix.conf
php_value date.timezone Asia/Shanghai
:wq!
# systemctl enable zabbix-server
# systemctl start zabbix-server
# systemctl enable httpd
# systemctl restart httpd
主页访问:http://192.168.18.236/zabbix/
默认用户名:Admin,密码:zabbix