環境說明
環境 | ip | 需要安裝的程序 |
---|---|---|
客戶端 | 192.168.47.11 | zabbix-agentd |
1.關閉防火牆和SELINUX
[root@yanyinglai ~]# systemctl stop firewalld
[root@yanyinglai ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@yanyinglai ~]# sed -ri 's/(SELINUX=.*)/\1disabled/g' /etc/selinux/config
[root@yanyinglai ~]# setenforce 0
zabbix安裝
[root@yanyinglai ~]# yum -y install net-snmp-devel libevent-devel
下載zabbix
[root@yanyinglai ~]# cd /usr/src/
[root@yanyinglai src]# wget https://nchc.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/3.4.12/zabbix-3.4.12.tar.gz
//解壓
[root@yanyinglai src]# tar xf zabbix-3.4.12.tar.gz
[root@yanyinglai src]# ls
debug kernels zabbix-3.4.12 zabbix-3.4.12.tar.gz
//創建zabbix用戶和組
[root@yanyinglai ~]# groupadd -r zabbix
[root@yanyinglai ~]# useradd -r -g zabbix -M -s /sbin/nologin zabbix
安裝編譯zabbix
[root@yanyinglai ~]# cd /usr/src/zabbix-3.4.12
[root@yanyinglai zabbix-3.4.12]# ./configure --enable-agent
[root@yanyinglai zabbix-3.4.12]# make install
修改客戶端配置文件
[root@yanyinglai zabbix-3.4.12]# vim /usr/local/etc/zabbix_agentd.conf
//將以下三處配置爲服務端IP地址
Server=192.168.47.12
ServerActive=192.168.47.12
Hostname=192.168.47.11
啓動agentd
[root@yanyinglai ~]# zabbix_agentd
[root@yanyinglai ~]# ss -natl
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 *:22 *:*
LISTEN 0 100 127.0.0.1:25 *:*
LISTEN 0 128 *:10050 *:*
LISTEN 0 128 :::22 :::*
LISTEN 0 100 ::1:25
web界面配置步驟
1.建主機組
2.把主機加入相應的主機組
3.配置主機
4.配置監控項
5.配置警告信息
6.發郵件