No announcement yet.

Event Handler not accepting arguements in UI, won't generate

  • Filter
  • Time
  • Show
Clear All
new posts

  • Event Handler not accepting arguements in UI, won't generate

    I am monitoring a web farm using a linux system and nrpe_nt/check_nrpe. Everything is working fantastic (THANKS!)

    My recent challenge is that one of my developers has a web application that occassionally gets "stuck" and needs to have the NT W3SVC restarted. I can detect the failure just fine so I setup an event handler to restart the service when the check fails. If I create a check that calls a batch file on the NT server that has this in it with no event arguements it works:

    net stop w3svc
    net start w3svc
    exit 1

    But instead of creating a event handler dedicated to every potential service (thinking to the future) I would like to do this ...

    @echo off
    net stop %1
    net start %1
    exit 1

    Now, this works on the command line from the monitoring system but when I setup this check:

    /usr/local/nagios/libexec/check_nrpe -H $HOSTADDRESS$ -c nt_svc_restart -a $ARG1$

    and enter the check in the event handler with !w3svc in the arguements I get:

    Error: Event handler command 'nt_svc_restart!w3svc' specified in service '(SERVICE)' for host '(HOST)' not defined anywhere. (SERVICE and HOST are obviously changed to protect the guilty in this post..) . When I try it without the exclamation mark I get the same error.

    So, thoughts ? Why is this working on the command line and not in Oreon ?
    John Meek
    Systems IT Manager, CHP Productions, Inc.