What is the purpose of operating-system.conf

Hello,

when updating icinga on my agents, I noticed an error during the upgrade.
The icinga-service failed to restart, because of a duplicate CheckCommand (it is defined in /var/lib/icinga2/api/zones/global-templates/_etc/commands.conf and /usr/share/icinga2/include/plugins-contrib.d/operating-system.conf).
I defined the correct CheckCommand in /var/lib/icinga2/api/zones/global-templates/_etc/commands.conf.
I checked the operating-system.conf file before the update and the CheckCommand causing the error was commented out. After the update the leading and trailing /* and */ where missing, so the error mentioned above occured.
Sadly, I did not set up this icinga2-master, but do have to configure it from now on.
What is the purpose of the operating-system.conf and what would I have to change to prevent overwriting it when updating icinga?

Thanks in advance.

Hi,

the operating-system.conf file is part of the Icinga Template Library (ITL). The ITL provides pre-defined CheckCommands.

I highly recommend to not editing the files in /usr/share/icinga2/include/* since they may get overwritten during an update. I think that is exactly what happend here. Someone created a new CheckCommand with a name that is already used in operating-system.conf file. Than the file was edited and the trailing /* */ where added (comment out). If such happen simply use a other name for your CheckCommand e.g. add a prefix company-mem.

Best regards
Michael

Thanks Michael,

I renamed the CheckCommand and everythings working now!

1 Like