Hi everyone,
I am new to Icinga2.
By default all check commands are defined in the Icinga Template Libary (ITL) which are located under /usr/share/icinga2/include
Now I want to add a second path for my check commands for that I have adjusted the icinga2.conf with the following line:
include_recursive "/etc/icinga2/conf.d/xxx/command"
Then I defined my own check command ifopserstatus.conf under this path.
The check command looks like this:
object CheckCommand “ifoperstatus” {
command = [ PluginDir + “/check_ifoperstatus” ]
arguments = {
“-H” = “$address$”
“-d” = “$ifdescription$”
“-C” = “$community$”
}
vars.community = “xxx”
}
When I try to restart Icinga2 it reports an error with this file. But I am not really sure where the problem is. The same check command works when I put it in the ITL.
– Unit icinga2.service has begun reloading its configuration
Mai 10 11:21:31 icinga2 safe-reload[542]: Validating config files: Failed
Mai 10 11:21:31 icinga2 safe-reload[542]: [2020-05-10 11:21:31 +0200] information/cli: Icinga application loader (version: r2.11.3-1)
Mai 10 11:21:31 icinga2 safe-reload[542]: [2020-05-10 11:21:31 +0200] information/cli: Loading configuration file(s).
Mai 10 11:21:31 icinga2 safe-reload[542]: [2020-05-10 11:21:31 +0200] critical/config: Error: Object ‘ifoperstatus’ of type ‘CheckCommand’ re-defined: in /etc/icinga2/conf.d/xxx/command/ifstatus.conf: 1:0-1:33; previous definition: in /etc/icinga2/conf.d/rohlmann
Mai 10 11:21:31 icinga2 safe-reload[542]: Location: in /etc/icinga2/conf.d/xxxcommand/ifstatus.conf: 1:0-1:33
Mai 10 11:21:31 icinga2 safe-reload[542]: /etc/icinga2/conf.d/xxx/command/ifstatus.conf(1): object CheckCommand “ifoperstatus” {
Mai 10 11:21:31 icinga2 safe-reload[542]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mai 10 11:21:31 icinga2 safe-reload[542]: /etc/icinga2/conf.d/xxx/command/ifstatus.conf(2): command = [ PluginDir + “/check_ifoperstatus” ]
Mai 10 11:21:31 icinga2 safe-reload[542]: /etc/icinga2/conf.d/xxx/command/ifstatus.conf(3): arguments = {
Mai 10 11:21:31 icinga2 safe-reload[542]: [2020-05-10 11:21:31 +0200] critical/cli: Config validation failed. Re-run with ‘icinga2 daemon -C’ after fixing the config.
Mai 10 11:21:31 icinga2 systemd[1]: icinga2.service: Control process exited, code=exited status=1
Mai 10 11:21:31 icinga2 systemd[1]: Reload failed for Icinga host/service/network monitoring system.
– Subject: Unit icinga2.service has finished reloading its configuration
– Defined-By: systemd
– Support: http://www.ubuntu.com/support
Could you tell me what I have missed or what I am doing wrong?
best Regards,
ciscler