[Pkg-nagios-devel] Bug#765879: Bug#765879: check_swap reports SWAP OK when queried via nrpe and swap is disabled

Jan Wagner waja at cyconet.org
Mon Oct 20 13:34:19 UTC 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

tags 765879 = unreproducible
thanks

Hi Christian,

thanks for taking time and reporting the issue.

Am 18.10.14 23:32, schrieb Christian Kujau:
> When I executed check_swap locally, it returned CRITICAL, as
> expected:
> 
> $ /usr/lib/nagios/plugins/check_swap -w 20 -c 10; echo $? SWAP
> CRITICAL - 100% free (0 MB out of 0 MB) |swap=0MB;0;0;0;0 2

Which means that the plugins works as expected (It`s critical).

> When attaching strace(1) to the nrpe process, the following can be
> seen:
> 
>> execve("/bin/sh", ["sh", "-c",
>> "/usr/lib/nagios/plugins/check_swap -w 20% -c 10%"], [/* 6 vars
>> */]) = 0 open("/proc/meminfo", O_RDONLY|O_LARGEFILE) = 3 write(1,
>> "SWAP OK - 100% free (0 MB out of 0 MB) |swap=0MB;0;0;0;0\n", 57)
>> = 57
> 
> So, for some reason check_swap returns "SWAP OK" when it should
> return "SWAP CRITICAL".

Which is unrelated to the plugin from my point of view.

> I've seen this commit in the upstream repo:
> 
>> https://github.com/nagios-plugins/nagios-plugins/commit/bf5bb6b59f820daf08bd2e0c1187628d11de9097
>>
>> 
Added check for total_swap_mb == 0, and if present, sets used to 100% and
>> changes status output in this case for readability
> 
> ....which made it into the 2.0 release as well:

This is not the upstream repository, but it`s
https://github.com/monitoring-plugins/monitoring-plugins. Any yes,
there is a similar commit:

https://github.com/monitoring-plugins/monitoring-plugins/commit/6f2d545244193432a6ad3d54185628b8f6a6091e

>> https://nagios-plugins.org/nagios-plugins-2-0-released/ 
>> check_swap – Now fails with 100% usage and a new status output 
>> when swap is disabled or missing (abrist)
> 
> So, while nagios-plugins-basic 2.1-1 is in unstable, can this be
> fixed in stable as well?

Anyhow, it`s very unlikely that we push such a minor change (just
fixing the output message, not the state nor return code) into a
stable release. Anyhow, you could grab the wheezy-backports version.
For instructions see http://backports.debian.org/Instructions/

Cheers, Jan.
- -- 
Never write mail to <waja at spamfalle.info>, you have been warned!
- -----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GIT d-- s+: a C+++ UL++++ P+ L+++ E--- W+++ N+++ o++ K++ w--- O M V-
PS PE Y++
PGP++ t-- 5 X R tv- b+ DI D+ G++ e++ h---- r+++ y++++
- ------END GEEK CODE BLOCK------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.22 (Darwin)
Comment: GPGTools - https://gpgtools.org

iQIcBAEBCgAGBQJURQ9bAAoJEAxwVXtaBlE+zVsP/iTq1fyXK42GJtRhCseCP/ZL
L/qAMyqrOokwcop1xsvqVqmerD9mKBdFiLOBll3GEdY9ohIHdRpHqU8ErDM+d0qV
TZ6r39flncbKJOVU0nafUBR3qC9NW4nqWjuXu50dide4uFKgXM2f7ZIv03YoLMUy
jZ/Y0Hw0ikuxPbiQQ0U107BK/chfQPKxLy5qrrWYIgbhKrCFk0d/qhWPVVh5HqRH
fRVB/gbHhIX8CB8ZEnXrede3VVozLPUx7DozVC46rIdMxsBBb71pzzv2ab6RG9hi
j0IrYvMsAs4DaKlhWFVev8vKlt9nZvwbQBlS3u0rlke+7lkwdR7fHfhkO3qh5ISc
FuDJoHsP9bRRW3T8CyNtKyWckRymnCvyBVGkNhOzlHR/HNyZ0WqZyFMFcc3GUzMS
jHMeUAlxvJRENy8Y2ZXwJ5nIO+EFGtUei+ORAgWCWlAQEP5iOLvZF0QtVYl18P3E
QRih2Xao+NwAmxtq38Y7dOS3Z0b4j8xe1z9BLykgZlnBY7Gp2O0w+g4lyItuDguq
4S8RO39Q0FvwuJQmfVhvplE9CPHTKhHRbhO4GFKc90LuMY0H5l6MO6HnO2Nc1t88
jb7nJ6ImkD/+mE5Ol20SN6hrolgOYWiufTmniut8GQRDDrzAVswHIP/DJ9+bfVvE
ocQlriE6KOhp3FEyDYG8
=nZQ5
-----END PGP SIGNATURE-----



More information about the Pkg-nagios-devel mailing list