Formatting the results of a check
Posted: Tue Jan 11, 2022 5:23 pm
We have a check that looks at drive space on a server. The command we are currently using is: check_nrpe -H 127.0.0.1 -c check_drivesize "detail-syntax=%{drive_or_name}: ${used}/${size} used" exclude=S:\ exclude=A:\ "filter=type not in ('cdrom', 'removable') and mounted=1" "crit=free<100M" "warn=free<500M"
When running this command we get output like so: OK All 2 drive(s) are ok|'D:\ free'=197.2831GB;0.48827;0.09765;0;249.99804 'D:\ free %'=79%;0;0;0;100 'C:\ free'=13.87358GB;0.48827;0.09765;0;59.65527 'C:\ free
%'=23%;1;0;0;100
For this server, the D: drive has a size of 250 GB, 197 GB of which are free. So when the result shows 'D:\ free'=197.2831GB;0.48827;0.09765;0;249.99804' what do all of those numbers represent? Obviously, the first number is GB free and the last is GB Total size. What are the ones in between and how can I get rid of them? Ideally, we'd like the status to read something like: "197 GB free out of 250 GB Total", or something to that effect - simple and informative.
When running this command we get output like so: OK All 2 drive(s) are ok|'D:\ free'=197.2831GB;0.48827;0.09765;0;249.99804 'D:\ free %'=79%;0;0;0;100 'C:\ free'=13.87358GB;0.48827;0.09765;0;59.65527 'C:\ free
%'=23%;1;0;0;100
For this server, the D: drive has a size of 250 GB, 197 GB of which are free. So when the result shows 'D:\ free'=197.2831GB;0.48827;0.09765;0;249.99804' what do all of those numbers represent? Obviously, the first number is GB free and the last is GB Total size. What are the ones in between and how can I get rid of them? Ideally, we'd like the status to read something like: "197 GB free out of 250 GB Total", or something to that effect - simple and informative.