Zabbix monitors whether the second network card is connected

Configure the zabbix client profile

vim /etc/zabbix/zabbix_agentd.conf

添加  Include=/etc/zabbix/zabbix_agentd.d/

 

Add a script to detect whether the network card eth1 is connected

[root@compute scripts]# cat nat.check.sh 
ethtool eth1|grep -c "Link detected: yes"
#mii-tool eno16777736|grep -c 'link ok'

 

Add to the configuration file in the /etc/zabbix/zabbix_agentd.d directory

[root@compute zabbix_agentd.d]# cat weifeng.conf

UserParameter=nat.check,sudo /etc/zabbix/scripts/nat.check.sh

 

zabbix client restarts zabbix-agent

[root@compute zabbix_agentd.d]# systemctl restart zabbix-agent

 

Add the corresponding item on the zabbix server side  

 

Add corresponding triggers

 

Add corresponding graphs

 

 

The output after the configuration is successful is as follows:

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325120498&siteId=291194637