Exclude Volume{XXXXXXX} from check_drivesize results



Is-it possible to exclude from the results drives like “\?\Volume{5221fbf4-80f1-11e2-91da-806e6f6e6963}” using check_drivesize function in NSClient?

When I use this function on one of my server, the result is:

CRITICAL : 51.34MB/1.465GB used|’\?\Volume{5221fbf4-80f1-11e2-91da-806e6f6e6963}\ free’=1.4147GB;0;10;0;1.46483 ‘\?\Volume{5221fbf4-80f1-11e2-91da-806e6f6e6963}\ free %’=97%;0;683;0;100 ‘D:\ free’=13.76441GB;0;10;0;109.99706 ‘D:\ free %’=13%;0;9;0;100 ‘Z:\ free’=39.07316GB;0;10;0;39.99706 ‘Z:\ free %’=98%;0;25;0;100 ‘C:\ free’=10.0312GB;0;10;0;48.53319 ‘C:\ free %’=21%;0;21;0;100

I would like to monitor all drives except C & drives like Volume{}.



See https://docs.nsclient.org/reference/windows/CheckDisk/#check_drivesize for documentation and examples for check_drivesize. There is an exclude option



Thanks. I used this command and it works pretty well …

check_nrpe -H $HOSTADDRESS$ -c check_drivesize -a “warn=none” “crit=free < 10G” “filter=type in (‘fixed’) and (drive_or_id regexp ‘[A-B].’ or drive_or_id regexp '[D-Z].’)”


Ok, it took me hours to figure out this syntax and where to put it. Originally it looked like this: -c check_drivesize -a "filter=name not like ‘%?%’" CRITICAL C:: 61.061GB/68.233GB used, Q:: 2.925TB/3.174TB used|‘C:\ used’=61.06148GB;54.58671;61.41005;0;68.23339 ‘C:\ used %’=89%;80;90;0;100 ‘D:\ used’=35.36809GB;54.66484;61.49794;0;68.33105 ‘D:\ used %’=51%;80;90;0;100 ‘Q:\ used’=2.92474TB;2.53896;2.85633;0;3.1737 ‘Q:\ used %’=92%;79;89;0;100 ‘\?\Volume{a5ec7f40-9649-11e1-942c-806e6f6e6963}\ used’=28.28125MB;79.99687;89.99648;0;99.99609 ‘\?\Volume{a5ec7f40-9649-11e1-942c-806e6f6e6963}\ used %’=28%;79;89;0;100

This gets rid of the nasty Volume. ./check_nrpe -H -p 5666 -c check_drivesize -a "filter=drive not like ‘%?%’" Also ./check_nrpe -H -p 5666 -c check_drivesize -a "filter=drive not like ‘?’" works.

I can also put an underscore as filter and it still works. What the… Am totally confused now. -c check_drivesize -a “filter=drive not like ‘_’”

CRITICAL C:: 61.063GB/68.233GB used, Q:: 2.925TB/3.174TB used|‘C:\ used’=61.06321GB;54.58671;61.41005;0;68.23339 ‘C:\ used %’=89%;80;90;0;100 ‘D:\ used’=35.36809GB;54.66484;61.49794;0;68.33105 ‘D:\ used %’=51%;80;90;0;100 ‘E:\ used’=0B;0;0;0;0 ‘F:\ used’=0B;0;0;0;0 ‘Q:\ used’=2.92474TB;2.53896;2.85633;0;3.1737 ‘Q:\ used %’=92%;79;89;0;100