Am 07.07.2016 um 19:05 schrieb Luca Lesinigo:
Hi list, we are using Icinga v2.4.10, on Ubuntu 14.04 LTS installed from the 
formorer PPA.
We are using icinga2-classicui from the same ppa.

I’m seeing the /var/lib/icinga2/modified-attributes.conf file that gets new 
data when we switch something in the classicui, for example if we turn off 
notifications for a service. Then when we ‘revert’ the setting, the file gets 
updated.

But the entry in that file is there forever, no matter what we do in the 
classicui, and it will override any modification that we do in the service 
configuration file.

I’ll try to overcome my non-native-english with an explicit example:
- you start with a pretty common scenario, a service with active checks and 
nothing special
- from classicui you click “disable notifications for service”, the ui shows 
notifications disabled and modified attributes “None”
- the modified-attributes.conf does not show anything, I don’t know if Icinga2 
persisted the setting somewhere else or if it’s just in ram
- if we reload or restart Icinga2, the modified-attributes.conf gets an entry added for that 
service which contains "obj.modify_attribute("enable_notifications", false)”
So far so good.

Now, if in the classic ui we click “Reset Modified Attributes”, nothing at all 
happens. Notifications stay disabled, the modified-attributes.conf file does 
not change even on Icinga2 restart. I guess this could be intended behavior, 
maybe disabling notifications is not a “modified attribute” ?

Let’s go on...
- in the classic ui we now click “Enable notifications for this service”
- notifications are correctly re-enabled and the ui does not show anymore the 
“notification disabled” icon on that service
- modified-attributes.conf again does not get updated at runtime
- after reload or restart of icinga2, the entry in modified-attributes.conf is still there but 
has been updated to read "obj.modify_attribute("enable_notifications", true)”

So we end up with a pile of “enable_<stuff>”, true whenever we use the UI to 
temporarily switch off notifications, or active checks, or whatever, and then 
re-enable them later on. Annoying, but the real problem is if we change the service 
configuration.

After that disable-and-enable dance imagine that we modify the .conf file where 
the service is defined, and we set enable_notifications=false there.
We reload Icinga2… and notifications are still enabled! That’s because the 
modified-attributes.conf file overrides our service config file and sets them 
true.

As far as I can tell, there is no way from the ClassicUI to tell Icinga2 
“remove any overriding setting and just use whatever is in the main 
configuration”.
Clicking “enable X” or “disable X” will force that setting forever even if the 
service configuration changes and using the “reset modified attributes” link 
seems to do nothing.

The only way to be sure to get applied what we put in the service configuration 
is to stop Icinga2 and manually “clean” the modified-attributes.conf file, 
removing the settings that are not real exceptions to the configuration.
Are we doing something wrong? How could we tell Icinga2 to forget about any 
“override” and just apply the service configuration as is?

The workaround is to fetch the "original_attributes" attribute and then
modify the attribute to its original value. There is a known bug inside
the restore-attribute functionality but this isn't exposed in the API
actions currently. Wasn't really aware that the Classic UI reset
modified attributes external command is still intact and in use. Icinga
Web 2 doesn't use it obviously.

https://dev.icinga.org/issues/11573 - the feature which unveiled the bug
requiring major changes, that is why it is stalled until 2.5 is released.

Kind regards,
Michael


thanks,
--
Luca Lesinigo
LM Networks Srl

_______________________________________________
icinga-users mailing list
icinga-users@lists.icinga.org
https://lists.icinga.org/mailman/listinfo/icinga-users



-- 
Michael Friedrich, DI (FH)
Senior Developer

NETWAYS GmbH | Deutschherrnstr. 15-19 | D-90429 Nuernberg
Tel: +49 911 92885-0 | Fax: +49 911 92885-77
CEO: Julian Hein, Bernd Erk | AG Nuernberg HRB18461
http://www.netways.de | michael.friedr...@netways.de

** OSBConf 2016 - September - osbconf.org **
** OSMC 2016 - November - netways.de/osmc **
_______________________________________________
icinga-users mailing list
icinga-users@lists.icinga.org
https://lists.icinga.org/mailman/listinfo/icinga-users

Reply via email to