Page 1 of 2

issue 2 check remote server free disk space using check_nrpe

PostPosted: Fri Mar 30, 2018 8:27 am
by debdutta
Hi,
I am facing an issue to check Remote server's free disk space of a particular 'Path' using "check_nrpe" plugin.
I used below command to check the the free disk space for current logged in server and got the success --
./check_disk -w 20% -c 10% -p /var

( output --> DISK WARNING - free space: /var 918 MB (19% inode=66%);| /var=3737MB;3928;4419;0;4911)

However when I am trying to check the same (using check_nrpe) for other remote servers from my current logged in server using below command I am getting error message as " ./check_nrpe: invalid option -- 'w' Incorrect command line arguments supplied"

Command ---> ./check_nrpe -H pwemonap02.abc.com -w 20% -c 20% -p /var

I tried below command also but getting error message as "CHECK_NRPE: Socket timeout after 10 seconds."
Command --> ./check_nrpe -H pwemonap02.abc.com

I tried below command also but "Socket timeout" error is coming after 10 seconds.
Command --> ./check_nrpe -H pwemonap02.abc.com -c check_dm-o 'warning=free<20%' 'critical=free<10%' show-all

Appreciate all your extended help.

Regards
Debashis

Re: issue 2 check remote server free disk space using check_

PostPosted: Fri Mar 30, 2018 1:43 pm
by tgriep
When using arguments with the check_nrpe plugin, you have to add the -a option and then the options you need to pass to the remote NRPE system.

-a, --args=LIST Optional arguments that should be passed to the command,
separated by a space. If provided, this must be the last
option supplied on the command line.



For example, you would specify the check_nrpe command like the following.
Code: Select all
check_nrpe -H pwemonap02.prod.bn-web.com -a '-w 20% -c 20% -p /var'

Or like this
Code: Select all
check_nrpe -H pwemonap02.prod.bn-web.com -a -w 20% -c 20% -p /var


Depending on how the check_disk command is setup in the remote NRPE config file, you may have to change the arguments to match.

The Socket Timeout message could be caused by the following.
The NRPE agent is not running on the remote server.
The NRPE agent is not configured to listen to the Nagios servers IP address
The firewall is not allowing inbound connections to port 5666.

This article can help out in troubleshooting the NRPE agent.
https://support.nagios.com/kb/article/nrpe-check_nrpe-error-could-not-complete-ssl-handshake-615.html

Let us know if you have any other questions.

Re: issue 2 check remote server free disk space using check_

PostPosted: Sat Mar 31, 2018 5:43 am
by debdutta
Hi,
Thanks for your prompt reply.
As per your suggestion I tried both the command however I did not get the expected result. Below I am sharing the command along with error message --
1. Command ---> ./check_nrpe -H pwemonap02.abc.com -a '-w 20% -c 20% -p /var'
Output ---> CHECK_NRPE: Socket timeout after 10 seconds.

2. Command ---> ./check_nrpe -H pwemonap02.abc.com -a -w 20% -c 20% -p /var
Incorrect command line arguments supplied


NRPE Plugin for Nagios
Copyright (c) 1999-2008 Ethan Galstad (nagios@nagios.org)
Version: 2.15
Last Modified: 09-06-2013


I Think we need to pass the user ID and PWD of "pwemonap02.abc.com" server. What is the option/parameter for that.

Regarding NRPE installation status & validity of the Port in "pwemonap02.abc.com" server, I already send the request to our "Nagios" Admin team.

Re: issue 2 check remote server free disk space using check_

PostPosted: Mon Apr 02, 2018 8:30 am
by debdutta
Hi,
Add on my last reply, I also tried below command however same Socket Time out error is coming --

./check_nrpe -H test02.com -c check_disk -a '-w 20% -c 20% -p /var'
CHECK_NRPE: Socket timeout after 10 seconds.



To check the port I used below command however no output found --

netstat -anp|grep 5666

Appreciate all your extended help.

Re: issue 2 check remote server free disk space using check_

PostPosted: Mon Apr 02, 2018 11:14 am
by scottwilkerson
debdutta wrote:Hi,
Add on my last reply, I also tried below command however same Socket Time out error is coming --

./check_nrpe -H test02.com -c check_disk -a '-w 20% -c 20% -p /var'
CHECK_NRPE: Socket timeout after 10 seconds.



To check the port I used below command however no output found --

netstat -anp|grep 5666

Appreciate all your extended help.

This actually looks better, but is test02.com setup to accept the connection?

how about
Code: Select all
./check_nrpe -H pwemonap02.prod.bn-web.com -c check_disk -a -w 20% -c 20% -p /var

Re: issue 2 check remote server free disk space using check_

PostPosted: Wed Apr 04, 2018 6:20 am
by debdutta
Hi,
Thanks for your reply, I already tried the suggested below command also however same error message is coming --------

./check_nrpe -H pwemonap02.abc.com -c check_disk -a -w 20% -c 20% -p /var
Incorrect command line arguments supplied

NRPE Plugin for Nagios
Copyright (c) 1999-2008 Ethan Galstad (nagios@nagios.org)
Version: 2.15


Regarding connectivity of the server pwemonap02.abc.com, I tried the below command and get expected result -----

./check_disk -w 20% -c 10% -p /var

Appreciate your early response.

Re: issue 2 check remote server free disk space using check_

PostPosted: Wed Apr 04, 2018 8:43 am
by scottwilkerson
Something stripped my quote out, I meant to have you try
Code: Select all
./check_nrpe -H pwemonap02.prod.bn-web.com -c check_disk -a '-w 20% -c 10% -p /var'

Re: issue 2 check remote server free disk space using check_

PostPosted: Thu Apr 05, 2018 5:36 am
by debdutta
Hi,
Tried below command also however same 'Socket Timeout' message is coming ---

pwemonap01:/usr/local/nagios/libexec$ ./check_nrpe -H pwemonap02.abc.com -c check_disk -a '-w 20% -c 10% -p /var'
CHECK_NRPE: Socket timeout after 10 seconds.

For checking purpose tried to connect "pwemonap01.abc.com" from "pwemonap02.abc.com" host using below command however the output message is different in this case ---

pwemonap02:/usr/local/nagios/libexec$ ./check_nrpe -H pwemonap01.abc.com -c check_disk -a '-w 20% -c 10% -p /var'
connect to host pwemonap01.abc.com port 5666: Connection refused

I think there is some permission related issue is there against "check_nrpe" .
It will be great if you can help me to cross check that all necessary permission/access is there to execute check_nrpe plugin.

For your information, I execute below command on both pwemonap01 & 02 server and get expected result ---
./check_disk -w 20% -c 10% -p /var
DISK OK - free space: /var 2436 MB (52% inode=99%);| /var=2218MB;3928;4419;0;4911

Please note that I am using my Personal "UID" & "PWD" to logging which have execution permission of all 'Nagios' plugin

Appreciate all your extended help.

Re: issue 2 check remote server free disk space using check_

PostPosted: Thu Apr 05, 2018 9:15 am
by scottwilkerson
How did you install NRPE on each of these machines? Are you sure it is running? Did you add the other servers IP to the allowed IP list ?

Can you send up the nrpe.cfg and and other .cfg files included in it

Re: issue 2 check remote server free disk space using check_

PostPosted: Thu Apr 05, 2018 11:07 am
by debdutta
Hi,
I am using above commands from Command Line (pwemonap02:/usr/local/nagios/libexec$ ) only to check the correctness of the command.
I try to find out the nrpe.cfg under "/usr/local/nagios/" folder however could not find out the same.

Regarding NRPE installation if I type "/usr/local/nagios/libexec$ ./check_nrpe" from command prompt I am getting below message

Incorrect command line arguments supplied

NRPE Plugin for Nagios
Copyright (c) 1999-2008 Ethan Galstad (nagios@nagios.org)
Version: 2.15
Last Modified: 09-06-2013
License: GPL v2 with exemptions (-l for more info)
SSL/TLS Available: Anonymous DH Mode, OpenSSL 0.9.6 or higher required


Usage: check_nrpe -H <host> [ -b <bindaddr> ] [-4] [-6] [-n] [-u] [-p <port>] [-t <timeout>] [-c <command>] [-a <arglist...>]

Pl. help me to prepare the nrpe.cfg file if it is mandatory to check the command from 'Command prompt' and let me know where i have to save that .cfg file.