PDA

View Full Version : Value of icmppingsec when host is down?


obstler
16-12-2004, 15:02
Alexei,

Can icmppingsec be used in a trigger to detect when a host is down/unreachable/no_ping_reply? I need to graph and store the ping values for different routers, and therefor use the icmppingsec on each of the hosts.

Now I want to set up a trigger/alerting when the host is down. Can host:icmpingsec.last(0)=0 be used, or does this only work with icmpping? What value does icmppingsec return in case of a ping timeout?

All other simple check xxx_perf items return zero when down and a time value when up, so I guess icmppingsec should support the same? If this currently doesn't do that, then I suggest implementing it, otherwise I would have to add an additional icmpping item to all hosts, just to check if they're down.

regards, tom.

obstler
16-12-2004, 15:27
hi,

looking at the code of pinger.c it seems like icmppingsec doesn't get a value when the host is down. So what I did is add two lines to the host down section, changing the code from the original


if(0 == alive)
{
#ifdef ZABBIX_THREADS
process_value(database,SERVER_ICMPPING_KEY,ip,"0");
#else
process_value(SERVER_ICMPPING_KEY,ip,"0");
#endif
}


to


if(0 == alive)
{
#ifdef ZABBIX_THREADS
process_value(database,SERVER_ICMPPING_KEY,ip,"0");
process_value(database,SERVER_ICMPPINGSEC_KEY,ip,"0");
#else
process_value(SERVER_ICMPPING_KEY,ip,"0");
process_value(SERVER_ICMPPINGSEC_KEY,ip,"0");

#endif
}


with the two extra lines copied from the host up section, and second_value variable replaced by 0.

After recompiling and installing the new binary first tests seem to run just fine, with icmppingsec now returning 0 when host is down .... hope this doesn't break anything else.

Alexei, please post your comments about this addition, and if it makes sense to you as well, why not include it in future releases?

regards, tom.