I wrote the attached script to solve this problem. Install the script onto each client that you need to do this sort of monitoring, in the /etc/zabbix/externalscripts directory (or wherever you have configured them to be). Make it executable, and add the following lines to the /etc/zabbix/zabbix_agentd.conf file:
# For pingserver.shRestart the Zabbix client after you put this line in.
UserParameter=pingTimeToServer[*],/bin/bash /etc/zabbix/externalscripts/pingserver.sh $1 $2 $3 $4 $5
You can run the script by hand if you like, the options are:
pingserver.sh server [option] [count] [maxage] [interval]
server Server to ping, either ip or dns
option blank for a single ping
“loss” to get the percentage of lost pings in a range of pings
“min” to get the minimum time in a range of pings
“avg” to get the average time
“max” to get the max time
count How many times to ping when doing a range of pings
maxage Max age of tmpfile before doing pings again
interval Interval between pings during a range. Must be
greater than 0.2 (only root can go less than 0.2)
To use as an item inside Zabbix, create an item (either in a template or a host) with the following options:
Type: Zabbix agent
Key: pingTimeToServer[server [,option [,count [,maxage [,interval]]]]
Type of info: Numeric (float) (except for “loss”)
For loss option: Numeric (unsigned)
Units: all options except loss: ms
for loss option: %
#cat /etc/zabbix/zabbix_agentd.d/userparameter_ping.confZabbix:
UserParameter=custom.ping.reachable[*],/bin/ping -c 1 -W 1 -q -n $1 &> /dev/null && echo 1 || echo 0
#systemctl restart zabbix-agent
Add new item: Key: custom.ping.reachable[8.8.8.8]
Add new trigger: {Hostname:custom.ping.reachable[8.8.8.8].max(#3)}=0
10 Tut - Sharing Tip And Tut: Monitor Ping Other Host Using Zabbix Agent >>>>> Download Now
Trả lờiXóa>>>>> Download Full
10 Tut - Sharing Tip And Tut: Monitor Ping Other Host Using Zabbix Agent >>>>> Download LINK
>>>>> Download Now
10 Tut - Sharing Tip And Tut: Monitor Ping Other Host Using Zabbix Agent >>>>> Download Full
>>>>> Download LINK