一、系统环境
关闭防火墙及selinux
systemctl stop firewalld.service
systemctl disable firewalld.service
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
grep SELINUX=disabled /etc/selinux/config
setenforce 0
二、数据库安装及配置
安装mariadb yum install mariadb-server mariadb -y
mariadb数据库的相关命令是:
systemctl start mariadb #启动
MariaDB systemctl stop mariadb #停止
MariaDB systemctl restart mariadb #重启
MariaDB systemctl enable mariadb #设置开机启动
三、Zabbix3.4.4安装及配置
1、Zabbix3.4.4安装
rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm
yum install zabbix-server-mysql zabbix-web-mysql -y
2、创建数据库 create database zabbix character set utf8 collate utf8_bin; grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
3、导入数据 zcat /usr/share/doc/zabbix-server-mysql-3.4.4/create.sql.gz | mysql -uzabbix -pzabbix zabbix
4、配置数据库用户及密码 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
125 DBPassword=zabbix
316:SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
434:Timeout=4
476:AlertScriptsPath=/usr/lib/zabbix/alertscripts
486:ExternalScripts=/usr/lib/zabbix/externalscripts
522:LogSlowQueries=3000
5、启动zabbix server并设置开机启动 systemctl enable zabbix-server systemctl start zabbix-server
6、编辑Zabbix前端PHP配置,更改时区 vim /etc/httpd/conf.d/zabbix.conf php_value date.timezone Asia/Shanghai
7、SELinux配置 setsebool -P httpd_can_connect_zabbix on setsebool -P httpd_can_network_connect_db on
8、启动httpd并设置开机启动 systemctl start httpd systemctl enable httpd
四、安装Zabbix Web
1、浏览器访问,并进行安装 http://192.168.1.198/zabbix/
2、检查系统环境设置,必须全部都为ok,才能继续
3、输入连接到数据库详细信息。Zabbix数据库必须已经创建好
5、连接Zabbix服务细节,如果没有改变可选择默认
完成安装,会将在/etc/zabbix/web/zabbix.conf.php生成配置文件 Congratulations! You have successfully installed Zabbix frontend. Configuration file "/etc/zabbix/web/zabbix.conf.php" created.
8、登录最新版Zabbix3.4 默认用户Admin 默认密码zabbix