Windows Failed Service restart batch file (Visit this link)

rating from 0 votes
Restart Windows Failed Service batch script with log.

File:    win_service_restart.cmd
 Author:  Vadims Zenins http://vadimszenins.blogspot.com
 Version: 1.05
 Date:    24/11/2009 18:26: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$
         }

 NSCLIENT++ NSC.ini:
   [NRPE]
   allowed_hosts=192.168.1.1/32  ; your Nagios server IP
   allow_arguments=1
   [External Script]
   allow_arguments=1
   allow_nasty_meta_chars=1
   [NRPE Handlers]
   command[win_service_restart]=scriptswin_service_restart.cmd "$ARG1$" $ARG2$ $ARG3$ $ARG4$

 Additional examples on http://vadimszenins.blogspot.com/2008/12/nagios-restart-windows-failed-services.html

 Tested platform:
 Windows 2003 R2 x64 SP2, Nagios 3.2.0, NSClient++ 0.3.6.316 2009-02-04 w32

 Version 1.05 revision:
 Logging changes, stop and start services commands nave changed. Logs examples added.
 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

http://vadimszenins.blogspot.com/2008/12/nagios-restart-windows-failed-services.html

md5: 8b90ba7654227f1bf07c694368843b9e *win_service_restart.zip

Submitted by: Vadims Zenins
Hits: 1152
Overall downloads: 63
Added: 2008-12-16 00:00:00
Last Modified: 2010-06-14 02:32:59

Filename Preview Size Description DL
win_service_restart.zip 10 kb Version 1.05 24

Comments


Be the first to comment this project.

Leave a reply

If you just want to rate the project leave the other field empty.
Even though it would be nice if you would drop a line.

Allowed tags: blockquote, strong, a, b, i, u, code

Captcha Reload Image


  • Basic NRPE_NT Plugins

    rating from 0 votes
    The plugins are DOS programs written in C/C++ The nrpe_nt service calls these plug-ins and they return the following status on exit with a status string for information printed to stdout.
  • Check Active Directory - TK

    rating4 from 1 votes
    Performs Active Directory Health Check on domain controllers and member servers.
  • WMI agentless plugins

    rating from 0 votes
    This project consists of a set of VBS scripts that use Microsoft .NET Framework and WMI to retrieve data from remote Windows hosts without the need for agents on the remote hosts. Current release is 1.3 (December 5, 2008).
  • NagiosPluginsNT

    rating from 0 votes
    NagiosPluginsNT is a comprehensive collection of Nagios check plugins written in C# .NET. The goal is to eventually have a Windows equivalent to the official Nagios plugins for *NIX, but with the power of WMI for Windows monitoring.
  • Check File - TK

    rating4 from 1 votes
    check_file is a Nagios NRPE plugin for checking simple files or files in directories by using various types of filters like file count, size, age or name match.
  • check_ad_time.vbs

    rating4 from 2 votes
    Check the offset of your server vs active directory domain.
  • Check Roles

    rating from 0 votes
    Checks wether the server knows all its 5 roles using dumpfsmos.
  • Eventlog Checker - dotNET Based

    rating from 0 votes
    Checks a specified Windows Eventlog for any specified event types. Supports filtering, searching for event type ids, etc. This requires at least the .NET 1.1 Framework to be installed on the server.
  • Check Textsearch

    rating from 0 votes
    This plugin will do a text search inside of a file that you specify. If the text that you are searching for is found, then the script will return OK.
  • Check File Age

    rating from 0 votes
    Check_fileage.vbs is plugin for nagios that uses NRPE_NT and works for Microsoft machines. I tried to make it as flexible as posible, allowing nagios to pass simple but helpfull arguments. I use it to find out for example what was the last antivirus definition update, I set if its older then 7 days warn if it is older then 10 critical. Although antivirus update is a centralized automated everyday task, many times admins stop worrying about it or just don’t have the time to keep checking. Well again nagios is here to save us!
Catalot 1.3.0 (appkit/v0.9.0-dev, Agavi/1.0.0) | www.netways.de | Legal
© 2009 NETWAYS GmbH. The Program is provided AS IS, without warranty. Licensed under GPLv3.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 3.