I have an old CentOS 7 server that has had NRPE 2.15 with a bunch of plugins running for some time. I recently upgraded NRPE to 3.1.1 and now 2 of the plugins do not work, but I am unable to figure out why?
one of the plugins is this: https://exchange.nagios.org/directory/P ... ge/details
When I run the check_nrpe from my nagios server, I get:
# /usr/lib/nagios/plugins/check_nrpe -H myserver.domain -c check_om_storage
NRPE: Unable to read output
On the server being monitored, i turned on debug=1 for nrpe and i see this message:
[1499296006] Host x.x.x.x is asking for command 'check_om_storage' to be run...
[1499296006] Running command: /usr/lib64/nagios/plugins/check_om_storage
[1499296006] Command completed with return code 3 and output:
[1499296006] Return Code: 3, Output: NRPE: Unable to read output
[1499296006] Connection from x.x.x.x closed.
So far, everything is consistent. But when I try to run the plugin directly, as 'nrpe':
$ id ; pwd
uid=991(nrpe) gid=988(nrpe) groups=988(nrpe) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
/var/run/nrpe
$ /usr/lib64/nagios/plugins/check_om_storage
STORAGE: OK
$ echo $?
0
The plugin appears to return '0', not '3'?
I have not changed any configuration and everything was working fine before the upgrade to 3.1.1. What could be causing this? And why is nrpe saying the command completed with return code 3 and no output, but when I run it manually, I get different result?
Any help would be appreciated... thanks!
upgrade from NRPE 2.15 to 3.1.1 broke some plugins
Re: upgrade from NRPE 2.15 to 3.1.1 broke some plugins
Can you provide the steps used to remove the old agent and install the new one?
One thing to check is to see if the new NRPE agent is running as the nagios user account and not the nrpe account.
If so, then you would either change the permissions for the plugin so the nagios user can execute it or change the NRPE agent to run as the nrpe user.
One thing to check is to see if the new NRPE agent is running as the nagios user account and not the nrpe account.
If so, then you would either change the permissions for the plugin so the nagios user can execute it or change the NRPE agent to run as the nrpe user.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: upgrade from NRPE 2.15 to 3.1.1 broke some plugins
Thanks for the reply. I don't think that's the problem, as all the other plugins work, just 2 plugins get this strange behavior as above.
But, to double check, I ran this command:
$ps -eo user,args | grep [n]rpe
nrpe /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d
And it shows nrpe is running as user 'nrpe'. Which is how i tested above; I temporarily gave the account a shell and su - nrpe to simulate running the plugin as 'nrpe'. It runs just fine, but when done from the Nagios server, the behavior is different as reported in the OP.
To answer your question more directly, it was just an rpm upgrade.
But, to double check, I ran this command:
$ps -eo user,args | grep [n]rpe
nrpe /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d
And it shows nrpe is running as user 'nrpe'. Which is how i tested above; I temporarily gave the account a shell and su - nrpe to simulate running the plugin as 'nrpe'. It runs just fine, but when done from the Nagios server, the behavior is different as reported in the OP.
To answer your question more directly, it was just an rpm upgrade.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: upgrade from NRPE 2.15 to 3.1.1 broke some plugins
From the plugin help
So if this is running as nrpe user, I think you would need the following in your sudoers file
Code: Select all
check_om_storage.pl (C) 2005 - 2017 Riege Software International GmbH
This script analyzes the state of DELL storage devices using the "omreport"
command from the DELL OpenManage 4.3 or later distribution.
As some versions of OpenManage require root privileges, please add the
following line to /etc/sudoers if you have permission issues:
("nagios" is the user running the script and may be a different user on
your system depending on your Nagios Plugins and nrpe setup)
nagios ALL= NOPASSWD: /usr/bin/omreport *
A note on detection quality: OpenManage reports some states as "Non-Critical"
which are of pure informational purpose, thereby creating Nagios warnings.
The script will circumvent this for all "known to be good" states like
charging controller batteries. Though, there are states unknown to the
script's developer. See the --analysze option for help.
Usage:
check_om_storage.pl [--analyze] [--help] [--sudo] [--verbose]
--analyze: Scan Storage System and display OpenManage Output and script
results. Use this if your storage system is not properly checked
and send the output to schlegel@riege.com .
--help: Display exactly this text.
--sudo: Use sudo to run omreport.
--verbose: run script in debug mode.
--warn: Warn if driver or firmware issues are detected.
(default is to report in result text with OK status)
Code: Select all
nrpe ALL= NOPASSWD: /usr/bin/omreport *