Local checks on ha setup

Hi,
i have an setup with two master-nodes. Some local checks will not performed on the node itself, like swap.

Is there a way, that some checks always will perfomed local?

Greets
Robert


zones.conf

// Definieren der Endpunkte //

object Endpoint "vp-inf-mgt-102.rz.intern" {
//        host = "vp-inf-mgt-102.rz.intern"
//        port = "5665"
}

object Endpoint "vp-inf-mgt-103.rz.intern" {
        host = "vp-inf-mgt-103.rz.intern"
//        port = "5665"

}

// Definieren der Zonen //

object Zone "master" {
        endpoints = [ "vp-inf-mgt-102.rz.intern","vp-inf-mgt-103.rz.intern" ]
}

// Definieren der globalen Zonen //

object Zone "global-templates" {
        global = true
}

object Zone "global-rz_intern" {
        global = true
}

This will actually pertain to the service object rather than the endpoint or zone.

If you’re using the defaults still, in services.conf you’ll see this:

apply Service "swap" {
  import "generic-service"

  check_command = "swap"

  assign where host.name == NodeName
}

We want to modify this:

apply Service "swap" {
  import "generic-service"

  check_command = "swap"
  command_endpoint = host.vars.client_endpoint

  assign where host.vars.os == "Linux"
}

Check commands will run on the monitoring server itself (a master or a satellite) instead of the endpoint unless you explicity tell it to use the endpoint. host.vars.client_endpoint is a common convention, and if you look at the default templates.conf, you’ll see it defined as the node name for that host, as well as Linux being the defined OS. So in this case, we would be saying any host defined to be running Linux that has an endpoint object should run its own swap check.

Better use

command_endpoint = host.name

To run command on the hist you assigned the services via apply rule.

Cheers,
Carsten

Thank you Blake and Carsten. After adding the command_endpoint, everything is fine. :slight_smile:

Greets
robert

2 Likes