Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
check_DiskQueueLength
2.0
2012-05-20
- Nagios 3.x
76871
File | Description |
---|---|
check_DiskQueueLength.zip | contains bin and source |
pnp4nagios.zip | contains the template for pnp4nagios |
Meet The New Nagios Core Services Platform
Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.
Monitoring Made Magically Better
- Nagios Core on Overdrive
- Powerful Monitoring Dashboards
- Time-Saving Configuration Wizards
- Open Source Powered Monitoring On Steroids
- And So Much More!
This plug-in for Nagios allows you to check the Average Disk Queue Length on a Windows server.
To design the plug-in I took a cue from a Microsoft article: http://msdn.microsoft.com/en-us/library/system.diagnostics.performancecounter(v=vs.90).aspx
The measurement of Average Disk Queue Length is quite accurate.
To function properly it needs .Net Framework 2.0 or higher.
The package check_DiskQueueLength.zip contains the executable and the source code. The package pnp4nagios.zip contains the template for pnp4nagios 0.6.x
----------------------------------------------------------------------
HOW IT WORKS
----------------------------------------------------------------------
To get the Average Disk Queue Length the plug-in queries windows through WMI. When the plug-in is executed It performs one query every second (to get the Avg. Disk Queue Length via WMI) for 15 times, then It calculates the average of the 15 values and returns the average to Nagios.
So the duration of the execution is about 15 seconds.
The plug-in return also the performance data.
It works on windows 2003 and windows 2008.
----------------------------------------------------------------------
HOW TO INSTALL THE PLUG-IN
----------------------------------------------------------------------
This plug-in runs on a Windows server that is checked by nagios. I used NSClient++ but i think that you can also use check_mk.
To print the help use the following command:
check_DiskQueueLength.exe -h
If you use NSClient++ you have to copy check_DiskQueueLength.exe into the scripts subfolder and then add the current lines into the NSC.ini file:
[NRPE Handlers]
check_DiskQueueLength=scripts\check_DiskQueueLength.exe -u "$ARG1$" -w $ARG2$ -c $ARG3$ --PhysicalDisk
If the lines above do not work then you probably need to edit them according to the version of NSClient that you are using.
On Nagios server you have to define a new command:
define command{
command_name check_DiskQueueLength
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t 90 -c check_DiskQueueLength -a "$ARG1$" $ARG2$ $ARG3$
}
Now on Nagios server you can define a new service:
define service{
use your_service_template
host_name your_server
service_description Avg Disk Queue Length on C:
check_command check_DiskQueueLength!0 C:!4!8
}
----------------------------------------------------------------------
IMPORTANT NOTE
----------------------------------------------------------------------
You should set into your service template "your_service_template" the max_check_attempts, normal_check_interval and retry_check_interval as follow:
max_check_attempts 2 ; Re-check the service up to 2 times in order to determine its final (hard) state
normal_check_interval 1 ; Check the service every one minute under normal conditions
retry_check_interval 1 ; Re-check the service every one minutes until a hard state can be determined
I know, a check every minute is not the best but in this way you query the perfomance counter of your Windows server every one minute. This allows you to get a good Measurement!!!!
For any questions or concerns please contact me: http://www.alan-pipitone.com/contact.php
----
Alan Pipitone.
To design the plug-in I took a cue from a Microsoft article: http://msdn.microsoft.com/en-us/library/system.diagnostics.performancecounter(v=vs.90).aspx
The measurement of Average Disk Queue Length is quite accurate.
To function properly it needs .Net Framework 2.0 or higher.
The package check_DiskQueueLength.zip contains the executable and the source code. The package pnp4nagios.zip contains the template for pnp4nagios 0.6.x
----------------------------------------------------------------------
HOW IT WORKS
----------------------------------------------------------------------
To get the Average Disk Queue Length the plug-in queries windows through WMI. When the plug-in is executed It performs one query every second (to get the Avg. Disk Queue Length via WMI) for 15 times, then It calculates the average of the 15 values and returns the average to Nagios.
So the duration of the execution is about 15 seconds.
The plug-in return also the performance data.
It works on windows 2003 and windows 2008.
----------------------------------------------------------------------
HOW TO INSTALL THE PLUG-IN
----------------------------------------------------------------------
This plug-in runs on a Windows server that is checked by nagios. I used NSClient++ but i think that you can also use check_mk.
To print the help use the following command:
check_DiskQueueLength.exe -h
If you use NSClient++ you have to copy check_DiskQueueLength.exe into the scripts subfolder and then add the current lines into the NSC.ini file:
[NRPE Handlers]
check_DiskQueueLength=scripts\check_DiskQueueLength.exe -u "$ARG1$" -w $ARG2$ -c $ARG3$ --PhysicalDisk
If the lines above do not work then you probably need to edit them according to the version of NSClient that you are using.
On Nagios server you have to define a new command:
define command{
command_name check_DiskQueueLength
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t 90 -c check_DiskQueueLength -a "$ARG1$" $ARG2$ $ARG3$
}
Now on Nagios server you can define a new service:
define service{
use your_service_template
host_name your_server
service_description Avg Disk Queue Length on C:
check_command check_DiskQueueLength!0 C:!4!8
}
----------------------------------------------------------------------
IMPORTANT NOTE
----------------------------------------------------------------------
You should set into your service template "your_service_template" the max_check_attempts, normal_check_interval and retry_check_interval as follow:
max_check_attempts 2 ; Re-check the service up to 2 times in order to determine its final (hard) state
normal_check_interval 1 ; Check the service every one minute under normal conditions
retry_check_interval 1 ; Re-check the service every one minutes until a hard state can be determined
I know, a check every minute is not the best but in this way you query the perfomance counter of your Windows server every one minute. This allows you to get a good Measurement!!!!
For any questions or concerns please contact me: http://www.alan-pipitone.com/contact.php
----
Alan Pipitone.
Reviews (1)
bymacthunder, September 18, 2013
Works perfect!
NOTE:
With the newest NSC++ you must use the follwing
Sting:
[/settings/external scripts]
allow arguments=1
[/settings/external scripts/scripts]
check_DiskQueueLength=scriptscheck_DiskQueueLength.exe -u "$ARG1$" -w $ARG2$ -c $ARG3$ --PhysicalDisk
NOTE:
With the newest NSC++ you must use the follwing
Sting:
[/settings/external scripts]
allow arguments=1
[/settings/external scripts/scripts]
check_DiskQueueLength=scriptscheck_DiskQueueLength.exe -u "$ARG1$" -w $ARG2$ -c $ARG3$ --PhysicalDisk