[SOLVED]Windowscounters and reverse logic in NCPA monitoring

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
mvndnburg
Posts: 64
Joined: Wed Sep 21, 2016 2:53 am

[SOLVED]Windowscounters and reverse logic in NCPA monitoring

Post 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;" }
Last edited by mvndnburg on Tue Jul 04, 2017 2:08 am, edited 1 time in total.
--
Martijn
mvndnburg
Posts: 64
Joined: Wed Sep 21, 2016 2:53 am

Re: Windowscounters and reverse logic in NCPA monitoring

Post 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.
--
Martijn
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

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

Post 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!
Former Nagios employee
Locked