No announcement yet.

Event Handler not accepting arguements (also in Setup forum)

  • Filter
  • Time
  • Show
Clear All
new posts

  • Event Handler not accepting arguements (also in Setup forum)

    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.

  • #2
    Similar issues

    I experienced similar issues when trying to pass arguments to an event handler. I'm not sure if it is an error in Nagios or Oreon.

    However, what i did, was i passed the arguments in the service definition. This doesn't give you much flexibility though. It works, and that is what i cared about.

    As always, it may be helpful to review the process for creating event handlers...

    Looking at your code again however, it would appear that you are sending you event handler arguments to the check command. Do you have a seperate event handler routine that you are passing to? or, are you sending these to the check command?


    • #3
      This link gives an 404 ERROR.


      • #4 <- New URL. nagios stable version is 3.x
        Bi Intel(R) Xeon(TM) CPU 3.06GHz - 3Gb ram
        Nagios® Core™ Version 3.2.1 - Nagios Plugins 1.4.14 - NDO 1.4b9 patché
        Centreon 2.3.4 - Syslog Module 1.3.2 - StatusMap Module 2.5 - NDO Tools Module 0.4 SVN - Nagvis
        Beta tester : centreon-engine - centreon-broker