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- 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;" }