Results 1 to 8 of 8

Thread: bp_rule business rule parent dummy host always returning critical?

  1. #1
    Junior Member
    Join Date
    Sep 2014
    Location
    West Midlands, UK
    Posts
    4

    bp_rule business rule parent dummy host always returning critical?

    Hi,

    Using Shinken with NagiosQL and Thruk, constantly learning about its features. Very powerful software.

    I'm currently trying to understand the bp_rule mechanism. I'm having some problems with I've set up a test using some servers which run in a simple main/reserve...

    Both nodes ("server1", "server2&quot have a service running against it ("process check: important driver&quot which polls for a running service. These return the usual OK, UNKNOWN, WARNING, CRITICAL etc + perfdata.

    To allow me to define a service using bp_rule, I set up a check command ("bprule-cluster1_check&quot invoking bp_rule:

    Code:
    bp_rule!(1,2,1of: $ARG1$,$ARG2$ & $ARG3$,$ARG4$)
    I choose "bprule-cluster1_check" command in the service definition and then specify the target server and service name in the $ARG1$ etc:

    $ARG1$ = server1
    $ARG2$ = process check: important driver
    $ARG3$ = server2
    $ARG4$ = process check: important driver

    (see comment further down*)
    I've used the X,Y,Z of: rule with 1, 2 and 1, I understand this should return an OK if one service is OK, a WARNING if both services are WARNING and a CRITICAL if either service is CRITICAL.

    My bp_rule check command expands to the following when I view it in Thruk:

    Code:
    bp_rule!(1,2,1of: server1,process check: important driver & server2,process check: important driver)
    I have two pairs of servers on which the service check runs: one pair which are both WARNING and one which has one WARNING and one OK. Each pair has a dummy host with its own version of the service check applied to it, just for testing (I know I can propagate down the server names better using other ARG variables...).

    However the parent dummy host always shows CRITICAL, even though the individual services are OK! I don't know what I'm doing wrong, I can't get the parent dummy host to display anything but a critical status.

    *I've also tried with quotes around the name, "like this", to avoid any possibility of bp_rule improperly parsing the service name, and I also tried with exact copies of the service checks renamed to simple names, so_they_look-like_this . I could not get the bp_rule to work. I could not even get the simple bp_rule example from the Shinken documentation to work.


    I want to avoid using the third-party check_cluster perl script because the bp_rule feature seems really powerful, but I feel like I'm going round in circles without any success... What am I doing wrong?!


    (Although I might be missing something very obvious, I can't figure out a way of testing with bp_rule at the bash prompt, like I often do with my other Python/Perl-based checks before I enter them into NagiosQL and export to Shinken.)
    .

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

    Re: bp_rule business rule parent dummy host always returning critical?

    You can use ARGN and bp_rule. You must directly set the bp_rule call in your service, without define the bp_rule command definition (no define comand{}). So cahnge ARGN with the name you want (like process check: important driver) and it should be ok
    No direct support by personal message. Please open a thread so everyone can see the solution

  3. #3
    Junior Member
    Join Date
    Sep 2014
    Location
    West Midlands, UK
    Posts
    4

    Re: bp_rule business rule parent dummy host always returning critical?

    Hi Naparuba,

    Thanks for your reply. We're using NagioSQL which requires a command definition to be created before you can use it in a service check.

    I read on an old thread you could code something to drop any command definitions which mention bp_rule, did this ever get made? I cannot manually edit the .cfg files as NagioSQL overwrites them every time I make a modification.
    .

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

    Re: bp_rule business rule parent dummy host always returning critical?

    I don't remember coding it sorry
    No direct support by personal message. Please open a thread so everyone can see the solution

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

    Re: bp_rule business rule parent dummy host always returning critical?

    But now duplicate objets are better managed in the master tree, you can give a try.
    No direct support by personal message. Please open a thread so everyone can see the solution

  6. #6
    Junior Member
    Join Date
    Sep 2014
    Location
    West Midlands, UK
    Posts
    4

    Re: bp_rule business rule parent dummy host always returning critical?

    Ok, will do - I'll set up a new virtual machine with 2.0.3 and give it a try
    .

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

    Re: bp_rule business rule parent dummy host always returning critical?

    Nop, with a git master version not the 2.0.3
    No direct support by personal message. Please open a thread so everyone can see the solution

  8. #8
    Junior Member
    Join Date
    Sep 2014
    Location
    West Midlands, UK
    Posts
    4
    Quote Originally Posted by naparuba View Post
    Nop, with a git master version not the 2.0.3

    Hello again naparuba

    I can't believe it's been a year since I last tried to make this work!

    Using Shinken 2.4 now, and unfortunately still having problems with bp_rule checks.

    Following the documentation, I created some service checks - simple check_tcp checks - and applied them to the pairs of hosts I want to monitor (they are main and reserve pairs).

    I created a command definition in NagiosQL 3.2.0:
    bp_rule!($ARG1$,$ARG2$ & !$ARG3$,$ARG4$)

    I created a service check using this new bp_rule command. ARG1-4 are defined in this service definition.

    I set up a dummy host, and assigned the bp_rule service check to it.

    When I reload Shinken, all is OK. However, the dummy host with the bp_rule check against it does not work as expected:

    /bin/sh: 1: Syntax error: word unexpected (expecting ")")

    I don't understand what I'm doing wrong. The check appears to expand properly in Thruk:

    Check Command: system1-bprule-main_res!host1!service TCP 4000!host2!service TCP 4000
    Expanded Command: bp_rule!(host1,service TCP 4000 & !host2,service TCP 4000)

    I've tried with " " around the service name, to see if it was failing due to the spaces, but it made no difference. I have also tried changing the individual TCP port check names (their Service name, in NagiosQL) to remove the spaces, but it has made no difference.

    Any ideas?
    Last edited by christopher; 09-24-2015 at 05:19 AM.
    .

Posting Permissions

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