Monitoring remote hosts using NRPE on another remote host

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.
Apurv
Posts: 27
Joined: Wed Dec 17, 2014 8:34 pm

Re: Monitoring remote hosts using NRPE on another remote hos

Post by Apurv »

Hi Box293,

I tried to configure indirect check on nagios server using the steps u had provided me but I was only able to successfully test it till 2nd step, that is getting output on Host(B) from command prompt.

When I try to perform a indirect check from nagios server using the below command I get an error :
============================
./check_nrpe -H <Host(b) IP address> -c nrpe_query -a host=<Host(c) IP address> query-command=CheckCPU query-arguments="warn=80" query-arguments="crit=90" query-arguments="time=1m" query-arguments="time=5m" query-arguments="time=15m"
============================

I get the below error :
===================================
Exception processing request: Request contained arguments (not currently allowed, check the allow arguments option).
===================================


Could you and tmcdonald help me out please???

Awaiting your reply!
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Monitoring remote hosts using NRPE on another remote hos

Post by Box293 »

Both host B and C need to allow arguments. On each host, open a command prompt and execute the following:

Code: Select all

cd "\Program Files\NSClient++\" 
nscp settings --path /settings/NRPE/server --key "allow arguments" --set true
Then restart the NSClient++ service on both servers.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Apurv
Posts: 27
Joined: Wed Dec 17, 2014 8:34 pm

Re: Monitoring remote hosts using NRPE on another remote hos

Post by Apurv »

Hi,

I am again here with a small query. I have setup everything now. The only issue that I am facing now is that I am getting "Critical state" email alerts for "Total Processes" service on few of the hosts.

I have changed the parameters for (warning and critical states to 400/500) in below command :
===================================
check command : check_nrpe!check_total_procs!400!500!RSZDT
===================================

After doing this and restarting the nagios service,nagios web interface still shows them in critical state as the default values(warning/Critical) for this service are 250 and 400. Could you please help me out with this and help me resolve this issue.

Thanks in advance.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Monitoring remote hosts using NRPE on another remote hos

Post by Box293 »

Apurv wrote:After doing this and restarting the nagios service,nagios web interface still shows them in critical state as the default values(warning/Critical) for this service are 250 and 400.
Did you wait until the next check of the service to occur? What happens when you "Re-schedule the next check of this service", does it go back to 0?

What is the output you are getting?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Apurv
Posts: 27
Joined: Wed Dec 17, 2014 8:34 pm

Re: Monitoring remote hosts using NRPE on another remote hos

Post by Apurv »

Hello Box293,

I re-scheduled the checks for these services, still it shows critical warning with a red background. This is happening even when the values are set high as explained in my last reply.

Any other fix that we can try?
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Monitoring remote hosts using NRPE on another remote hos

Post by lmiltchev »

How many processes do you have running on the remote box? Can you show us the actual command run from the command line along with the output of it? Also, show us how the command is defined on the client. Here's a couple of examples:

Code: Select all

command[check_total_procs]=/usr/local/nagios/libexec/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c check_total_procs -a 400 500 RSZDT
PROCS OK: 135 processes with STATE = RSZDT | procs=135;400;500;0;
or

Code: Select all

command[check_procs]=/usr/local/nagios/libexec/check_procs $ARG1$

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c check_procs -a '-w 400 -c 500 -s RSZDT'
PROCS OK: 137 processes with STATE = RSZDT | procs=137;400;500;0;
Be sure to check out our Knowledgebase for helpful articles and solutions!
Apurv
Posts: 27
Joined: Wed Dec 17, 2014 8:34 pm

Re: Monitoring remote hosts using NRPE on another remote hos

Post by Apurv »

Hey All!

Sorry for the extremely delayed reply. How's nagios going with you all?

@lmiltchev : Yes! Buddy.. I was able to fix the issue with total processes. There was a minor change I needed to make which I didn't realize at the start but after having a deep look at your response I was able to figure out the change I needed to make and fix the issue.

Is anyone of you aware how can we extended the values for "warning" and "critical" states for the service "MySql-threads-connected"..... I am using check_mysql_health plugin to get stats regarding MySql

Help from all of you is always appreciated and needed....

Awaiting for your response guys!
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Monitoring remote hosts using NRPE on another remote hos

Post by Box293 »

Apurv wrote:Is anyone of you aware how can we extended the values for "warning" and "critical" states for the service "MySql-threads-connected"..... I am using check_mysql_health plugin to get stats regarding MySql
Can you please provide the current command you are using for check_mysql_health
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Apurv
Posts: 27
Joined: Wed Dec 17, 2014 8:34 pm

Re: Monitoring remote hosts using NRPE on another remote hos

Post by Apurv »

Hey Box293,

How are you? Sorry for the my late reply!

The command I am using is :
=============================
check_command check_mysql_health!Server-IP!3306!Username!Password!threads-connected
=============================

And the command definition being used is :
=============================
define command{
command_name check_mysql_health
command_line $USER1$/check_mysql_health -H $ARG1$ -port $ARG2$ -username $ARG3$ -password $ARG4$ -mode $ARG5$
}
=============================
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Monitoring remote hosts using NRPE on another remote hos

Post by Box293 »

Have you referred to this documentation:

https://labs.consol.de/nagios/check_mysql_health/

Specifically it lists:
Keyword Description Range
threads-connected Number of open connections 1..n (10, 20)
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked