Article link

Restart Windows Failed Service batch script with log. File: win_service_restart.cmd Author: Vadims Zenins Version: 1.04 Date: 20/04/2009 17:41 Windows Failed Service restart batch file for Nagios Event Handler

Copy win_service_restart.cmd to NSClient++scripts folder.

Nagios commands.cfg:

 define command{
    command_name win_service_restart
    command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -c win_service_restart -a "$SERVICEDESC$" $SERVICESTATE$ $SERVICESTATETYPE$ $SERVICEATTEMPT$

Nagios template-services_common-win.cfg

 define service{
    name generic-service-win-wuauserv
    service_description wuauserv
    display_name Automatic Updates
    event_handler win_service_restart
    event_handler_enabled 1
    check_command check_nt!SERVICESTATE!-d SHOWALL -l $SERVICEDESC$


 allowed_hosts= ; your Nagios server IP
 [External Script]
 [NRPE Handlers]
 command[win_service_restart]=scriptswin_service_restart.cmd "$ARG1$" $ARG2$ $ARG3$ $ARG4$

Version 1.04 revision: Double restart of the servise is fixed

Version 1.03 revision: Description is changed

Version 1.02 revision: @NET changed to @SC

Version 1.01 revision: Service name's with spase problem is fixed

md5: fd00753533e5fb655d824c3bf1d36d4f *

nagios/windows.txt · Last modified: d/m/Y H:i by admin
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki