Page 2 of 3

Re: NRPE configuration question

Posted: Wed Apr 17, 2019 1:08 pm
by rferebee
Here are the other two screen shots.

Re: NRPE configuration question

Posted: Wed Apr 17, 2019 1:26 pm
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.

Re: NRPE configuration question

Posted: Wed Apr 17, 2019 3:16 pm
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?

Re: NRPE configuration question

Posted: Wed Apr 17, 2019 3:29 pm
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.

Re: NRPE configuration question

Posted: Tue Apr 23, 2019 4:07 pm
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.

Re: NRPE configuration question

Posted: Tue Apr 23, 2019 4:21 pm
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.

Re: NRPE configuration question

Posted: Wed Apr 24, 2019 9:55 am
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.

Re: NRPE configuration question

Posted: Wed Apr 24, 2019 2:58 pm
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'

Re: NRPE configuration question

Posted: Wed Apr 24, 2019 3:10 pm
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?

Re: NRPE configuration question

Posted: Wed Apr 24, 2019 4:10 pm
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.