PDA

View Full Version : icmppingsec returns rta in seconds


fab
30-06-2005, 13:06
Hi,

I realized that icmppingsec returns the rta in Seconds instead of miliseconds. With an average rta of less than 1ms we only see results of 0 in the graph. Only the plaintext viewings showed any results. So I patched pinger.c to return miliseconds instead of seconds.


--- src/zabbix_sucker/pinger.c.orig Thu Jun 30 12:42:37 2005
+++ src/zabbix_sucker/pinger.c Thu Jun 30 11:09:52 2005
@@ -268,7 +268,8 @@
}
else
{
- snprintf(tmp,sizeof(tmp)-1,"%f",mseconds/1000);
+ //mseconds are okay for pings
+ snprintf(tmp,sizeof(tmp)-1,"%f",mseconds);
process_value(SERVER_ICMPPING_KEY,ip,"1");
process_value(SERVER_ICMPPINGSEC_KEY,ip,tmp);
}


Regards,
Frank.

Alexei
30-06-2005, 18:59
Alternatively, you may change Multiplier (set it to 1000) in Item definition screen. No change of code required in this case.