安装mariadb
[root@centos01 ~]# yum -y install mariadb mariadb-server
[root@centos01 ~]# systemctl start mariadb
[root@centos01 ~]# systemctl enable mariadb
[root@centos01 ~]# mysqladmin -uroot password
[root@centos01 ~]# mysqladmin -uroot password ‘pwd@123’
[root@centos01 ~]# mysql -uroot -ppwd@123
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
MariaDB [(none)]> create user ‘zabbix’@‘localhost’ identified by ‘pwd@123’;
MariaDB [(none)]> grant all privileges on zabbix.* to ‘zabbix’@‘localhost’;
安装Zabbix
[root@centos01 ~]# yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent
修改zabbix服务器端配置文件
[root@centos01 ~]# vim /etc/zabbix/zabbix_server.conf
92 DBHost=localhost
102 DBName=zabbix
118 DBUser=zabbix
127 DBPassword=pwd@123
143 DBPort=3306
修改时区
[root@centos01 ~]# vim /etc/httpd/conf.d/zabbix.conf
php_value date.timezone Asia/Shanghai
启动服务器端
[root@centos01 ~]# systemctl start zabbix-server httpd zabbix-agent
[root@centos01 ~]# systemctl enable zabbix-server httpd zabbix-agent
配置支持中文
[root@centos01 ~]# cp simkai.ttf /usr/share/zabbix/fonts/
[root@centos01 ~]# vim /usr/share/zabbix/include/defines.inc.php
将数据导入数据库
[root@centos01 ~]# zcat /usr/share/doc/zabbix-server-mysql-3.4.1/create.sql.gz | mysql -uzabbix -ppwd@123 zabbix
使用浏览器访问http://192.168.100.10/zabbix/setup.php
输入密码pwd@123
设置名字zabbix监控
输入账号Admin密码zabbix
客户端安装监控
[root@centos02 ~]# yum -y install zabbix-agent
[root@centos02 ~]# vim /etc/zabbix/zabbix_agentd.conf
Server=192.168.100.10
ServerActive=192.168.100.10
Hostname=192.168.100.20
启动服务
[root@centos02 ~]# systemctl start zabbix-agent
[root@centos02 ~]# systemctl enable zabbix-agent
网页zabbix页面点击配置–主机–点击停用的变成已启用
然后添加主机:配置–主机–右上角的创建主机(如图填写内容)
(点击添加–更新)
点击检测中–图形–右上角选择组主机图形(内心等待)