Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
krishnar
Posts: 13 Joined: Sun Nov 06, 2016 4:08 pm
Post
by krishnar » Fri Apr 07, 2017 12:09 pm
Hi All,
I need help with installing NRPE is my lab Nagios Server. I have follow these instruction to install NRPE:
Code: Select all
wget https://github.com/NagiosEnterprises/nrpe/archive/3.0.1.tar.gz
gunzip 3.0.1.tar.gz
tar -xf 3.0.1.tar
cd nrpe-3.0.1/
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make all
make install
This configuration install NRPE plug to /usr/local/nagios folder. However, my Nagios is running in /opt/nagios.
Is there any way I can change the installation path to /opt/nagios ?
tgriep
Madmin
Posts: 9177 Joined: Thu Oct 30, 2014 9:02 am
Post
by tgriep » Fri Apr 07, 2017 1:09 pm
When you run the configure script, you can change the destination of where the Agent is installed by using the prefix option.
In your case, you would run the following to install in the /opt/nagios folder.
Code: Select all
./configure --with-nagios-user=nagios --with-nagios-group=nagios --prefix=/opt/nagios
Be sure to check out our
Knowledgebase for helpful articles and solutions!
krishnar
Posts: 13 Joined: Sun Nov 06, 2016 4:08 pm
Post
by krishnar » Fri Apr 07, 2017 1:35 pm
Thank you for helping me..I have got one more query.
Code: Select all
[user@krishnar1 etc]$ cat nrpe.cfg | egrep ^command.*check_users
command[check_users]=/usr/local/nagios/libexec/check_users -w $ARG1$ -c $ARG2$
I have the above config in my remote host. I am not able to do the check from Nagios Core with passing the arguments.
-bash-4.2$ ./check_nrpe -H 172.31.116.108 -4 -c check_users
-a 1 2
NRPE: Command 'check_users!1!2' not defined
-bash-4.2$
But this works fine!
-bash-4.2$ ./check_nrpe -H 172.31.116.108 -4 -c check_users
USERS OK - 1 users currently logged in |users=1;5;10;0
-bash-4.2$
Any help would be appreciated.
krishnar
Posts: 13 Joined: Sun Nov 06, 2016 4:08 pm
Post
by krishnar » Fri Apr 07, 2017 1:54 pm
After NRPE service restart in Remote host:
Code: Select all
-bash-4.2$ ./check_nrpe -H 172.31.116.108 -4 -c check_users
check_users: Warning threshold must be a positive integer
Usage:
check_users -w <users> -c <users>
-bash-4.2$
-bash-4.2$
-bash-4.2$ ./check_nrpe -H 172.31.116.108 -4 -c check_users -a 5 10
check_users: Warning threshold must be a positive integer
Usage:
check_users -w <users> -c <users>
-bash-4.2$
tgriep
Madmin
Posts: 9177 Joined: Thu Oct 30, 2014 9:02 am
Post
by tgriep » Fri Apr 07, 2017 1:56 pm
There is a setting in the nrpe.cfg file called dont_blame_nrpe option. If it is set to 0, this disables the ability to pass arguments to the NRPE Agent and could be causing your issue.
Set that option to a 1 and restart the nrpe agent and see if you can pass arguments with the check_nrpe command.
You always have to restart the nrpe agent if you edit the nrpe,cfg file, BTW.
Also, try running your command like the following and see if that works.
Code: Select all
./check_nrpe -H 172.31.116.108 -4 -c check_users -a '5 10'
Be sure to check out our
Knowledgebase for helpful articles and solutions!
lmiltchev
Former Nagios Staff
Posts: 13587 Joined: Mon May 23, 2011 12:15 pm
Post
by lmiltchev » Fri Apr 07, 2017 1:57 pm
Change this line (in the nrpe.cfg file) from this:
to this:
and restart nrpe service (if nrpe is running as a standalone daemon) or xinet.
Let us know if this helped.
Be sure to check out our
Knowledgebase for helpful articles and solutions!
krishnar
Posts: 13 Joined: Sun Nov 06, 2016 4:08 pm
Post
by krishnar » Fri Apr 07, 2017 3:07 pm
Oops..I forgot to mention that earlier..I had already enabled that option and restarted NRPE daemon in remote host after making changes to nrpe.cfg.
Code: Select all
[user@krishnar1 etc]$ grep blame nrpe.cfg
dont_blame_nrpe=1
# command arguments *AND* the dont_blame_nrpe directive in this
[user@krishnar1 etc]$
[user@krishnar1 etc]$ grep command_sub nrpe.cfg
allow_bash_command_substitution=1
From Nagios Core Host:
-bash-4.2$ ./check_nrpe -H 172.31.116.108 -4 -c check_users -a '5 10'
NRPE: Command 'check_users!5 10' not defined
The error says command is not defined.
This is the command definition in remote host nrpe.cfg file.
[user@krishnar1 etc]$ grep check_users nrpe.cfg
#command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10
command[check_users]=/usr/local/nagios/libexec/check_users -w $ARG1$ -c $ARG2$
#command[check_users]=/usr/local/nagios/libexec/check_users -w $ARG1$ -c $ARG2$
[user@krishnar1 etc]$
Totally confused!
scottwilkerson
DevOps Engineer
Posts: 19396 Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:
Post
by scottwilkerson » Fri Apr 07, 2017 3:43 pm
Out of curiosity what version of check_nrpe do you have on your Nagios Core host
krishnar
Posts: 13 Joined: Sun Nov 06, 2016 4:08 pm
Post
by krishnar » Mon Apr 10, 2017 11:34 am
-bash-4.2$ ./check_nrpe -h | head -7
NRPE Plugin for Nagios
Copyright (c) 1999-2008 Ethan Galstad (
nagios@nagios.org )
Version: 3.0.1
Last Modified: 09-08-2016
License: GPL v2 with exemptions (-l for more info)
SSL/TLS Available: OpenSSL 0.9.6 or higher required
-bash-4.2$