Exclude drive in check

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Exclude drive in check

Post by jkinning »

I am using this check

Code: Select all

check_nrpe -H <host> -c check_drivesize -a check_drivesize -a "filter=type = 'fixed' and drive regexp '.*[C-D].*'" "warn=free<10%" "crit=free<5%
which I have assigned to a service template and hostgroup. This works out great except I have two hosts which I need to exclude drive E: and F: from being checked. They are at the warning and critical thresholds but nothing will be added to these drives and they only exist for archival purposes. Since they will never grow or shrink in size is there a way to create a service check to exclude these drives and then assign this service check to the appropriate hosts? I am trying to maintain my templates as it make administration so much easier and I am trying to avoid having to create several additional checks which would exclude these 2 drives and then put these hosts in a separate hostgroup. I have yet another host which is setup the same and I need to have that hosts G drive have notifications sent to a different contact group. Am I able to do something similar in excluding this host from checking G and then create a different service check for G and then add this check to that host which would have notifications sent to a different contact group?
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Exclude drive in check

Post by jdalrymple »

Ick - No matter what it's ugly.

Probably the best option would be to use a custom object variable such as "drives_to_monitor" - then in your service you'd just pass $_HOSTdrives_to_monitor in place of that regex.

You have to be careful how complicated you make it - sometimes it's best to bite the bullet and do it the ugly/long/inelegant way, that is unless you plan on quitting tomorrow and someone else is inheriting your environment.
Locked