I'm trying to get a plugin to work (check-ubuntu-apt) on some Ubuntu hosts. On some it works, but on others it fails. The strange thing is that, if I run the plugin as the nagios user on that host, it succeeds. The failure is NOT the typical SSL failure, and other nagios checks are succeeding.
The failure is internal to the plugin, but difficult to track down. I'm trying to understand what in the environment could be causing the failure.
Command I'm running:
"sudo -u nagios /usr/lib/nagios/plugins/check-ubuntu-apt"
Return is fine:
"All packages are up-to-date.|valid=1,pending=0,security=0,non-security=0"
However, when I run on my monitoring machine "/usr/lib/nagios/plugins/check_nrpe -H <hostip> -c check-ubuntu-apt", I get
"Querying pending updates failed.|valid=0,pending=0,security=0,non-security=0"
Here is the debug output in my syslog:
Apr 20 16:29:33 host nrpe[27259]: Running command: /usr/lib/nagios/plugins/check-ubuntu-apt
Apr 20 16:29:33 host nrpe[27259]: Command completed with return code 3 and output: Querying pending updates failed.|valid=0,pending=0,security=0,non-security=0
Apr 20 16:29:33 host nrpe[27259]: Return Code: 3, Output: Querying pending updates failed.|valid=0,pending=0,security=0,non-security=0
My entry in /etc/nagios/nrpe.cfg:
command[check-ubuntu-apt]=/usr/lib/nagios/plugins/check-ubuntu-apt
I don't understand how those two things can return different codes.
Plugin fails only from remote host
-
jdalrymple
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Plugin fails only from remote host
selinux and/or apparmor could cause this behavior, are they disabled?
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Plugin fails only from remote host
Can you provide the plugin check-ubuntu-apt.
Does the plugin perhaps write a temp file somewhere like /var/tmp/ ? If so, does it have appropriate permissions to do so?
Does the plugin perhaps write a temp file somewhere like /var/tmp/ ? If so, does it have appropriate permissions to do so?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.