Windows

check_defrag

Description:

This plug-in for Nagios allows you to check if a disk needs to be defragmented.

Current Version

Last Release Date

2012-05-19

Compatible With

  • Nagios 3.x

Owner


Project Files
Project Photos
Project Notes
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.
Reviews (0) Add a Review
Add a Review

You must be logged in to submit a review.

Thank you for your review!

Your review has been submitted and is pending approval.

Recommend

To:


From:


Thank you for your recommendation!

Your recommendation has been sent.

Project Stats
Rating
0 (0)
Favorites
1
Views
67,359