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

2014-10-20 Thread Jan Wagner
-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 w...@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-


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



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

2014-10-20 Thread Christian Kujau
On Mon, 20 Oct 2014 at 15:34, Jan Wagner wrote:
  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 don't understand, why is this unrelated? I would expect the plugin to 
report SWAP CRITICAL, even when queried via NRPE.

I've just installed nagios-nrpe-server  nagios-plugins-basic on a test VM 
with Debian/wheezy and tried to reproduce this issue (reports OK via nrpe, 
reports CRITICAL when queried directly) but here check_swap reports always 
OK when swap is disabled, no matter if queried directly or via nrpe. 
Again, not what one would expect.

$ /usr/lib/nagios/plugins/check_swap -w 20% -c 10%; echo $?
SWAP OK - 100% free (0 MB out of 0 MB) |swap=0MB;0;0;0;0
0

$ /usr/lib/nagios/plugins/check_nrpe -H localhost -p 5666 -c check_swap; echo $?
SWAP OK - 100% free (0 MB out of 0 MB) |swap=0MB;0;0;0;0
0

 This is not the upstream repository, but it`s
 https://github.com/monitoring-plugins/monitoring-plugins.

Ah, OK. nagios-plugins-basic lists http://nagiosplug.sourceforge.net as 
its homepage which now redirects to https://nagios-plugins.org/ and cites 
https://github.com/nagios-plugins/repositories as its Github repo.

 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.

This makes it sound like a cosmetic issue, but it's not: check_swap is 
report SWAP OK (exitcode 0) when swap is disabled while it should report 
CRITICAL and a return code of 2.

But yeah, the backports version fixes this issue.

Christian.


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org