Page 2 of 2

Re: Monitoring Disk Space by Size, rather than by percentage

Posted: Thu Jan 05, 2017 11:31 am
by dwhitfield
Add allow_nasty_meta_characters = 1 in your nsclient.ini under [/settings/NRPE/server]

It should work with the _ or without but it looks kinda weird to me without

Re: Monitoring Disk Space by Size, rather than by percentage

Posted: Fri Jan 06, 2017 7:22 am
by neworderfac33
Good afternoon,
I have made the change to the config file, but still get:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 99.99.99.99 -t 30 -c check_drivesize -a drive=C: 'warning=free<10G' 'critical=free<5G' show-all 'perf-config=*(unit:G)' detail-syntax='{${drive_or_name} ${free} free / ${size} total}' top-syntax='${status}: ${problem_list}'
Exception processing request: Request command contained illegal metachars!
Not a great worry, but...

[DORK ALERT]
I DID mention that my target server is a Windows, rather than a Linux server, didn't I? - Doh!
I've been able to implement check_nrpe on Linux boxes successfully.
To reiterate, what I'm looking for is a way to alert when my free disk space hits a number of GB free, rather than a percentage of total size free.
[/DORK ALERT]

However, I'm still curious as to where check_nrpe is finding the 349.96MB as the drive size when it's actually 40GB

Code: Select all

define service{
       use                      generic-service,nagiosgraph
       host_name                MYSERVER
       #hostgroup_name           001-jenkins-live-masters
       service_description      Drive Space - C - check_nt
       check_command            check_nt!USEDDISKSPACE!-l c -w 90 -c 95
       }
returns:

Code: Select all

c: - total: 39.66 Gb - used: 16.17 Gb (41%) - free 23.48 Gb (59%) 
and

Code: Select all

define service {
       use                     generic-service,nagiosgraph
       host_name               MYSERVER
       #hostgroup_name          001-jenkins-live-masters
       service_description     Drive Space - C - check_nrpe
       check_command           check_nrpe!CheckDriveSize! "w10 -c5"
       }
returns:

Code: Select all

WARNING : Total: 349.996MB - Used: 290.445MB (83%) - Free: 59.551MB (17%) 
Thanks and apologies if I've used your time on a wild goose chase.

Pete

Re: Monitoring Disk Space by Size, rather than by percentage

Posted: Fri Jan 06, 2017 11:37 am
by dwhitfield
My instructions were not complete...you also needed to restart the NSClient++ service. You have to do this every time you modify nsclient.ini. (as an aside, I wonder if it automatically picks up changes in .5...that would be nice).

Yes, you noted before it was Windows. NRPE and NSClient *should* play nice.

Re: Monitoring Disk Space by Size, rather than by percentage

Posted: Mon Jan 09, 2017 6:51 am
by neworderfac33
Good morning - I've decided to abandon this as its sucking up to much of my time (I have no idea where check_nrpe is finding the 349 MB drive), so please can you close this thread?

I'm going to pursue the three solutions found at http://serverfault.com/questions/309913 ... nt-co?rq=1

although, as yet, none of them work either...

Thanks very much for your assistance thus far.

Pete

Re: Monitoring Disk Space by Size, rather than by percentage

Posted: Mon Jan 09, 2017 11:10 am
by dwhitfield
peterooney wrote: so please can you close this thread?
You can let the thread die by just not responding but...

Have you considered WMI? https://exchange.nagios.org/index.php?o ... chword=wmi