nrpe arguments

Toto Capuccino shoktai at gmail.com
Thu Mar 9 11:19:42 CET 2006


Hi,

I want to launch event hancler on a remote windows host. The active nagios
checks are checking exchange IS, MTA and SA and i want services to be
restarted if they stop.
Event handlers are enabled.
I see in eventlog [09-03-2006 10:43:28] SERVICE EVENT HANDLER:
ussfrsv02;Exchange IS;CRITICAL;SOFT;3;restart_exchange

I put a service eventhandler in nagios services.cfg file
event_handler                   restart_exchange

and put a definition in miscommands.cfg file
####Event-Handlers#############
define command {
        command_name     restart_exchange
        command_line        $USER1$/check_nrpe -H $HOSTADDRESS$ -c
restart_exchange $SERVICESTATE$ $STATETYPE$ $SERVICEATTEMPT$
        }

I am wondering if the concept is ok. On the windows side the nrpe.cfg file
got a definition for restart_exchange:
# Values: 0=do not allow arguments, 1=allow command arguments
dont_blame_nrpe=1
command[restart_exchange]=C:\nrpe\bin\RestartExchangeServices.cmd $ARG1$
$ARG2$ $ARG3$

And my RestartExchangeServices.cmd file contains this and at least it works
in command line
@ECHO off
IF %1 == 'HARD' GOTO :1 ELSE GOTO :999
:1
IF %2 == 'SOFT' GOTO :2 ELSE GOTO :999
:2
IF %3 == '3' GOTO :3
:3
net start MSExchangeIS
net start MSExchangeMTA
net start MSExchangeSA
ECHO "Services Exchange IS, MTA ans SA have been started"
REM EXIT exitCode 0
GOTO :999

I commented the Exitcode because it dont see the need for eventhandler.
Anyway it is not working at all :( I would greatly appreciate some thoughts,
comments, help or solutions.
 --
Le bon sens est la chose du monde la mieux partagée.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20060309/d857f190/attachment.html>


More information about the Users mailing list