Check_xi_service_nsclient (USEDDISKSPACE)

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.
Locked
Pselvin
Posts: 51
Joined: Tue Dec 13, 2016 1:28 pm

Check_xi_service_nsclient (USEDDISKSPACE)

Post 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!
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Check_xi_service_nsclient (USEDDISKSPACE)

Post 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.
Former Nagios employee
https://www.mcapra.com/
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Check_xi_service_nsclient (USEDDISKSPACE)

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Pselvin
Posts: 51
Joined: Tue Dec 13, 2016 1:28 pm

Re: Check_xi_service_nsclient (USEDDISKSPACE)

Post 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
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Check_xi_service_nsclient (USEDDISKSPACE)

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
Pselvin
Posts: 51
Joined: Tue Dec 13, 2016 1:28 pm

Re: Check_xi_service_nsclient (USEDDISKSPACE)

Post by Pselvin »

Thanks guys for your help! This worked for me! Please feel free to close this thread.

I appreciate your help!
Locked