Page 1 of 1

Check_xi_service_nsclient (USEDDISKSPACE)

Posted: Thu Mar 09, 2017 2:20 pm
by Pselvin
Hi There,

I am using USEDDISKSPACE argument on check command Check_xi_service_nsclient to check the drive space. Right now I am monitoring drive space using % like this -l C -w 85 -c 95 but, I wanted to use the condition like below,

1. Warning - Generate a warning alert when the drive space goes below 85% and the available space is less than 5 GB.
2. Critical - Generate a critical alert when the drive space goes below 95% and the available space is less than 2 GB.

Thank you in advance!

Re: Check_xi_service_nsclient (USEDDISKSPACE)

Posted: Thu Mar 09, 2017 6:06 pm
by mcapra
This documentation may be helpful:
https://docs.nsclient.org/0.5.0/samples/index.html

Specifically, if you wanted to designate multiple criteria for drive space checks, you might give this a shot:

Code: Select all

check_drivesize "crit=free<95% or free<2G" "warn=free<85% or free<5G"
Though I haven't tested that, the syntax works for filters. Unsure if it works for thresholds.

Re: Check_xi_service_nsclient (USEDDISKSPACE)

Posted: Thu Mar 09, 2017 6:07 pm
by Box293
USEDDISKSPACE is checked via check_nt and it does not have those advanced features.

You would need to look at creating a check_nrpe check that allows for more complex options.

First you need to enable NRPE in NSClient++:

https://assets.nagios.com/downloads/nag ... ios-XI.pdf

This KB article gives an example of an NRPE service:

https://support.nagios.com/kb/article.p ... tegory=102

This page has a list of different disk check commands:

http://sites.box293.com/nagios/guides/c ... disk-usage

I've not done it myself but I think you can have multiple warning= and critical= arguments, you'll have to test and let us know.

Re: Check_xi_service_nsclient (USEDDISKSPACE)

Posted: Fri Mar 10, 2017 10:53 am
by Pselvin
Thank you for your response.

I installed NRPE on the server and it works fine. Please guide me on how to match both condition? I tried all the below but, only one condition works like 10% or the integer value 10gb. Please advise on the parameter to match both conditions

CHECK_NRPE
check_drivesize "crit=free<10%" "crit=free<2G" drive=*:

Do I need to use filter type? if yes, can you guide me on the syntax and how to use in above command

Re: Check_xi_service_nsclient (USEDDISKSPACE)

Posted: Fri Mar 10, 2017 3:34 pm
by tgriep
Your command should look like this to get the criteria you are looking for.

Code: Select all

check_drivesize -a drive=C: 'warning=free<5G or free<15%' 'critical=free<2G or free<5%' show-all

Re: Check_xi_service_nsclient (USEDDISKSPACE)

Posted: Mon Mar 13, 2017 9:27 am
by Pselvin
Thanks guys for your help! This worked for me! Please feel free to close this thread.

I appreciate your help!