Page 1 of 1

[SOLVED]Windowscounters and reverse logic in NCPA monitoring

Posted: Mon Jul 03, 2017 9:10 am
by mvndnburg
Hi,

Running Nagios XI Version : 5.4.4 on RHEL6 and NCPA 2.0.3.

I want to use the NCPA Windowscounters API endpoint to monitor the amount of free space on a mounted file systems on Windows. I.e. the free space on the file systems mounted as logical drives on E:\AppsData, E:\SystemDB, etcetera. The 'disk' API Endpoint does not work for file systems mounted under a 'drive letter', hence this approach.

I am using the following check command with check_ncpa.py:

Code: Select all

-t '<token>' -P 5693 -M "windowscounters/LogicalDisk(E:\AppsData)/% Free Space" -w 20 -c 10
This does not work as expected:

- when 'free space' is 97%, the above command will create a critical alert
- when 'free space' is 10%, the above command will also create a critical alert

The behaviour is the same when calling the API Endpoint from the NCPA GUI.

The tricky part seems to be that the counters do not return disk space used, but disk space free.

What is the best way to deal with this?


Check examples:

Code: Select all

1)  https://<host>:5693/api/windowscounters/LogicalDisk(E:/AppsData)/% Free Space?check=true&warning=20&critical=10
{ "returncode": 2, "stdout": "CRITICAL: \\LogicalDisk(E:\\AppsData)\\% Free Space was 97.90 % Free Space | '\\LogicalDisk(E:\\AppsData)\\% Free Space'=97.90;20;10;" }

2) https://<host>:5693/api/windowscounters/LogicalDisk(E:/AppsData)/% Free Space?check=true&warning=20&critical=10
{ "returncode": 2, "stdout": "CRITICAL: \\LogicalDisk(E:\\AppsData)\\% Free Space was 10.06 % Free Space | '\\LogicalDisk(E:\\AppsData)\\% Free Space'=10.06;20;10;" }

Re: Windowscounters and reverse logic in NCPA monitoring

Posted: Tue Jul 04, 2017 2:07 am
by mvndnburg
This page has an example similar to my use case. It shows to suffix the check values with a colon, like so:

Code: Select all

-t '<token>' -P 5693 -M "windowscounters/LogicalDisk(E:\AppsData)/% Free Space" -w 20: -c 10:
This solved my problem, 'Free Space' check is working now.

Re: [SOLVED]Windowscounters and reverse logic in NCPA monito

Posted: Wed Jul 05, 2017 9:28 am
by tmcdonald
Sorry for not getting back to you sooner, our offices were closed in observance of Independence Day.

Glad you were able to resolve it. I'll be closing this thread now, but feel free to open another if you need anything in the future!