check_nrpe with WMI scripting
Posted: Thu Oct 31, 2013 12:27 pm
COMMAND: /usr/local/nagios/libexec/check_nrpe -H BAMDEV1D1 -t 30 -c CheckWMIValue -a "Query=Select DriveLetter, FreeSpace from win32_Volume where DriveType=3" MinCrit=5000 Check:Disk=FreeSpace AliasCol=DriveLetter
OUTPUT: OK: Everything seems fine.|'C: Disk'=3375972352;0;5000 'D: Disk'=8470765568;0;5000 'P: Disk'=1317314560;0;5000
I finally got the script to work and asked our windows engineer if the information being reported was acceptable and he said he would prefer to set a percentage value then the freespace numeric value.
I have spent several hours trying to find the commands to use to get the percentage. I tried to use "MinCrit=5%" as I saw in a web tutorial but no luck. I need some help.
The other thing is if I want to split it out and write a specific script for each logical Drive, how would I accomplish that?
OUTPUT: OK: Everything seems fine.|'C: Disk'=3375972352;0;5000 'D: Disk'=8470765568;0;5000 'P: Disk'=1317314560;0;5000
I finally got the script to work and asked our windows engineer if the information being reported was acceptable and he said he would prefer to set a percentage value then the freespace numeric value.
I have spent several hours trying to find the commands to use to get the percentage. I tried to use "MinCrit=5%" as I saw in a web tutorial but no luck. I need some help.
The other thing is if I want to split it out and write a specific script for each logical Drive, how would I accomplish that?