Page 1 of 2

Monitor Disk

Posted: Mon Sep 12, 2016 7:52 am
by aajewole
I need to be able to monitor disk/drive under disk management but not presented to windows explorer. Is this possible? If I open Disk Management, I can see all the disk but they have not been provisioned for windows under explorer i.e C, D, E drive. I need to be able to monitor those disk using nagios core. Thanks for your help.

Re: Monitor Disk

Posted: Mon Sep 12, 2016 8:45 am
by eloyd
You would likely require a custom plugin, since all of the plugins for monitoring disk drives under Windows that I'm aware of monitor by drive letter.

Re: Monitor Disk

Posted: Mon Sep 12, 2016 1:08 pm
by mcapra
Here's my test setup:
2016_09_12_13_07_12_192.168.67.99_Remote_Desktop_Connection.png
As long as the drives have been initialized and a partition exists, you should be able to monitor it using the NSClient++ agent and check_nrpe plugin:

Code: Select all

[root@localhost libexec]# /usr/local/nagios/libexec/check_nrpe -H 192.168.67.99 -c check_drivesize -a "filter=type not in ('CDROM', 'REMOVABLE')" "crit=free<1g"
OK All 2 drive(s) are ok|'C:\ free'=29.06156GB;0;0;0;50.23241 'C:\ free %'=57%;0;0;0;100 'C:\ used'=21.17085GB;40.18593;0;0;50.23241 'C:\ used %'=42%;79;0;0;100 '\\?\Volume{9aafe235-7912-11e6-80e0-005056848a3a}\ free'=19.90005GB;0;0;0;19.99706 '\\?\Volume{9aafe235-7912-11e6-80e0-005056848a3a}\ free %'=99%;0;0;0;100 '\\?\Volume{9aafe235-7912-11e6-80e0-005056848a3a}\ used'=0.09701GB;15.99765;0;0;19.99706 '\\?\Volume{9aafe235-7912-11e6-80e0-005056848a3a}\ used %'=0%;79;0;0;100
Obviously the volume ID is super ugly and long if we haven't assigned a drive letter to it. If you wanted to check the specific drive that doesn't have a letter assigned, the command gets a little wordy due to neccesary CLI escapes but works:

Code: Select all

[root@localhost libexec]# /usr/local/nagios/libexec/check_nrpe -H 192.168.67.99 -c check_drivesize -a "crit=free<1g" "drive=\\\\?\\Volume{9aafe235-7912-11e6-80e0-005056848a3a}\\"
OK All 1 drive(s) are ok|'\\?\Volume{9aafe235-7912-11e6-80e0-005056848a3a}\ free'=19.90005GB;0;0;0;19.99706 '\\?\Volume{9aafe235-7912-11e6-80e0-005056848a3a}\ free %'=99%;0;0;0;100 '\\?\Volume{9aafe235-7912-11e6-80e0-005056848a3a}\ used'=0.09701GB;15.99765;0;0;19.99706 '\\?\Volume{9aafe235-7912-11e6-80e0-005056848a3a}\ used %'=0%;79;0;0;100

Re: Monitor Disk

Posted: Mon Sep 12, 2016 1:13 pm
by eloyd
Aw, sweet. I learned something new!

Re: Monitor Disk

Posted: Mon Sep 12, 2016 1:26 pm
by aajewole
Awesome. Thanks guys, I will set it up tonight and test. If you can leave this open for 24 - 48hrs I will appreciate it. Thanks again.

Re: Monitor Disk

Posted: Mon Sep 12, 2016 1:35 pm
by aajewole
I am getting error message on check_nrpe. I am running version 2.15. Please see attachment. Thanks

Re: Monitor Disk

Posted: Mon Sep 12, 2016 1:45 pm
by aajewole
Changed nsclient installation for nrpe to old legacy and getting this error message now.

Re: Monitor Disk

Posted: Mon Sep 12, 2016 2:03 pm
by mcapra
You will likely need to add/modify the [/settings/NRPE/server] section in your nsclient configuration file to include:

Code: Select all

allow arguments = true
allow nasty characters = true

Re: Monitor Disk

Posted: Wed Sep 14, 2016 9:45 am
by aajewole
thanks. that fixed that error. I setup command to use and its not showing critical like I want it. I want it to not alert on warning. It is showing warning instead of only critical. On picture 3 - I changed the critical argument to 30%, it showed critical and System Reserved. How can I omit that too. Thanks for all the help.

define service{
use generic-service
hostname CWWAPP993
service_description Disk Management Drive
check_command check_nrpe_diskmanagement
}

define command{
command_name check_nrpe_diskmanagement
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_drivesize -a "filter=type not in ('CDROM','REMOVABLE')" "critical=free<10%" drive=*
}

Re: Monitor Disk

Posted: Wed Sep 14, 2016 1:58 pm
by aajewole
Hello. Thanks for your help. this can be closed. Fix below for future reference.

define command{
command_name check_nrpe_diskmanagement
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_drivesize -a "filter=type not in ('CDROM','REMOVABLE')" "critical=free<10%" "warning=used>85%" drive=*