nrpe reporting issues
nrpe reporting issues
We are experiencing the case where nrpe installs (using either Ubuntu based or Amazon Linux) fail to report correctly. The installs themselves on the clients are successful, the nrpe has the allowed host set correctly, and the plugin directory is present.
The errors we see in the NagiosXi server for these broken services are: NRPE: Command 'xxx_service' not defined.
What is very confusing is that some of these nrpe installs work out of the box, without defining the commands in the nrpe.cfg file, while others are failing.
Any clues or help would be greatly appreciated here.
The errors we see in the NagiosXi server for these broken services are: NRPE: Command 'xxx_service' not defined.
What is very confusing is that some of these nrpe installs work out of the box, without defining the commands in the nrpe.cfg file, while others are failing.
Any clues or help would be greatly appreciated here.
Re: nrpe reporting issues
Usually this error means there is a difference with the command name between the Nagios server and the command name on the client.
https://assets.nagios.com/downloads/nag ... utions.pdf
If the above doc does not enable you to resolve, then to start with, could you show us how these commands are defined on the client?
Also, show us the actual command that you are running from the command line on the Nagios XI server along with the output of it - thanks -
https://assets.nagios.com/downloads/nag ... utions.pdf
If the above doc does not enable you to resolve, then to start with, could you show us how these commands are defined on the client?
Also, show us the actual command that you are running from the command line on the Nagios XI server along with the output of it - thanks -
Be sure to check out the Knowledgebase for helpful articles and solutions!
Re: nrpe reporting issues
Thanks, I was able to resolve it for most services but am getting warning + NRPE: Unable to read output errors for the 'check_init_service' check we use for crod (crond) and ssh (sshd). This error only happens when the command is run from the nagiosxi server. The command is successful when run locally.
From what I can tell by drilling into the service and selecting 'advanced' in the nagiosxi gui, the command being passed is:
check_init_service line in nrpe.cfg:
The path is correct and consistent with the other commands that are working properly. Plugin permissions also match.
The client is running Amazon Linux (RHEL based).
From what I can tell by drilling into the service and selecting 'advanced' in the nagiosxi gui, the command being passed is:
Code: Select all
check_nrpe!check_init_service!-a 'crond'!!!!!!Code: Select all
command[check_init_service]=sudo /usr/lib64/nagios/plugins/check_init_service $ARG1$The client is running Amazon Linux (RHEL based).
Re: nrpe reporting issues
In your remote nrpe.cfg file do you have dont_blame_nrpe=1?
Re: nrpe reporting issues
In addition to what @ssax mentioned, what are the permissions of /usr/lib64/nagios/plugins/check_init_service? When you successfully ran the command locally, were you doing so as the Nagios user?
Former Nagios Employee
Re: nrpe reporting issues
Yes, blame is set to '1' in nrpe.cfg, and the permissions plugin permission is root:root 755, which matches the other plugins that are running successfully. The command is prefaced with 'sudo' in nrpe.cfg, and I'm logged in as ec2-user when run locally but use 'sudo'- ex. 'sudo ./check_init_service crond'
Re: nrpe reporting issues
This error could indicate a wrong path or insufficient sudo privileges.
The path may be correct in the nrpe.cfg file:
Do you have the check_init_service command added to sudoers on the client?
Example:
The path may be correct in the nrpe.cfg file:
but is it possible that you have the same command defined twice? Do you have a file called "common.cfg". If you used our "official" Linux agent installer, you should have it.command[check_init_service]=sudo /usr/lib64/nagios/plugins/check_init_service $ARG1$
Do you have the check_init_service command added to sudoers on the client?
Example:
Code: Select all
Defaults:nagios !requiretty
nagios ALL=NOPASSWD: /usr/lib64/nagios/plugins/check_init_serviceBe sure to check out our Knowledgebase for helpful articles and solutions!
Re: nrpe reporting issues
Thanks, the install was performed using the package manager (Yum) as the linux-agent installer does not support Amazon Linux. Head slapping 'I should have mentioned this' plot twist, I did copy the check_init_service plugin into this client from another nrpe client that used the linux agent installer (http://assets.nagios.com/downloads/nagi ... ent.tar.gz).lmiltchev wrote: but is it possible that you have the same command defined twice? Do you have a file called "common.cfg". If you used our "official" Linux agent installer, you should have it.
If there is a native plugin that handles the init service checks that is part of the rhel nrpe plugin package, please let me know what the plugin name is and I'll try it,
lmiltchev wrote:Do you have the check_init_service command added to sudoers on the client?
Example:
Code: Select all
Defaults:nagios !requiretty
nagios ALL=NOPASSWD: /usr/lib64/nagios/plugins/check_init_serviceRe: nrpe reporting issues
Update: I tried substituting the exact syntax for the parameter $ARG1$ in the check_init_service command in nrpe.cfg....
Then forcing a check in the Nagiosxi gui. Unfortunately, I get the same error. I also recreated the check_init_service file and ensured the proper permissions, 755, and owner, 'root' without success.
And again, running the command locally is not an issue. When I run the command with the parameter 'crond' locally, I receive:
Code: Select all
command[check_init_service]=sudo /usr/lib64/nagios/plugins/check_init_service crondAnd again, running the command locally is not an issue. When I run the command with the parameter 'crond' locally
Code: Select all
sudo ./check_init_service crondCode: Select all
crond (pid 1451) is running...Re: nrpe reporting issues
Success!!! Not sure why, but removing 'sudo' from the command in nrpe.cfg resolved the issue.
Locally I need to use sudo from a non-root user to get a correct response.
Locally I need to use sudo from a non-root user to get a correct response.