icinga2 服务依赖性检查

icinga2 服务依赖性检查

我有一个非常简单的用例,当 httpd 服务关闭时,我想禁用我的 check_cert 服务。这是我的 httpd 服务模板:

apply Service "httpd" { import "generic-service" check_command = "check_httpd_service" command_endpoint = host.vars.client_endpoint assign where host.vars.client_endpoint && host.vars.myserver }

这是证书检查服务:

apply Service "check_cert" { import "generic-service" check_command = "check_ssl_certificate" command_endpoint = host.vars.client_endpoint assign where host.vars.client_endpoint && host.vars.myserver }

我尝试了这个但仍然收到来自 check_cert 的警报:

apply Dependency "cert_http_depend" to Service { parent_service_name = "httpd" disable_checks = true disable_notifications = true assign where host.vars.client_endpoint && host.vars.myserver }

我在这里遗漏了什么?

答案1

您可能需要父服务应处于以下状态:

parent_service_name = "httpd"
...
states = [ OK ]

相关内容