Page 1 of 1

Nagios plugin to monitor drive availability in windows

Posted: Wed Apr 26, 2017 6:02 am
by rohithroki
Dear Team,

I am looking for a nagios plugin which will monitor if a particular drive is online or offline instead of monitoring the drive usage.

I need nagios to through alert if a particular drive/disk is offline.

Kindly let me know if there is any plugins available

Re: Nagios plugin to monitor drive availability in windows

Posted: Wed Apr 26, 2017 10:52 am
by mcapra
I believe the native drive checking modules for NSClient++ will fire off a CRITICAL/UNKNOWN if it can't find a specified drive.

Some examples:
http://sites.box293.com/nagios/guides/c ... disk-usage

Otherwise, check_wmi_plus is a pretty popular one when it comes to agent-less windows monitoring. Much of our documentation for WMI monitoring is specific to Nagios XI, but much of the same steps apply to Nagios Core as well particularly in regards to setting up the Windows machine:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf

Re: Nagios plugin to monitor drive availability in windows

Posted: Thu Apr 27, 2017 1:09 am
by rohithroki
Thank you for your reply however in the below link i couldn't find any arguments which will show the drive status.All the examples shows the capacity monitoring.
I just need the nagios to through a critical alert if a particular drive is offline/absent.

I am a newbie in nagios.

Thanks in advance.

RKJ

Re: Nagios plugin to monitor drive availability in windows

Posted: Thu Apr 27, 2017 12:14 pm
by mcapra
rohithroki wrote:I just need the nagios to through a critical alert if a particular drive is offline/absent.
Did you try applying NSClient++ to your situation? As I mentioned:
mcapra wrote:I believe the native drive checking modules for NSClient++ will fire off a CRITICAL/UNKNOWN if it can't find a specified drive.
Like so:

Code: Select all

[root@xi-stable libexec]# ./check_nrpe -H 192.168.67.99 -t 30 -c check_drivesize -a drive=C:
OK All 1 drive(s) are ok|'C: used'=21.62634GB;40.18593;45.20917;0;50.23241 'C: used %'=43%;80;90;0;100
[root@xi-stable libexec]# ./check_nrpe -H 192.168.67.99 -t 30 -c check_drivesize -a drive=F:
Filter processing failed: Failed to get size for F:: 3: The system cannot find the path specified.
: 0 > convert(0)
[root@xi-stable libexec]# echo $?
3
Additionally, check_wmi_plus will also return an "UNKNOWN" if a particular drive is not found:

Code: Select all

[root@xi-stable libexec]# ./check_wmi_plus.pl -H 192.168.67.99 -u admin -p welcome123 -m checkdrivesize -a 'C': -w '80' -c '95'
OK - C: Total=50.23GB, Used=21.60GB (43.0%), Free=28.63GB (57.0%)     |'C: Space'=21.60GB; 'C: Utilisation'=43.0%;80;95;
[root@xi-stable libexec]# ./check_wmi_plus.pl -H 192.168.67.99 -u admin -p welcome123 -m checkdrivesize -a 'F': -w '80' -c '95'
UNKNOWN - Could not find a drive matching 'F:' or the WMI data returned is invalid. Available Drives are C:, E:
So all you would need to do in your service definition is fire notifications on "UNKNOWN" states. This can be done via the notification_options directive when defining a service.