安装zabbix
安装依赖
[root@centos ~]# systemctl enable mariadb
[root@centos ~]# systemctl start mariadb
查看MySQL进程
设置密码登录数据
创建数据库设置授权 创建数据库
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
授权用户访问zaabix数据库
MariaDB [(none)]> create user ‘zabbix’@‘localhost’ identified by ‘pwd@123’;
更新生效
MariaDB [(none)]> grant all privileges on zabbix.* to ‘zabbix’@‘localhost’;
安装服务器端和apache
修改zabbix服务器端配置文件
[root@centos ~]# vim /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=pwd@123
DBPort=3306
修改时区
[root@centos ~]# vim /etc/httpd/conf.d/zabbix.conf
php_value date.timezone Asia/Shanghai
启动服务器端
[root@centos ~]# systemctl start zabbix-server.service httpd zabbix-agent
[root@centos ~]# systemctl enable zabbix-server.service httpd zabbix-agent
配置支持中文
[root@centos ~]# cp simkai.ttf /usr/share/zabbix/fonts/
[root@centos ~]# vim /usr/share/zabbix/include/defines.inc.php
47 define(‘ZBX_GRAPH_FONT_NAME’, ‘simkai’);
安装监控客户端
[root@centos ~]# yum -y install zabbix-agent
修改客户端主配置文件
[root@centos ~]# vim /etc/zabbix/zabbix_agentd.conf
PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=0
Server=192.168.100.10
ServerActive=192.168.100.10
Hostname=192.168.100.20
客户端设置开机自动启动
[root@centos ~]# systemctl start zabbix-agent.service
[root@centos ~]# systemctl enable zabbix-agent.service