the nagios check_ping command gives me unlogical reports about the packet loss, like subscribed in this topic:
18.04 Bionic(fresh installed) with Icinga2 V2.10 and nagios-plugins-basic V2.2
It seems to be an error in the check_ping plugin. By default it is sending 5 packets for icmp echo request. If just one packet fail i get packet loss values like 16%, 95%, etc. But when there are 5 packets and one fail, that have to be 20% in my world. The Plugin output is only right if 100% fail or none. Otherwise it gives random values. I checked the process by executing tcpdump on the remotesystem. The count of packets(icmp requests) is correct, if i set the -p parameter to 2 packets, the check_command is sending 2, but the output of packet loss is still not logical. Using the check_icmp is no option for me at the moment, i really want to know how to fix this
I took a look at the c code of the plugin, but my programming skills are to bad for find something. I also found some topics about this problem, but no one had an idea how to correct that. In my opinion i tried everything, without success. I really hope that someone here can help.
I think it is not necessary to post my whole config snippets here cause everyone can easily reproduce this. I just executed the check command manually for that during i interrupt the network connection of the ping target. Before i stopped icinga service to avoid any icmp requests from hostchecks that affects my tcpdump result. If i use the ping command from the terminal, everything works like expected. 1 out of 5 packets is calculated with 20%.
We are deploying an Icinga2 monitoring in our productive network at work at the moment. That is the reason why i want to fix it insted of using another ping plugin. Maybe there is an error that can be fixed within some changes on the script. I think everyone who is using nagios would be happy about that
Here is the c code