Monitor Disk

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
aajewole
Posts: 40
Joined: Fri Aug 12, 2016 11:14 am

Monitor Disk

Post 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.
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Monitor Disk

Post 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.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Monitor Disk

Post 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
Former Nagios employee
https://www.mcapra.com/
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Monitor Disk

Post by eloyd »

Aw, sweet. I learned something new!
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
aajewole
Posts: 40
Joined: Fri Aug 12, 2016 11:14 am

Re: Monitor Disk

Post 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.
aajewole
Posts: 40
Joined: Fri Aug 12, 2016 11:14 am

Re: Monitor Disk

Post by aajewole »

I am getting error message on check_nrpe. I am running version 2.15. Please see attachment. Thanks
Attachments
Nagios.PNG
aajewole
Posts: 40
Joined: Fri Aug 12, 2016 11:14 am

Re: Monitor Disk

Post by aajewole »

Changed nsclient installation for nrpe to old legacy and getting this error message now.
Attachments
Nagios.PNG
Nagios.PNG (5.36 KiB) Viewed 4388 times
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Monitor Disk

Post 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
Former Nagios employee
https://www.mcapra.com/
aajewole
Posts: 40
Joined: Fri Aug 12, 2016 11:14 am

Re: Monitor Disk

Post 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=*
}
Attachments
3.PNG
2.PNG
1.PNG
aajewole
Posts: 40
Joined: Fri Aug 12, 2016 11:14 am

Re: Monitor Disk

Post 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=*
Locked