0

我在我的 icintga2 监控系统中使用具有自上而下模式的导向器设置了一个具有 2 个客户端端点的单个主控。我还设置了 2 个接受配置和接受命令的客户端节点。(希望这意味着我正在运行自上而下的命令端点模式)

3 台主机的服务检查(磁盘/内存/负载)返回正确的结果。但我的问题是:根据Top Down Command Endpoint example的示例,主机 icinga2-client1 使用“ hostalive ”作为主机 check_command。例如。

object Host "icinga2-client1.localdomain" {
  check_command = "hostalive" //check is executed on the master
  address = "192.168.56.111"

  vars.client_endpoint = name //follows the convention that host name == endpoint name
}

但是我遇到的一个问题是,如果 client1 icinga 进程未运行,则主机状态保持绿色,并且所有服务状态(磁盘/内存/负载)也保持绿色,因为 master 没有获得任何服务检查更新和 hostalive check 命令能够 ping 节点。

最佳实践 - 健康检查部分,它提到使用“ cluster-zone ”检查命令。我期待在使用“ cluster-zone ”时,当客户端节点 icinga 进程停止时,主机状态将为RED ,但不知何故这并没有发生。

有人知道吗?

我的区域/主机/端点配置如下:

object Zone "icinga-master" {
    endpoints = [ "icinga-master" ]
}
object Host "icinga-master" {
    import "Master-Template"

    display_name = "icinga-master [192.168.100.71]"
    address = "192.168.100.71"
    groups = [ "Servers" ]
}
object Endpoint "icinga-master" {
    host = "192.168.100.71"
    port = "5665"
}


object Zone "rick-tftp" {
    parent = "icinga-master"
    endpoints = [ "rick-tftp" ]
}
object Endpoint "rick-tftp" {
    host = "172.16.181.216"
}
object Host "rick-tftp" {
    import "Host-Template"

    display_name = "rick-tftp [172.16.181.216]"
    address = "172.16.181.216"
    groups = [ "Servers" ]
    vars.cluster_zone = "icinga-master"
}


object Zone "tftp-server" {
    parent = "icinga-master"
    endpoints = [ "tftp-server" ]
}
object Endpoint "tftp-server" {
    host = "192.168.100.221"
}
object Host "tftp-server" {
    import "Host-Template"

    display_name = "tftp-server [192.168.100.221]"
    address = "192.168.100.221"
    groups = [ "Servers" ]
    vars.cluster_zone = "icinga-master"
}


template Host "Host-Template" {
    import "pnp4nagios-host"

    check_command = "cluster-zone"
    max_check_attempts = "5"
    check_interval = 1m
    retry_interval = 30s
    enable_notifications = true
    enable_active_checks = true
    enable_passive_checks = true
    enable_event_handler = true
    enable_perfdata = true
}

谢谢,

瑞克

4

0 回答 0