我在centos7上使用icinga v2.3.9
在配置EventCommand对象时,
[2018-12-14 12:34:03 +0000] information/ConfigItem: Committing config items
[2018-12-14 12:34:03 +0000] critical/config: Error: Required attribute is missing: Object 'restart_service' (Type: 'EventCommand') at /etc/icinga2/zones.d/global-templates/eventcommands.conf:2 -> Attribute 'execute'
[2018-12-14 12:34:03 +0000] critical/config: 1 error
[root @ server icinga2]#cat zone.d / global-templates / eventcommands.conf
object EventCommand "restart_service" {
command = [ PluginDir + "/restart_service" ]
arguments = {
"-s" = "$service.state$"
"-t" = "$service.state_type$"
"-a" = "$service.check_attempt$"
"-S" = "$restart_service$"
"-H" = "$host.name$"
}
vars.restart_service = "$procs_command$"
}
}
我缺少什么吗,此配置在v2.10.2-1中有效
答案 0 :(得分:1)
好吧,我发现了一个愚蠢的错误。
缺少导入“ plugin-event-command”。
我添加了它,而且效果很好。
但是在v2.10中显然不需要它