大网数据广告活动
服务器运维问答

Why Icinga2 remote apt check is displaying results from master?

· 52CE 我爱测

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 serv…

问题原文

原帖链接 · sgargel · CC BY-SA 4.0

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?

已采纳解答

原帖链接 · 30000MONKEYS · CC BY-SA 4.0

Question is old, but: You will need to define the remote client (command_endpoint) in some way, otherwise it will only check on the master. I assume your agent configuration is running, so you have already configured the zones.conf. I suggest adding a second service for the remote clients:

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.
}

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-09-07)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。