我正在尝试在 icinga2 中配置 check_cluster。我们目前在 8 台服务器上进行了健康检查。我们想通知 3 台或更多服务器上的运行状况检查是否至关重要。
apply Service "Cluster Service Health Check" {
check_command = "check_cluster"
vars.check_cluster_service = true
vars.check_cluster_label = "Health Check"
vars.check_cluster_warning = 2
vars.check_cluster_critical = 3
vars.check_cluster_data = {{
get_object(Service, "server1.net!Elements Health Check").state + "," + get_object(Service, "server2.net!Elements Health Check").state + "," + get_object(Service, "server3.net!Elements Health Check").state + "," + get_object(Service, "server4.net!Elements Health Check").state + "," + get_object(Service, "server5.net!Elements Health Check").state + "," + get_object(Service, "server6.net!Elements Health Check").state + "," + get_object(Service, "server7.net!Elements Health Check").state + "," + get_object(Service, "server8.net!Elements Health Check").state
}}
assign where host.name == "chicago-cluster"
}
当我们应用上述逻辑时,我们会看到以下 3 个健康检查关键。
CLUSTER WARNING: Elements Health Check: 5 ok, 0 warning, 0 unknown, 3 critical
但 Icinga2 将其显示为警告。(见下文)
请建议。