combining two checks
Posted: Tue May 11, 2021 6:47 am
We are monitoring file systems/disk space with Nagios XI
We are looking for way to fetch "used_percent" data into performance data, along with Used, Free and Total values.
As of now our disk check results in the following data on Nagios XI GUI:
OK: Used disk space was 83.70 % (Used: 16.00 GiB, Free: 3.11 GiB, Total: 20.16 GiB)
When I Run Check command against any host:
/usr/local/nagios/libexec/check_ncpa.py -H <HOSTNAME> -t '<TOKEN>' -P 5693 -M 'disk/logical/|' -w '90' -c '95'
OK: Used disk space was 83.70 % (Used: 16.00 GiB, Free: 3.11 GiB, Total: 20.16 GiB) | 'used'=16.00GiB;;; 'free'=3.11GiB;;; 'total'=20.16GiB;;;
In the above the data point 83.70% is visible in the console, but this data is not pushed to performance data, and hence cannot be used for graphs and dashboards.
I know I can see the data for used_percent, if I change the above Check command:
-M 'disk/logical/|' to -M 'disk/logical/|/used_percent' like the below:
/usr/local/nagios/libexec/check_ncpa.py -H <HOSTNAME> -t '<TOKEN>' -P 5693 -M 'disk/logical/|tmp/used_percent' -w '90' -c '95'
OK: Used_percent was 5.00 % | 'used_percent'=5.00%;90;95;
However, I am looking for a way to combine these two checks and get Used, Free, Total and Used_percent data in a single check for better Graphing capabilities. Please suggest.
We are looking for way to fetch "used_percent" data into performance data, along with Used, Free and Total values.
As of now our disk check results in the following data on Nagios XI GUI:
OK: Used disk space was 83.70 % (Used: 16.00 GiB, Free: 3.11 GiB, Total: 20.16 GiB)
When I Run Check command against any host:
/usr/local/nagios/libexec/check_ncpa.py -H <HOSTNAME> -t '<TOKEN>' -P 5693 -M 'disk/logical/|' -w '90' -c '95'
OK: Used disk space was 83.70 % (Used: 16.00 GiB, Free: 3.11 GiB, Total: 20.16 GiB) | 'used'=16.00GiB;;; 'free'=3.11GiB;;; 'total'=20.16GiB;;;
In the above the data point 83.70% is visible in the console, but this data is not pushed to performance data, and hence cannot be used for graphs and dashboards.
I know I can see the data for used_percent, if I change the above Check command:
-M 'disk/logical/|' to -M 'disk/logical/|/used_percent' like the below:
/usr/local/nagios/libexec/check_ncpa.py -H <HOSTNAME> -t '<TOKEN>' -P 5693 -M 'disk/logical/|tmp/used_percent' -w '90' -c '95'
OK: Used_percent was 5.00 % | 'used_percent'=5.00%;90;95;
However, I am looking for a way to combine these two checks and get Used, Free, Total and Used_percent data in a single check for better Graphing capabilities. Please suggest.