Univention Bugzilla – Bug 53554
Disable admin diary functionality when app is not installed
Last modified: 2021-09-10 11:42:56 CEST
It would be good to have a UCR variable with witch to disable the Admin Diary functionality completely. Right now it also runs some functionality on systems without the app being installed. The background for this feature request is the following: The customer does not use the Admin Diary App and has no intention to do so. The customer also has a custom UDM module. A slight incompatibility in the UDM module now leads to error messages like the following being printed in /var/log/user.log and /var/log/localbuffer. 2021-07-07T08:54:08.248469+02:00 dvme11upw01noi-pri1 2021-07-07 08:54:08,248 ERROR [ISE2=n/a | core_task_id=1625640848 | task_id=1625640848 | mail=iva-smoke-test-1625640848082-ndev.tb2@orange.fr | task=checkEmailsBooking] write_entry failed! DiaryEntry() argument "args" has to be "dict of string/string", but is: <type 'dict'> ({'id': None, 'module': 'in8/bookedaddresses'}) 2021-07-07T08:54:08.249394+02:00 dvme11upw01noi-pri1 2021-07-07 08:54:08,249 ERROR [ISE2=n/a | core_task_id=1625640848 | task_id=1625640848 | mail=iva-smoke-test-1625640848082-ndev.tb2@orange.fr | task=checkEmailsBooking] Traceback (most recent call last):#012 File "/usr/lib/python2.7/dist-packages/univention/admindiary/client.py", line 48, in wrapper#012 return f(*args, **kwds)#012 File "/usr/lib/python2.7/dist-packages/univention/admindiary/client.py", line 105, in write_entry#012 entry.assert_types()#012 File "/usr/lib/python2.7/dist-packages/univention/admindiary/__init__.py", line 112, in assert_types#012 raise TypeError('DiaryEntry() argument "args" has to be "dict of string/string", but is: %s (%s)' % (type(self.args), self.args))#012TypeError: DiaryEntry() argument "args" has to be "dict of string/string", but is: <type 'dict'> ({'id': None, 'module': 'in8/bookedaddresses'}) Because of the amount of transactions taking place for this customer this is not acceptable noise in the logs and possibly also a hit on the performance. In this case we will fix the incompatibility of the UDM module separately of this issue, but it still shows how the admin diary app impacts even systems were it is not installed at all. I think it would be prudent to provide such an off switch for the admin diary functionality in order to handle such events more gracefully and being able to optimize performance.
AFAIK the admin diary "client" already detects whether a server is installed or not. Isn't this an "API incompatibility" of the customer specific implementation?
(In reply to Ingo Steuwer from comment #1) > AFAIK the admin diary "client" already detects whether a server is installed > or not. Isn't this an "API incompatibility" of the customer specific > implementation? The admin diary client creates entries regardless if the actual "Admin Diary App" is installed, in this case the clients just creates syslog message. I think the idea here is to disable the client messages completely.
The log messages above are error messages that were indeed printed because one of the customer modules is not compatible with the API. However, as Felix said, even for those modules that are compatible log messages are created. Since the customer has thousands of transactions per day, in this environment, and does not need or want the admin diary, those log messages should be disabled. This is currently not possible. I don't know what activities the client performs in the background, but for performance reasons it would be good to be able to disable as much as possible.
I guess you can use this as a workaround: cat > /etc/rsyslog.d/disable-admindiary-messages.conf <<%EOF if \$syslogtag == "ADMINDIARY:" then { stop } %EOF systemctl restart rsyslog Maybe you could also use /etc/rsyslog.d/univention-admin-diary-client.conf as filename if univention-admin-diary-client is not installed. That way the local workaround would get deactivated automatically in case you actually install the package at some point later.
I just had a short meeting with Ingo about this issue. He said that we want to include this feature in the product, but we don't have time for it in the schedule right now. The feature is supposed to satisfy the following rough requirements: - It exists a UCR variable admin/diary/logging (or admin/diary/reporting or similar) - If the UCRV is not set, set to "enabled", or set to "yes", then the admin diary functions as it did before this feature. - If the UCRV is set to "disabled" or set to "no" then the admin diary functions are disabled. This means that it produces no log messages and performs no other actions in the background that are not necessary for the functionality of other part of the product. @Arvid: Thanks for the workaround. I will test if it works for us in the meantime.