Exceptions in check_drivespace

Engage with the community of users including those using the open source solutions.
Includes Nagios Core, Plugins, and NCPA

Exceptions in check_drivespace

Postby jnrduggan » Tue Jan 19, 2021 11:33 am

Apologies if this has been discussed already, I've done a search but I can't see the exact issue I'm having.

I want to check 1 out of 4 drives on a Windows server at a different level to the other 3 using check_diskspace.

I thought I could use something like -

Code: Select all
check_drivesize mounted filter=type='fixed' crit=free<5% warn=free<10% drive=* exclude=d: crit=free<3% warn=free<5% drive=d:


But no matter where you put the "exclude=d:" part of the command, it excludes it from the entire check, so the second part (checking d: at 5% and 3%) doesn't happen.

The only option I've found so far is to do each drive individually like this -

Code: Select all
check_drivesize crit=free<5% warn=free<10% drive=c: crit=free<3% warn=free<5% drive=d: [...]


But a) that's fairly cumbersome, especially with multiple drives and b) the check then won't automatically detect when a new drive is added. I have this check running across multiple servers too, so the inconsistency would be an issue.

Am I missing an option or an argument in the command that would be useful here?

Thanks in advance for your help.
jnrduggan
 
Posts: 1
Joined: Tue Jan 19, 2021 11:24 am

Re: Exceptions in check_drivespace

Postby mcapra » Fri Jan 22, 2021 11:34 am

jnrduggan wrote:I want to check 1 out of 4 drives on a Windows server at a different level to the other 3 using check_diskspace.


Is it always the D: drive that needs the special thresholds? One option would be to string together one check that says "use these thresholds for all drives, except D:" and another that says "apply these thresholds to just the D: drive", with check_multi. There's still 2 logical checks being run, but you get one single output to configure as the "disk service" for all your hosts.

I'm not sure NSClient++ supports your desired configuration, but you could try some of the more clever filter keywords to see if any of them support common differences between "the regular drives" and D: -- space, usable bytes, flags on the drive, media type, etc:
https://docs.nsclient.org/reference/win ... r-keywords
Former Nagios employee
http://www.mcapra.com/
User avatar
mcapra
 
Posts: 3617
Joined: Thu May 05, 2016 3:54 pm


Return to Community Support

Who is online

Users browsing this forum: No registered users and 29 guests