[Bug 557862] New: result of nagios plugin check_zypper is interpreted as critical even if OK
http://bugzilla.novell.com/show_bug.cgi?id=557862 http://bugzilla.novell.com/show_bug.cgi?id=557862#c0 Summary: result of nagios plugin check_zypper is interpreted as critical even if OK Classification: openSUSE Product: openSUSE 11.2 Version: Final Platform: All OS/Version: openSUSE 11.2 Status: NEW Severity: Minor Priority: P5 - None Component: Other AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: syntron@web.de QAContact: qa@suse.de Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.10 (like Gecko) SUSE there exists a nagios plugin to check zypper for updates. The plugin returns (line 372) $ret_str="OK: no updates available "; If there are no updates. This is interpreted as 'Critical' by nagios. If I change this line to (line 372) $ret_str="OK - no updates available "; it is working as expected. Reproducible: Always Steps to Reproduce: 1. add check_zypper as nagios plugin 2. 3. Actual Results: status critical Expected Results: status OK (if there are no updates) -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=557862 http://bugzilla.novell.com/show_bug.cgi?id=557862#c1 --- Comment #1 from Matthias Pfafferodt <syntron@web.de> 2009-11-23 21:42:47 UTC --- The solution I posted only worked due to luck. I'm using nrpe to call check_zypper on another host in the network. check_zypper returns OK as text but the return code of check_nrpe does not match: x113:/usr/lib/nagios/plugins # ./check_nrpe -c check_zypper -H 192.168.110.114 Updates OK - no updates available | security=0;;;; recommended=0;;;; optional=0;;;; packages=0;;;; x113:/usr/lib/nagios/plugins # RES=$?; echo $RES 2 x113:/usr/lib/nagios/plugins # After I run check_zypper directly on the host all is as expected. I will check if this happens again after some time. Perhaps a timeout problem? -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=557862 http://bugzilla.novell.com/show_bug.cgi?id=557862#c2 --- Comment #2 from Matthias Pfafferodt <syntron@web.de> 2009-11-24 21:06:43 UTC --- I got the error again. This time I checked the ./check_zypper script. A global variable $exitcode is defined and set to 0 (=OK) at the beginning of the script. Within the script this variable is used (and the value could be changed) in the function check_errorcode(). This function is called within check(). In the main function, check is called and returns the correct error code. But not this value is used but the (kind of undefined) value of $errorcode. The following patch (hack?) solves the problem by setting $errorcode to the value corresponding to the error returned by check(): --- check_zypper.org 2009-11-24 20:49:39.294295058 +0000 +++ check_zypper 2009-11-24 20:49:04.000000000 +0000 @@ -476,6 +476,7 @@ } else { my ($ret_str,$error)=check(); print "Updates $ret_str"; + $exitcode = $ERRORS{$error}; print STDERR "INFO: Exit-Code: ".$exitcode."\n" if ($DEBUG); exit $exitcode; } -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=557862 http://bugzilla.novell.com/show_bug.cgi?id=557862#c3 --- Comment #3 from Matthias Pfafferodt <syntron@web.de> 2009-11-24 21:10:53 UTC --- Created an attachment (id=329310) --> (http://bugzilla.novell.com/attachment.cgi?id=329310) patch for check_zypper -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=557862 http://bugzilla.novell.com/show_bug.cgi?id=557862#c shuang qiu <sqiu@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sqiu@novell.com AssignedTo|bnc-team-screening@forge.pr |cschneemann@novell.com |ovo.novell.com | -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=557862 http://bugzilla.novell.com/show_bug.cgi?id=557862#c Christian Schneemann <schneemann@b1-systems.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |schneemann@b1-systems.de AssignedTo|cschneemann@novell.com |lrupp@novell.com -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=557862 http://bugzilla.novell.com/show_bug.cgi?id=557862#c4 Lars Vogdt <lrupp@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO CC| |lrupp@novell.com Info Provider| |syntron@web.de --- Comment #4 from Lars Vogdt <lrupp@novell.com> 2010-01-20 17:12:29 UTC --- Thanks for your patch and sorry for the late reply. I added your patch to the latest check_zypper version available in the network:monitoring repository. Can you please test this version and give me some feedback if this solves your problem? -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=557862 http://bugzilla.novell.com/show_bug.cgi?id=557862#c5 Matthias Pfafferodt <syntron@web.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW Info Provider|syntron@web.de | --- Comment #5 from Matthias Pfafferodt <syntron@web.de> 2010-02-01 10:14:43 UTC --- I found a version with the patch at server:monitoring. This version seems to work (no error anymore). Thanks! -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=557862 http://bugzilla.novell.com/show_bug.cgi?id=557862#c6 Lars Vogdt <lrupp@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |CLOSED Resolution| |FIXED --- Comment #6 from Lars Vogdt <lrupp@novell.com> 2010-02-05 14:53:50 UTC --- OK, thanks for your answer! Closing the bug here now. I'm already working on another check_zypper bug - so there's no need for an update here. The final update will be released once the other one is fixed. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=557862 http://bugzilla.novell.com/show_bug.cgi?id=557862#c7 Swamp Workflow Management <swamp@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status Whiteboard| |maint:released:11.1:31832 | |maint:released:11.2:31832 --- Comment #7 from Swamp Workflow Management <swamp@suse.com> 2010-03-18 18:10:33 UTC --- Update released for: nagios-plugins-zypper Products: openSUSE 11.1 (i586) openSUSE 11.2 (i586) -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com