Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
check_defrag
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 helps you to monitor fragmented disks.
NB: It doesn't run a defrag, It only tells you if you have to defrag your disks.
To function properly it needs .Net Framework 2.0 or higher.
----------------------------------------------------------------------
HOW IT WORKS
----------------------------------------------------------------------
The plug-in queries windows through WMI. It returns a critical state (or an ok state) according to what windows returns.
It works on windows 2003 and windows 2008.
The plug-in also return performance data.
----------------------------------------------------------------------
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_defrag.exe /h
If you use NSClient++ you have to copy check_defrag.exe into the scripts subfolder and then add the current lines into the NSC.ini file:
[NRPE Handlers]
check_ExecCustScript= scripts\$ARG1$ $ARG2$
If the lines above do not work then you probably need to edit them according to the version of NSClient that you are using.
I suggest you to increase the command_timeout in the NSC.ini
On Nagios server you have to define a new command:
define command {
command_name check_defrag_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t 3600 -c check_execcustscript -a "check_defrag.exe" "$ARG1$"
}
Now on Nagios server you can define a new service:
define service {
use your_service_template
host_name your_server
service_description Disk Fragmentation C: D:
check_command check_defrag_nrpe!C: D:
}
----------------------------------------------------------------------
ONE LAST NOTE
----------------------------------------------------------------------
I defined this command on NSClient:
check_ExecCustScript= scripts$ARG1$ $ARG2$
This allows you to define several commands on Nagios without edit NSC.ini of your servers.
For example, you can put (on the NSClient++ scripts subfolder of your windows server) a.exe, b.exe, c.bat and then define the following commands on Nagios:
define command {
command_name check_a
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_execcustscript -a "a.exe" "$ARG1$"
}
define command {
command_name check_b
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_execcustscript -a "b.exe" "$ARG1$"
}
define command {
command_name check_c
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_execcustscript -a "c.bat" "$ARG1$"
}
For any questions or concerns please contact me: http://www.alan-pipitone.com/contact.php
Alan Pipitone.
NB: It doesn't run a defrag, It only tells you if you have to defrag your disks.
To function properly it needs .Net Framework 2.0 or higher.
----------------------------------------------------------------------
HOW IT WORKS
----------------------------------------------------------------------
The plug-in queries windows through WMI. It returns a critical state (or an ok state) according to what windows returns.
It works on windows 2003 and windows 2008.
The plug-in also return performance data.
----------------------------------------------------------------------
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_defrag.exe /h
If you use NSClient++ you have to copy check_defrag.exe into the scripts subfolder and then add the current lines into the NSC.ini file:
[NRPE Handlers]
check_ExecCustScript= scripts\$ARG1$ $ARG2$
If the lines above do not work then you probably need to edit them according to the version of NSClient that you are using.
I suggest you to increase the command_timeout in the NSC.ini
On Nagios server you have to define a new command:
define command {
command_name check_defrag_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t 3600 -c check_execcustscript -a "check_defrag.exe" "$ARG1$"
}
Now on Nagios server you can define a new service:
define service {
use your_service_template
host_name your_server
service_description Disk Fragmentation C: D:
check_command check_defrag_nrpe!C: D:
}
----------------------------------------------------------------------
ONE LAST NOTE
----------------------------------------------------------------------
I defined this command on NSClient:
check_ExecCustScript= scripts$ARG1$ $ARG2$
This allows you to define several commands on Nagios without edit NSC.ini of your servers.
For example, you can put (on the NSClient++ scripts subfolder of your windows server) a.exe, b.exe, c.bat and then define the following commands on Nagios:
define command {
command_name check_a
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_execcustscript -a "a.exe" "$ARG1$"
}
define command {
command_name check_b
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_execcustscript -a "b.exe" "$ARG1$"
}
define command {
command_name check_c
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_execcustscript -a "c.bat" "$ARG1$"
}
For any questions or concerns please contact me: http://www.alan-pipitone.com/contact.php
Alan Pipitone.
Reviews (0)
Be the first to review this listing!