配置zabbix YUM源
rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm
安裝zabbix
yum install -y zabbix-server-mysql zabbix-web-mysql zabbix-get httpd php mariadb-server
數據庫配置
systemctl start mariadb.service
systemctl enable mariadb.service
1 設置數據庫密碼
mysqladmin -uroot password "111111"
2 創建zabbix數據庫
create database zabbix character set utf8 collate utf8_bin;
3 創建數據庫管理用戶
grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
4 在zabbix數據庫中導入相應的表信息
zcat /usr/share/doc/zabbix-server-mysql-4.0.21/create.sql.gz |mysql -uzabbix -pzabbix zabbix
Apache配置
vim /etc/httpd/conf.d/zabbix.conf
21 php_value date.timezone Asia/Shanghai
chown -R apache /usr/share/zabbix/
zabbix配置
vim /etc/zabbix/zabbix_server.conf
124 DBPassword=zabbix
啓動服務
systemctl start httpd.service zabbix-server.service
systemctl enable httpd.service zabbix-server.service
web訪問
zabbix-agent端安裝配置
1配置yum源
rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm
2安裝agent
yum -y install zabbix-agent
3 修改agent文件,制定zabbix-server地址
vim /etc/zabbix/zabbix_agentd.conf
98 Server=192.168.2.42
150 Hostname=nfs01
注:如果這個名稱和web端添加主機時的Host name不一致的情況,雖然不影響監控,但是會有大量的報錯日誌.
4 啓動zabbix_agentd
systemctl start zabbix-agent.service
systemctl enable zabbix-agent.service
zabbix-server web端添加監控主機