How I can check for exact amount of space left (MB or GB) in Nagios using check_nt command instead of percentage value?
Currently I'm using this command:
check_command check_nt!USEDDISKSPACE!-l c -w 90 -c 95
but this is checking for percentage value of used disk space and I want to receive notification when I will have exact amount of GB left on some drive (for example warning when there will be 10GB left and critical when there will be only 5GB left).
Thank you
check_nt!USEDDISKSPACE
returns the both of size and percentage of disk usage. But thresholds are percentage.If you want to receive alert based on size, you can write a wrapper shell script for
check_nt
command, e.gcheck_disk_by_size
:Testing:
You can add it to Nagios like this:
I have modified the code to adapt new BASH syntax and more robust check.
I have modified Gnought's script which is a modification of quanta's script even further to remove some code errors and modified the results to more-closely resemble the original output of check_nt which gives better data when analyzing trends over time as well as performance data being added back in.