Page 1 of 1

Drive Check percentage

Posted: Mon Jun 22, 2015 12:09 pm
by jkinning
I have several drives which I am checking for GB free but I also need to create a check for % free.

I am using check_nrpe -H <host> -c check_drivesize -a "filter=type = 'fixed' and drive regexp '.*[C-Z].*'" "warn=free<4G" "crit=free<2G" to check for GB free which is working out quite nicely. So I modified the check a little but this is showing an A:\ drive which I don't want. I only want the C-Z drives like above. check_nrpe -H <host> -c check_drivesize "filter=type = 'fixed' and drive regexp '.*[C-Z].*'" "crit=free<5%" "warn=free<10%"

I also tried adding exclude A - check_nrpe -H <host> -c check_drivesize "filter=type = 'fixed' and drive regexp '.*[C-Z].*'" "crit=free<5%" "warn=free<10%" exclude=A:\\

I then tried this but included the CD-ROM drive as well - check_nrpe -H <hostname> -t 30 -c CheckDriveSize -a ShowAll MinWarn=20% MinCrit=10% Drive=C: perf-unit=G

Re: Drive Check percentage

Posted: Mon Jun 22, 2015 1:14 pm
by jolson
This is working on my end. What version of NSClient are you running on the client machine? You can check by performing a blank NRPE check to the server in question.

Code: Select all

./check_nrpe -H <hostname>
[root@localhost libexec]# ./check_nrpe -H 192.168.x.x
I (0.4.3.143 2015-04-29) seem to be doing fine...
[root@localhost libexec]# ./check_nrpe -H 192.168.x.x -t 30 -c CheckDriveSize -a ShowAll MinWarn=20% MinCrit=10% Drive=C: perf-unit=G
WARNING warning(C:: Total: 105.587GB - Used: 90.641GB (86%) - Free: 14.946GB (14%))|'C: free'=14.94567G;21.11738;10.55869;0;105.58691 'C: free %'=14%;20;10;0;100
You might try upgrading your version of NSClient and restarting the service. http://www.nsclient.org/download/

Re: Drive Check percentage

Posted: Mon Jun 22, 2015 1:38 pm
by jkinning
That works but I want to have a single check that checks all fixed disks. I currently have it working with the free space but need a percentage check for other hosts.

This works:

Code: Select all

./check_nrpe -H <host> -c check_drivesize -a "filter=type = 'fixed' and drive regexp '.*[C-Z].*'" "warn=free<4G" "crit=free<2G"
WARNING C:\: 11.095GB/15.004GB used|'C:\ free'=3.90904GB;4;2;0;15.00364 'C:\ free %'=26%;26;13;0;100 'D:\ free'=106.25217GB;4;2;0;2047.99729 'D:\ free %'=5%;0;0;0;100 'E:\ free'=27.0641GB;4;2;0;188.49023 'E:\ free %'=14%;2;1;0;100 'F:\ free'=234.40662GB;4;2;0;503.32582 'F:\ free %'=46%;0;0;0;100
I just need one that instead of <4GB and <2GB I can use <85% and <95%

I use this and it also includes the A:\ Drive which I don't want listed.

Code: Select all

./check_nrpe -H <host> -c check_drivesize "filter=type = 'fixed' and drive regexp '.*[C-Z].*'" "crit=free<5%" "warn=free<10%"
CRITICAL D:\: 1.896TB/2TB used, E:\: 161.426GB/188.49GB used|'A:\ used'=0B;0;0;0;0 'C:\ used'=11.0946GB;12.00291;13.50327;0;15.00364 'C:\ used %'=73%;80;90;0;100 'D:\ used'=1.89623TB;1.59999;1.79999;0;1.99999 'D:\ used %'=94%;79;89;0;100 'E:\ used'=161.42612GB;150.79218;169.6412;0;188.49023 'E:\ used %'=85%;79;89;0;100 'F:\ used'=268.82154GB;402.66066;452.99324;0;503.32582 'F:\ used %'=53%;80;90;0;100 'Q:\ used'=0B;0;0;0;0
attempt to exclude A:

Code: Select all

./check_nrpe -H <host> -c check_drivesize "filter=type = 'fixed' and drive regexp '.*[C-Z].*'" "crit=free<5%" "warn=free<10%" exclude=A:\\
CRITICAL D:\: 1.896TB/2TB used, E:\: 161.426GB/188.49GB used|'A:\ used'=0B;0;0;0;0 'C:\ used'=11.09459GB;12.00291;13.50327;0;15.00364 'C:\ used %'=73%;80;90;0;100 'D:\ used'=1.89623TB;1.59999;1.79999;0;1.99999 'D:\ used %'=94%;79;89;0;100 'E:\ used'=161.42612GB;150.79218;169.6412;0;188.49023 'E:\ used %'=85%;79;89;0;100 'F:\ used'=268.82154GB;402.66066;452.99324;0;503.32582 'F:\ used %'=53%;80;90;0;100 'Q:\ used'=0B;0;0;0;0

Re: Drive Check percentage

Posted: Mon Jun 22, 2015 2:41 pm
by jolson
I think you may be forgetting a '-a' flag in the command you've posted.

Code: Select all

./check_nrpe -H <host> -c check_drivesize -a "filter=type = 'fixed' and drive regexp '.*[C-Z].*'" "crit=free<5%" "warn=free<10%"
Try the above - it worked for me. Thanks!

Re: Drive Check percentage

Posted: Mon Jun 22, 2015 2:48 pm
by jkinning
Man! I need to get glasses. :D

Been a long Monday but yes that did work. Thanks again and you can close.