How to setup Host dependency in icinga [ssh agentless setup]

  • I have configured 100 servers with ssh agentless setup , All servers are only accessible through a port forwarding server 192.168.60.2, But sometimes this port forwarding server may not reachable which causes icinga to assume all 100 hosts are down, How can I prevent such behaviour in icinga by setting a dependency to "port forwarding server 192.168.60.2" and stop all related service & host notifications ?

    Sample Host configs


  • Same for services then.

  • Thanks for the quick reply Dnsmichi ,

    Is there any syntax errors in below code ?


  • apply Dependency "portforward-gateway" to Services

    must be : apply Dependency "portforward-gateway" to Service.

    dependencies that tie to services need both of the below example set:

    Code
    1. parent_host_name = "thehost" parent_service_name = "the_service_i_am_depending_on"

    Why dont you validate your config using icinga2 daemon --validate, it would have told you instantly...

  • must be : apply Dependency "portforward-gateway" to Service.

    dependencies that tie to services need both of the below example set:

    Code
    1. parent_host_name = "thehost" parent_service_name = "the_service_i_am_depending_on"

    Why dont you validate your config using icinga2 daemon --validate, it would have told you instantly...


    Actually I meant "is this syntax correct ?" , Yes I do check validation by "service icinga checkconfig "

  • dnsmichi  

    Currently I have below dependency configuration

    Code
    1. apply Dependency "internet-check" to Host {
    2. parent_host_name = "office-internet"
    3. assign where cidr_match("192.168.60.2/32", host.address)
    4. }
    5. apply Dependency "internet-check" to Services {
    6. parent_host_name = "office-internet"
    7. assign where cidr_match("192.168.60.2/32", host.address)
    8. }

    But sometimes I get down and recovery notifications (email alerts )even after adding above dependency configuration


    Will adding below options to the dependency configuration fix this issue ?

    Code
    1.  states = [ DOWN ]
    2.   disable_checks = true
    3.   disable_notifications = true
  • states = [ Up ] is the default already (the dependency will fail if the parent host is not in this state)


    disable_notifications = true is also the default. disable_checks can optionally be added, if it helps with preventing further checks. Keep in mind if the parent host name is not checked that frequently that a child host/service won't "see" its failure.