Results 1 to 5 of 5

Thread: [RESOLVED] Can't get event handler to run from a separate poller

  1. #1
    Junior Member
    Join Date
    May 2012
    Posts
    5

    [RESOLVED] Can't get event handler to run from a separate poller

    Dear Shinken Forum,

    We're running Shinken in a setup with two networks having a firewall in between. Because of that, we have a "master" Shinken with all the services in one domain (let's call it the Mother domain), and a poller in the other domain (Child domain).

    On the poller (Child domain), I got this service:

    Code:
    define service{
        service_description   test_check
        host_name        my-poller
        use           generic-service
        check_command      test_check
        event_handler_enabled  1
        event_handler      test_handler
    }
    Command definitions look like this:

    Code:
    define command {
        command_name   test_handler
        command_line   $PLUGINSDIR$/test_handler.sh $SERVICESTATE$
    }
    
    define command {
        command_name  test_check
        command_line  /tmp/test.sh
    }

    The problem is that the event handler doesn't run from the poller (my-poller has the appropriate "poller_tag" set in the host definition). I guess it tries to run from the "master" (Mother domain) instead. If I put "test_handler" as the "check_command" for my service, it triggers it. So the service itself is OK.

    I've tried adding the same poller tag in test_handler's command definition, but I still can't get it to run from my-poller.

    Any ideas on how to get the event handler to run from there?
    [proudly] running Shinken 1.0.1 on Ubuntu 12.04 x86_64

  2. #2
    Shinken project leader
    Join Date
    May 2011
    Location
    Bordeaux (France)
    Posts
    2,131

    Re: Can't get event handler to run from a separate poller

    Hi,

    It's because event_handlers are run by reactionners, not pollers

    Look at reactionner_tag(s).
    No direct support by personal message. Please open a thread so everyone can see the solution

  3. #3
    Junior Member
    Join Date
    May 2012
    Posts
    5

    Re: Can't get event handler to run from a separate poller

    I'll do that! Thanks for your reply!
    [proudly] running Shinken 1.0.1 on Ubuntu 12.04 x86_64

  4. #4
    Junior Member
    Join Date
    May 2012
    Posts
    5

    Re: Can't get event handler to run from a separate poller

    Update: it works like a charm!

    All I had to do is to define a reactionner in shinken-specific.cfg:
    Code:
    define reactionner{
        reactionner_name   reactionner-2
        address       my-poller
        port         7769
        reactionner_tags   collector
    }
    Then make sure the reactionner is started on "my-poller" and the firewall allows communication from the "master" to the port 7769 on "my-poller". Then, add the reactionner tag to my event handler's service definition in commands.cfg:

    Code:
    define command {
        command_name   test_handler
        command_line   $PLUGINSDIR$/test_handler.sh $SERVICESTATE$
        reactionner_tag collector
    }
    Restart Shinken, of course, and the handler is triggered from "my-poller".

    Thanks, Naparuba - for pimping my Shinken!
    [proudly] running Shinken 1.0.1 on Ubuntu 12.04 x86_64

  5. #5
    Shinken project leader
    Join Date
    May 2011
    Location
    Bordeaux (France)
    Posts
    2,131

    Re: Can't get event handler to run from a separate poller

    You're welcome
    No direct support by personal message. Please open a thread so everyone can see the solution

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •