伺服器端安裝 1、安裝倉庫 rpm -ivh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm 2、安裝軟體包 yum install zabbix-server-mysql zab ...
伺服器端安裝
1、安裝倉庫
rpm -ivh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm
2、安裝軟體包
yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent -y
3、安裝資料庫,創建資料庫,初始化 啟動服務
yum install mariadb-server mariadb -y
systemctl enable mariadb.service
systemctl start mariadb.service
create database zabbix character set utf8 collate utf8_bin;
grant all on zabbix.* to zabbix@'localhost' identified by '111111';
4、修改php時區
sed -i 's@# php_value date.timezone Europe/Riga@php_value date.timezone Asia/Shanghai@g' /etc/httpd/conf.d/zabbix.conf
5、導入數據
cd /usr/share/doc/zabbix-server-mysql-3.2.11/
zcat create.sql.gz |mysql -uzabbix -p111111 zabbix
6、zabbix伺服器資料庫配置
vim /etc/zabbix/zabbix_server.conf
DBHost = localhost
DBName = zabbix
DBUser = zabbix
DBPassword =111111
7、啟動zabbix,httpd服務
systemctl start zabbix-server
systemctl enable zabbix-server
systemctl start httpd
被監控端安裝agent服務
1、安裝源
rpm -ivh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm
2、安裝軟體包
yum install zabbix-agent -y
3、修改配置文件
vim /etc/zabbix/zabbix_agentd.conf
Server=192.168.62.222 此處為服務端ip地址
ServerActive=192.168.62.222 此處為服務端ip地址
Hostname=Zabbix server 此處可以自己填寫,但要記住,在界面添加主機時要一致
創建主機圖
服務端查看agent是否連接成功
註意,只能在服務端測試
yum install zabbix-get -y
agent端ip
zabbix_get -s 192.168.62.100 -p 10050 -k"system.cpu.load[all,avg1]"
測試結果
[root@zabbix ~]# zabbix_get -s 192.168.62.100 -p 10050 -k "system.cpu.load[all,avg1]"
0.090000