Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: [resolved] bp_rule don't work

  1. #1

    [resolved] bp_rule don't work

    Hi,

    I just installed shinken 0.6.4 to test some cool feature such as bp_rule.
    The problem is that bp_rule don't work for me. I've certainly made a mistake but I don't know where...

    Here is a sample configuration I've made for testing purpose:

    I define a fake host :

    define host{
    use generic-host
    host_name host1
    alias host1
    address 1.1.1.1
    }

    Then a fake service with an critical status return :

    define service{
    use generic-service
    host_name host1
    service_description serv1
    check_command check_dummy!2
    }

    Then, i want to aggregate the host and the service :

    define service{
    use generic-service
    host_name host1
    service_description myservice
    check_command bp_rule!(host1,serv1)
    }

    Host "host1" return a critical status and the service "serv1" hosted by "host1" is critical too.

    The problem is that "myservice" return OK instead of CRITICAL:'(

    Any idea ?


  2. #2

    Re: bp_rule don't work

    hi,

    As I read on http://www.shinken-monitoring.org/wi...les_in_shinken ; it's used for HA;
    in your example, you only use 1 host; I think there should be another host.

  3. #3

    Re: bp_rule don't work

    Thanks for your fast reply !

    I've tried more complex test case with no success.
    That's the reason why I put a simple example with no HA.
    The first thing I've tried looked something like this :

    define service{
    use generic-service
    host_name host1
    service_description myservice
    check_command bp_rule!(host1,serv2 & host1,serv3)
    }

    In this case, I wanted to check an Apache/Mysql availability.

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

    Re: bp_rule don't work

    Hi,

    The bp_rule take hard states only. Is the 2 services in HARD states? Can you look at the last check of "myservice" ? (should be earlier than the time when one of the serv2 or 3 became critical.
    No direct support by personal message. Please open a thread so everyone can see the solution

  5. #5

    Re: bp_rule don't work

    Yes, the 2 services are in hard state.

    I've tried a more precise configuration :

    define host{
    host_name host1
    alias host1
    address 1.1.1.1
    retry_interval 1
    check_interval 1
    max_check_attempts 1
    initial_state u
    check_period 24x7
    }


    define service{
    host_name host1
    service_description serv1
    check_command check_dummy!2
    retry_interval 1
    check_interval 1
    max_check_attempts 1
    initial_state u

    }

    define service{
    host_name host1
    service_description serv2
    check_command check_dummy!2
    retry_interval 1
    check_interval 1
    max_check_attempts 1
    initial_state u

    }

    define service{
    host_name host1
    service_description myservice
    check_command bp_rule!(host1,serv1 && host1,serv2)
    contact_groups monitoring
    retry_interval 1
    check_interval 1
    max_check_attempts 1
    initial_state u
    }


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

    Re: bp_rule don't work

    I'm not currently with a shell, but I'mm try to reproduce it tommorow. Must be something we are missing
    No direct support by personal message. Please open a thread so everyone can see the solution

  7. #7
    Administrator Frescha's Avatar
    Join Date
    May 2011
    Posts
    183

    Re: bp_rule don't work

    Hi Chettor,
    I think your check_command is wrong. In my opinion a single ampersand (&amp is enough.

    define service{
    host_name host1
    service_description myservice
    check_command bp_rule!(host1,serv1 && host1,serv2)
    contact_groups monitoring
    retry_interval 1
    check_interval 1
    max_check_attempts 1
    initial_state u

    See http://www.shinken-monitoring.org/wi...ice_definition ->
    * & : it's use to make an AND betweens statuses
    * | : it's use to make an OR betweens statuses
    * ! : it's use to make a NOT of a status or expression
    * , : it's use to make a OR, like the | sign.
    * ( and ) : they are used like in all math expressions.

  8. #8

    Re: bp_rule don't work

    Thanx for the advice !

    But unfortunately, it don't work better

  9. #9
    Administrator Frescha's Avatar
    Join Date
    May 2011
    Posts
    183

    Re: bp_rule don't work

    Mh, did you try the check_command without the bracket?

    bp_rule!host1,serv1 && host1,serv2

  10. #10

    Re: bp_rule don't work

    hi,

    I've run a bench of test , it appears that it works correctly with this config:
    Code:
    define service{
        host_name        host1
        service_description   myservice
        check_command      bp_rule!(host1,serv1 | host2,serv1)
        retry_interval     1
        check_interval     1
        max_check_attempts   1
        initial_state      u
    }
    but not for the one you suggest.

    hope it'll work fine on your side too

Posting Permissions

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