Hostalive and Packet Loss perfdata


I noticed that if an host is down, the the packet loss (pl) perfdata from its hostalive check will differ depending of the exact reason the host is down.

If the packets are just lost, the check will output pl = 100%, but if the cause is known (based on the ICMP response code, I suppose) there will be no perfdata at all. Some examples are Time to live exceeded or Host Unreachable.

I’m using those checks for WAN monitoring, on a large fleet of remote devices, and I need my historical data to reflect that those packets were actually lost - regardless of the reason.

Is there any way to get the check to provide packet loss data in all “down” scenarios?

Thanks in advance!

You may want to consider using check_icmp, if possible:

$ /usr/lib64/nagios/plugins/check_icmp -l 4
CRITICAL - Time to live exceeded in transit @ w.x.y.z. rta nan, lost 100%|rta=0.000ms;200.000;500.000;0; pl=100%;40;80;0;100 rtmax=0.000ms;;;; rtmin=0.000ms;;;;

Thanks! It does the job, but it seems that the version of check_icmp bundled with Icinga2 does not support ipv6. I’m checking if I can use the one form

It looks like IPv6 support was added 6 years ago. What version are you using?

It was v2.2, latest version available on my distro official repos… I guess I should have seen that coming.

I installed latest version from source; it was as a bit of a pain (I got a project requirement to do that via Ansible) but it solved both issues.

~$ /usr/lib/nagios/plugins/check_icmp -V
check_icmp v2.2 (monitoring-plugins 2.2)

~$ /opt/icinga2/monitoring-plugins/plugin/current/check_icmp -V
check_icmp v2.3.1 (monitoring-plugins 2.3.1)

Thanks a lot for your help!

1 Like