NRPE configuration question

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
rferebee
Posts: 733
Joined: Wed Jul 11, 2018 11:37 am

Re: NRPE configuration question

Post by rferebee »

Here are the other two screen shots.
You do not have the required permissions to view the files attached to this post.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: NRPE configuration question

Post by npolovenko »

@rferebee, Looks like you've changed the check_nrpe command in the past?

Here's the standard command that is compatible with the wizard.
$USER1$/check_nrpe -2 -H $HOSTADDRESS$ -t 30 -c $ARG1$ $ARG2$
How many checks are already using the new check_nrpe command? You could rename your current check_nrpe command to check_nrpe_old and assign it to current services.
And then change the check_nrpe command to:
$USER1$/check_nrpe -2 -H $HOSTADDRESS$ -t 30 -c $ARG1$ $ARG2$
That way when you run the linux wizard next time all checks will start working right away.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
rferebee
Posts: 733
Joined: Wed Jul 11, 2018 11:37 am

Re: NRPE configuration question

Post by rferebee »

Dang. I don't know when that would have happened or why the default check would have been changed.

We have 1252 services using the current check, so I don't think changing it is an option. Unless there's a way I can rename the current check while leaving it applied to the services its on?
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: NRPE configuration question

Post by npolovenko »

@rferebee, Actually, you're right! Just rename the existing check_nrpe command to check_nrpe_old. Do it from the command menu in the CCM. It will automatically get updated for all existing services already using it. Then create a new command "check_nrpe":
$USER1$/check_nrpe -2 -H $HOSTADDRESS$ -t 30 -c $ARG1$ $ARG2$
The wizard will use check_nrpe next time it runs.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
rferebee
Posts: 733
Joined: Wed Jul 11, 2018 11:37 am

Re: NRPE configuration question

Post by rferebee »

Ok. I made the change to the 'check_nrpe' command.

Unfortunately, I'm still having issues. The checks are telling me either "Command 'abcdef' not defined" or "*** You must define WARN and CRITICAL levels!" or "check_swap: Warning threshold must be integer or percentage!".

The latter 2 are already defined and are integers or percentages. It seems that perhaps my nrpe.cfg file is not default or maybe missing some data? I don't know.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: NRPE configuration question

Post by npolovenko »

@rferebee, Are all checks failing or just some? Please open the service check configuration page, click on Run check Command and take a screenshot of the output.
Untitled.png
Also, please upload the /usr/local/nagios/etc/nrpe.cfg file from the remote server.
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
rferebee
Posts: 733
Joined: Wed Jul 11, 2018 11:37 am

Re: NRPE configuration question

Post by rferebee »

Here's the output of 'CPU Stats':

[nagios@nagiosxi ~]$ /usr/local/nagios/libexec/check_nrpe -2 -H 10.131.11.249 -t 30 -c check_cpu_stats -a '-w 85 -c 95' NRPE: Command 'check_cpu_stats' not defined

Attached is the nrpe.cfg file. Thank you.
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: NRPE configuration question

Post by lmiltchev »

The "check_cpu_stats" command is not defined in the nrpe.cfg file. Depending on how you installed NRPE on the client, you may have two options.

1. If you used our official Linux agent installer script, you would have this file - /usr/local/nagios/etc/nrpe/common.cfg. It is possible that you have "check_cpu_stats" command already defined there. Check to see if the command is defined there. If it is, you can simply add the path to the directory in the nrpe.cfg file by changing this:

Code: Select all

#include_dir=<somedirectory>
#include_dir=<someotherdirectory>
to this:

Code: Select all

#include_dir=<somedirectory>
include_dir=/usr/local/nagios/etc/nrpe
and restarting xinetd:

Code: Select all

service xinetd restart
2. If you don't find the /usr/local/nagios/etc/nrpe/common.cfg file on the client machine, define the "check_cpu_stats" command in the nrpe.cfg file:

Code: Select all

command[check_cpu_stats]=/usr/local/nagios/libexec/check_cpu_stats.sh $ARG1$
and restart xinetd.

Code: Select all

service xinetd restart
Test to see if your check works now by running the following command from the CLI on the Nagios XI server:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -2 -H 10.131.11.249 -t 30 -c check_cpu_stats -a '-w 85 -c 95'
Be sure to check out our Knowledgebase for helpful articles and solutions!
rferebee
Posts: 733
Joined: Wed Jul 11, 2018 11:37 am

Re: NRPE configuration question

Post by rferebee »

Thanks for the reply. We do not have the common.cfg file on our system.

In order for this (command[check_cpu_stats]=/usr/local/nagios/libexec/check_cpu_stats.sh $ARG1$), I would need to have check_cpu_stats.sh located here: /usr/local/nagios/libexec

I do not have that plugin.

Is there a way to perform a mass addition of the most commonly used plugins? I feel that we're missing things that should be there based on checks that the build in wizards create. For example, I feel like check_cpu_stats.sh should already be there otherwise why would the Linux Wizard create a check that uses that plugin?

Am I way off base in my thinking?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: NRPE configuration question

Post by lmiltchev »

You can download the linux-nrpe-agent tarball on the client machine, and copy the check_cpu_stats.sh plugin to the libexec directory.

Code: Select all

cd /tmp
wget https://assets.nagios.com/downloads/nagiosxi/agents/linux-nrpe-agent.tar.gz
tar xvf linux-nrpe-agent.tar.gz
cd linux-nrpe-agent/subcomponents/extraplugins/plugins
cp check_cpu_stats.sh /usr/local/nagios/libexec
Update:
As far as the most commonly used plugins goes, when installing NRPE on clients, we always recommend using our official Linux agent installer.
https://assets.nagios.com/downloads/nag ... _Agent.pdf

The script installs most commonly used plugins, official nagios plugins, and the NRPE agent. Most common commands are placed in a config file, called common.cfg, which is used by the "Linux Server" wizard.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked