# Hostalive and Packet Loss perfdata

**URL:** <https://community.icinga.com/t/hostalive-and-packet-loss-perfdata/9204>\
**Category:** Service Monitoring\
**Tags:** check, host, icinga2\
**Created:** [February 11, 2022, 4:20pm UTC](https://community.icinga.com/t/hostalive-and-packet-loss-perfdata/9204 "2022-02-11T16:20:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ya3xp](https://community.icinga.com/letter_avatar_proxy/v4/letter/y/67e7ee/32.png) [@ya3xp](https://community.icinga.com/u/ya3xp)\
**Post date:** [February 11, 2022, 4:20pm UTC](https://community.icinga.com/t/hostalive-and-packet-loss-perfdata/9204/1 "2022-02-11T16:20:26Z")

</div>

Hi,

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!

---

<div class="post-metadata">

**Author:** ![leeclemens](https://community.icinga.com/user_avatar/community.icinga.com/leeclemens/32/1283_2.png) [@leeclemens](https://community.icinga.com/u/leeclemens)\
**Post date:** [February 12, 2022, 12:52am UTC](https://community.icinga.com/t/hostalive-and-packet-loss-perfdata/9204/2 "2022-02-12T00:52:03Z")

</div>

You may want to consider using `check_icmp`, if possible:

```auto
$ /usr/lib64/nagios/plugins/check_icmp 8.8.8.8 -l 4
CRITICAL - 8.8.8.8: 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;;;;

```

---

<div class="post-metadata">

**Author:** ![ya3xp](https://community.icinga.com/letter_avatar_proxy/v4/letter/y/67e7ee/32.png) [@ya3xp](https://community.icinga.com/u/ya3xp)\
**Post date:** [February 14, 2022, 10:25am UTC](https://community.icinga.com/t/hostalive-and-packet-loss-perfdata/9204/3 "2022-02-14T10:25:08Z")

</div>

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 [monitoring-plugins.org](https://www.monitoring-plugins.org/doc/man/check_icmp.html).

---

<div class="post-metadata">

**Author:** ![leeclemens](https://community.icinga.com/user_avatar/community.icinga.com/leeclemens/32/1283_2.png) [@leeclemens](https://community.icinga.com/u/leeclemens)\
**Post date:** [February 14, 2022, 3:13pm UTC](https://community.icinga.com/t/hostalive-and-packet-loss-perfdata/9204/4 "2022-02-14T15:13:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ya3xp](https://community.icinga.com/letter_avatar_proxy/v4/letter/y/67e7ee/32.png) [@ya3xp](https://community.icinga.com/u/ya3xp)\
**Post date:** [February 15, 2022, 10:30am UTC](https://community.icinga.com/t/hostalive-and-packet-loss-perfdata/9204/5 "2022-02-15T10:30:58Z")

</div>

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.

```nohighlight
~$ /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!
