Why Icinga2 remote apt check is displaying results from master?

I've a icinga2 installation monitoring some debian hosts using native agent.

All checks are working fine except apt. The results displayed are taken from the icinga2 master machine and I can't understand why.

This is my apt service config:

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

  check_command = "apt"

  assign where (host.name == NodeName || host.vars.linux_ver == "debian")
//  assign where host.name == NodeName
}

Any hints?

1
задан 7 September 2018 в 11:19
1 ответ

Вопрос старый, но..: Вам нужно будет каким-то образом определить удаленного клиента (command_endpoint), иначе он будет проверять только мастера. Я предполагаю, что ваша конфигурация агента запущена, поэтому вы уже настроили zones.conf. Предлагаю добавить вторую службу для удаленных клиентов:

apply Service "apt2" {
  import "generic-service"
  check_interval = 10m   // * how often to check
  check_command = "apt"  // * call the plugin
  command_endpoint = host.vars.remote_client // * execute the plugin on the remote machine

  //vars.apt_only_critical = "1" //uncomment if you want.

  assign where host.vars.remote_client && host.vars.linux_apt == "1" // * only check where remote client is set and vars.linux_apt is set to "1" 
}

Host configuration:

object Host "<HostName>" {
  import "generic-host" // * default stuff
  address = "<HostAddress>" // * default stuff
  vars.linux_apt = "1" // * Set this host to be checked by the new service
  vars.remote_client = "<HostNameAsConfiguredInZones.conf>" // * Needed for the remote service checks. Check `zones.conf` on what to insert here for your host.
}
3
ответ дан 3 December 2019 в 18:26

Теги

Похожие вопросы