Package: needrestart
Version: 2.11-3
Severity: normal
Tags: patch

Dear Maintainer,

I tried running "needstart -p" from nagios-nrpe-server using
command[check_restart]=/usr/sbin/needrestart -p

My icinga dashbord then shows "UNKOWN NRPE: Unable to read output".

I expected to read "UNKOWN - This plugin needs to be run as root!".


Calling manually
/usr/lib/nagios/plugins/check_nrpe -H targethost -c check_restart
on the icinga server results in
UNKOWN NRPE: Unable to read output

Calling manually "/usr/sbin/needrestart -p" as nagios user on the targethost
results in
UNKN - This plugin needs to be run as root!
being sent to STDERR and not to STDOUT.

This is an NRPE protocol implementation error.

The following patch fixes the issue:

--- needrestart-2.11.orig/needrestart
+++ needrestart-2.11/needrestart
@@ -198,7 +198,7 @@ print STDERR "$LOGPREF needrestart v$Nee
 my $uid = $<;
 if($uid) {
     if($opt_p) {
-       print STDERR "UNKN - This plugin needs to be run as root!\n";
+       print "UNKN - This plugin needs to be run as root\n";
        exit 3;
     }




Thank you for taking care of needrestart. <3

Reply via email to