event handler

Anirudh Srinivasan srianirudh at gmail.com
Tue Apr 21 17:41:27 CEST 2009


Hey Folks
I am currently working on event handlers to restart services on Windows
machines

I have NC_Net installed on all client windows machines. I was looking at
this plugin "Windows Failed Service restart batch file" at Nagios Exchange.

File: win_service_restart.cmd
Author: Vadims Zenins http://vadimszenins.blogspot.com
Version: 1.03
Date: 16/12/2008 17:19
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.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]=scripts\win_service_restart.cmd "$ARG1$" $ARG2$
$ARG3$ $ARG4$

It uses check_nrpe at the commands.cfg file, but here we use check_nt .

My question is,  will this work if i change it to check_nt .  Or is there
any changes that has to be made.

Can anyone please shed light on this .

-
Anirudh Srinivasan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20090421/84b0708f/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null


More information about the Users mailing list