Page 1 of 1

Check_nrpe commands

Posted: Mon Aug 13, 2018 9:42 am
by RyanMule
Hello All,

I am in the process of upgrading out nsclient++ in doing so I have to update some checks... Currently I am working with check_nrpe with the check_drivesize command. I got it working however I cannot figure out how to change the crit and warning thresholds.

Below is the exact command I am using

./check_nrpe --host 192.168.240.205 --command check_drivesize
OK All 2 drive(s) are ok|'C:\ used'=21.23616GB;47.72421;53.68974;0;59.65527 'C:\ used %'=36%;80;90;0;100 'D:\ used'=0B;0;0;0;0

I am following this document https://docs.nsclient.org/reference/windows/CheckDisk/

Thank you
Ryan

Re: Check_nrpe commands

Posted: Mon Aug 13, 2018 9:50 am
by mcapra
The check library contains oodles of this sort of stuff. Here's one for disk space that has a specific "NSClient++ via check_nrpe" example that includes thresholds and some cool syntax stuff:
https://support.nagios.com/kb/article.php?id=770

Re: Check_nrpe commands

Posted: Mon Aug 13, 2018 11:48 am
by tgriep
Thanks @mcapra for the help.
@RyanMule , if you have any further questions, let us know what you want the threshold level set to and are you checking for used space or free space.

Re: Check_nrpe commands

Posted: Mon Aug 13, 2018 12:07 pm
by RyanMule
mcapra wrote:The check library contains oodles of this sort of stuff. Here's one for disk space that has a specific "NSClient++ via check_nrpe" example that includes thresholds and some cool syntax stuff:
https://support.nagios.com/kb/article.php?id=770
Thank you for this information! Testing these commands out now!

Re: Check_nrpe commands

Posted: Mon Aug 13, 2018 12:13 pm
by RyanMule
tgriep wrote:Thanks @mcapra for the help.
@RyanMule , if you have any further questions, let us know what you want the threshold level set to and are you checking for used space or free space.
Thank you for your reply! I am still having trouble... I am looking for used space. Below is the command I am using. I am looking to change the default thresholds to Warn=92% Crit=95%

This is the command and output I am getting
./check_nrpe -H 192.168.240.205 -c check_drivesize -a drive=C: 'warning=used>92%' 'critical=used>95%' show-all 'perf-config=*(unit:G)' detail-syntax='{${drive_or_name} ${used_pct}% used / ${size} total}' top-syntax='${status}: ${problem_list}'
Exception processing request: Request contained arguments (not currently allowed, check the allow arguments option).
[root@nagios02 libexec]#

I greatly appreciate your help!

Thank you
Ryan

Re: Check_nrpe commands

Posted: Mon Aug 13, 2018 2:09 pm
by tgriep
What needs to be done is to enable arguments in the NSClient++ ini file.
If you are using 4.x.x or the 5.x.x version of the NSClient++ you will have to edit the C:\Program Files\NSClient++\nsclient.ini file and under this section

Code: Select all

[/settings/NRPE/server]
Add this option to enable the ability for the agent to receive arguments and to process special characters.

Code: Select all

allow arguments = true
allow nasty characters = true
Save the file and restart the NSClient++ service and it should be enabled to receive the arguments defined in the check_nrpe command.

Re: Check_nrpe commands

Posted: Thu Aug 16, 2018 9:48 am
by RyanMule
This did the trick! thank you tgriep!!!
tgriep wrote:What needs to be done is to enable arguments in the NSClient++ ini file.
If you are using 4.x.x or the 5.x.x version of the NSClient++ you will have to edit the C:\Program Files\NSClient++\nsclient.ini file and under this section

Code: Select all

[/settings/NRPE/server]
Add this option to enable the ability for the agent to receive arguments and to process special characters.

Code: Select all

allow arguments = true
allow nasty characters = true
Save the file and restart the NSClient++ service and it should be enabled to receive the arguments defined in the check_nrpe command.

Re: Check_nrpe commands

Posted: Thu Aug 16, 2018 10:27 am
by scottwilkerson
RyanMule wrote:This did the trick! thank you tgriep!!!
tgriep wrote:What needs to be done is to enable arguments in the NSClient++ ini file.
If you are using 4.x.x or the 5.x.x version of the NSClient++ you will have to edit the C:\Program Files\NSClient++\nsclient.ini file and under this section

Code: Select all

[/settings/NRPE/server]
Add this option to enable the ability for the agent to receive arguments and to process special characters.

Code: Select all

allow arguments = true
allow nasty characters = true
Save the file and restart the NSClient++ service and it should be enabled to receive the arguments defined in the check_nrpe command.
Glad it's working

Locking