check_ping 2.2.1 bug?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
jjani
Posts: 4
Joined: Mon Oct 28, 2019 6:53 am

check_ping 2.2.1 bug?

Post by jjani »

Hi!

In version of check_ping 2.2.1 I tried modify these parameters lot of versions ("-w 100,5% -c 200,15% -4 -p 5 -t 30") when the target host is denied any ICMP packet by iptables, but haven't got performance data in response, except with "-p 1" parameter.
The answer was only:
CRITICAL - Plugin timed out
This command working perfectly in version 2.1.4 and 2.1.2.
The answer was:
PING CRITICAL - Packet loss = 100%|rta=200.000000ms;100.000000;200.000000;0.000000 pl=100%;5;15;0
Can you check it?
This is a bug or my error?

BR,
Janos Juhasz
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: check_ping 2.2.1 bug?

Post by mcapra »

Looks as though check_ping hasn't changed in quite a long time:
https://github.com/nagios-plugins/nagio ... eck_ping.c

Code: Select all

$ sha256sum nagios-plugins-2.1.2/plugins/check_ping.c
746f4127c14c75d43d918c19975d13372198321bcbc6897cf37fb54bac6f9dcd *nagios-plugins-2.1.2/plugins/check_ping.c
$ sha256sum nagios-plugins-2.2.1/plugins/check_ping.c
746f4127c14c75d43d918c19975d13372198321bcbc6897cf37fb54bac6f9dcd *nagios-plugins-2.2.1/plugins/check_ping.c
How did you perform the update of your nagios-plugins suite?
Former Nagios employee
https://www.mcapra.com/
jjani
Posts: 4
Joined: Mon Oct 28, 2019 6:53 am

Re: check_ping 2.2.1 bug?

Post by jjani »

It's so weird!
At the first I installed it with yum!
yum install nagios-plugins-all -y
After downloaded the plugins from http://nagios-plugins.org/download/, and untar, compile it.
Finally I replaced the original check_ping file to the new command file.
With

Code: Select all

check_ping -V
command was checked the actual version.

Here is my checksum output:
/nagios-plugins-2.2.0/plugins
sha256sum 3d74bf05acf10a6b7630c3d5d1933ddb48db5594e33e69c0c908f4f709daf315 check_ping
/nagios-plugins-2.1.4/plugins
sha256sum 7d27dc06ae450558678ec31f74e538624d902857a221e0680c6ed03a91a3ff0d check_ping
Here is my plugins info:
yum info nagios-plugins-all
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile

Installed Packages
Name : nagios-plugins-all
Arch : x86_64
Version : 2.2.2
Release : 2.20190926git1b8ad57.el7
Size : 0.0
Repo : installed
From repo : epel
Summary : Nagios Plugins - All plugins
URL : https://www.nagios-plugins.org/
License : GPLv2+
Description : This package provides all Nagios plugins.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: check_ping 2.2.1 bug?

Post by mcapra »

Granted I don't have access to the 2.1.4 RPM from EPEL, I'm not able to reproduce this using a separate 2.1.4 build against 2.2.1 in EPEL:

Code: Select all

# rpm -i nagios-plugins-2.1.4-3.el7.centos.x86_64.rpm
warning: nagios-plugins-2.1.4-3.el7.centos.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID ac25decd: NOKEY
# rpm -i nagios-plugins-ping-2.1.4-3.el7.centos.x86_64.rpm
warning: nagios-plugins-ping-2.1.4-3.el7.centos.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID ac25decd: NOKEY
# /usr/lib64/nagios/plugins/check_ping --version
check_ping v2.1.4 (nagios-plugins 2.1.4)
# /usr/lib64/nagios/plugins/check_ping 8.8.8.8 -w 100,5% -c 200,15% -4 -p 5 -t 30
PING OK - Packet loss = 0%, RTA = 11.69 ms|rta=11.687000ms;100.000000;200.000000;0.000000 pl=0%;5;15;0

...

# rpm -i nagios-plugins-2.2.2-2.20190926git1b8ad57.el7.x86_64.rpm
# rpm -i nagios-plugins-ping-2.2.2-2.20190926git1b8ad57.el7.x86_64.rpm.1
# /usr/lib64/nagios/plugins/check_ping --version
check_ping v2.2.1.git (nagios-plugins 2.2.1)
# /usr/lib64/nagios/plugins/check_ping 8.8.8.8 -w 100,5% -c 200,15% -4 -p 5 -t 30
PING OK - Packet loss = 0%, RTA = 12.19 ms|rta=12.186000ms;100.000000;200.000000;0.000000 pl=0%;5;15;0
Former Nagios employee
https://www.mcapra.com/
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: check_ping 2.2.1 bug?

Post by ssax »

I am able to replicate this on my system as well:

Code: Select all

[root@xid ~]# /usr/local/nagios/libexec/check_ping -H 192.168.X.X -w 100,5% -c 200,15% -4 -p 5 -t 30
CRITICAL - Plugin timed out
[root@xid ~]# /usr/local/nagios/libexec/check_ping -H 192.168.X.X -w 100,5% -c 200,15% -4 -p 1 -t 30
PING CRITICAL - Packet loss = 100%|rta=200.000000ms;100.000000;200.000000;0.000000 pl=100%;5;15;0
jjani
Posts: 4
Joined: Mon Oct 28, 2019 6:53 am

Re: check_ping 2.2.1 bug?

Post by jjani »

You don't reproduce it because the google is reachable! :)
Test it again with unreachable host.
mcapra wrote:Granted I don't have access to the 2.1.4 RPM from EPEL, I'm not able to reproduce this using a separate 2.1.4 build against 2.2.1 in EPEL:

Code: Select all

# rpm -i nagios-plugins-2.1.4-3.el7.centos.x86_64.rpm
warning: nagios-plugins-2.1.4-3.el7.centos.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID ac25decd: NOKEY
# rpm -i nagios-plugins-ping-2.1.4-3.el7.centos.x86_64.rpm
warning: nagios-plugins-ping-2.1.4-3.el7.centos.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID ac25decd: NOKEY
# /usr/lib64/nagios/plugins/check_ping --version
check_ping v2.1.4 (nagios-plugins 2.1.4)
# /usr/lib64/nagios/plugins/check_ping 8.8.8.8 -w 100,5% -c 200,15% -4 -p 5 -t 30
PING OK - Packet loss = 0%, RTA = 11.69 ms|rta=11.687000ms;100.000000;200.000000;0.000000 pl=0%;5;15;0

...

# rpm -i nagios-plugins-2.2.2-2.20190926git1b8ad57.el7.x86_64.rpm
# rpm -i nagios-plugins-ping-2.2.2-2.20190926git1b8ad57.el7.x86_64.rpm.1
# /usr/lib64/nagios/plugins/check_ping --version
check_ping v2.2.1.git (nagios-plugins 2.2.1)
# /usr/lib64/nagios/plugins/check_ping 8.8.8.8 -w 100,5% -c 200,15% -4 -p 5 -t 30
PING OK - Packet loss = 0%, RTA = 12.19 ms|rta=12.186000ms;100.000000;200.000000;0.000000 pl=0%;5;15;0
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_ping 2.2.1 bug?

Post by scottwilkerson »

I'm seeing "Host Unreachable"

Code: Select all

[root@localhost nagiosxi]# /usr/local/nagios/libexec/check_ping -V
check_ping v2.2.1 (nagios-plugins 2.2.1)
[root@localhost nagiosxi]# /usr/local/nagios/libexec/check_ping -H 192.168.254.254 -w 100,5% -c 200,15% -4 -p 5 -t 30
CRITICAL - Host Unreachable (192.168.254.254)
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_ping 2.2.1 bug?

Post by scottwilkerson »

Wait a second.... I see you have
Version : 2.2.2
Release : 2.20190926git1b8ad57.el7
What is this?

Plugins 2.2.2 hasn't even been released yet?
https://github.com/nagios-plugins/nagio ... s/releases

Looks like there may be an overzealous RPM EPEL packager, OR you have a dev branch setup or something...
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
jjani
Posts: 4
Joined: Mon Oct 28, 2019 6:53 am

Re: check_ping 2.2.1 bug?

Post by jjani »

Finally, what is the conclusion?
I saw that there are some acknowledging from this "feature".
Is this a bug?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_ping 2.2.1 bug?

Post by scottwilkerson »

It appears that the RPM maintainer packaged the maintenance branch of nagios-plugins and accidentally labeled it 2.2.2

Much of this has been addressed and will be in the real 2.2.2 nagios-plugins release which should be out in a few weeks.

For now, the best I can recommend would be to downgrade the nagios-plugins RPM to 2.2.1
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked