Hey Folks<div><br></div><div>I am currently working on event handlers to restart services on Windows machines</div><div><br></div><div>I have NC_Net installed on all client windows machines. I was looking at this plugin "<span class="Apple-style-span" style="color: rgb(51, 51, 46); font-size: 15px; font-weight: bold; line-height: 16px; ">Windows Failed Service restart batch file" at Nagios Exchange.</span></div>
<div><span class="Apple-style-span" style="color: rgb(51, 51, 46); font-size: 15px; font-weight: bold; line-height: 16px;"><br></span></div><div><span class="Apple-style-span" style="color: rgb(51, 51, 46); font-size: 15px; font-weight: bold; line-height: 16px;"><span class="Apple-style-span" style="font-size: 12px; font-weight: normal; "><span class="Apple-style-span" style="color: rgb(255, 0, 0);">File: win_service_restart.cmd <br>
Author: Vadims Zenins <a href="http://vadimszenins.blogspot.com">http://vadimszenins.blogspot.com</a> <br>Version: 1.03 <br>Date: 16/12/2008 17:19 <br>Windows Failed Service restart batch file for Nagios Event Handler <br>
<br>Copy win_service_restart.cmd to \NSClient++\scripts\ folder. <br><br>Nagios commands.cfg: <br>define command{ <br>command_name win_service_restart <br>command_line $USER1$/<span class="Apple-style-span" style="font-weight: bold;"><span class="Apple-style-span" style="text-decoration: underline;"><span class="Apple-style-span" style="color: rgb(0, 51, 51);">check_nrpe</span></span></span> -H $HOSTADDRESS$ -p 5666 -c win_service_restart -a "$SERVICEDESC$" $SERVICESTATE$ $SERVICESTATETYPE$ $SERVICEATTEMPT$ <br>
} <br><br>Nagios template-services_common-win.cfg.cfg <br>define service{ <br>name generic-service-win-wuauserv <br>service_description wuauserv <br>display_name Automatic Updates <br>event_handler win_service_restart <br>
event_handler_enabled 1 <br>check_command check_nt!SERVICESTATE!-d SHOWALL -l $SERVICEDESC$ <br>} <br><br>NSCLIENT++ NSC.ini: <br>[NRPE] <br>allowed_hosts=<a href="http://192.168.1.1/32">192.168.1.1/32</a> ; your Nagios server IP <br>
allow_arguments=1 <br>[External Script] <br>allow_arguments=1 <br>allow_nasty_meta_chars=1 <br>[NRPE Handlers] <br>command[win_service_restart]=scripts\win_service_restart.cmd "$ARG1$" $ARG2$ $ARG3$ $ARG4$</span> </span><br>
</span></div><div><span class="Apple-style-span" style="color: rgb(51, 51, 46); font-size: 12px; line-height: 16px;"><br></span></div><div><span class="Apple-style-span" style="color: rgb(51, 51, 46); font-size: 15px; line-height: 16px;">It uses check_nrpe at the commands.cfg file, but here we use check_nt . </span></div>
<div><span class="Apple-style-span" style="color: rgb(51, 51, 46); font-size: 15px; line-height: 16px;"><br></span></div><div><span class="Apple-style-span" style="color: rgb(51, 51, 46); font-size: 15px; line-height: 16px;">My question is, will this work if i change it to check_nt . Or is there any changes that has to be made. </span></div>
<div><span class="Apple-style-span" style="color: rgb(51, 51, 46); font-size: 15px; line-height: 16px;"><br></span></div><div><span class="Apple-style-span" style="color: rgb(51, 51, 46); font-size: 15px; line-height: 16px;">Can anyone please shed light on this .</span></div>
<div><br></div><div>- <br>Anirudh Srinivasan<br><br>
</div>