我在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@servericinga2]#cat区域.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 中有效
好吧,我发现了这个愚蠢的错误。
缺少导入"插件事件命令"。
我添加了它,它起了作用。
但不知何故,v2.10 中并不明确需要它