Changing logwatch default context behavior

I noticed on Checkmk 2.0.0p17 (CRE) that by default, when displaying logfiles, the context is shown. I would like to change that behavior to have the context hidden by default but couldn’t find any option in the global settings. I tried editing /opt/omd/versions/2.0.0p17.cre/lib/python3/cmk/gui/logwatch.py but couldn’t find the exact line to edit.

Is there any official (or unofficial) way to do this efficiently without breaking further updates? Also, what If I’d like MK to keep less context? On my default installation it does keep a lot of context.

If there is context shown or not only depends on the transmitted log information from the client.
On client side you can define if you want context information or not.
For Windows clients you find the definitions inside the example YAML file.
For mk_logwatch you have the option to limit or disable context information.

Can’t find the doc anymore, doens’t seem to be in the new doc, what are the parameters on Linux to limit the context to say 20 rows? What about changing the default log view to no context while still have the context available if we want it?

The view knows nothing about context or not.
Here i found a post describing the mk_logwatch options.
@thkos - Inside the official doc it’s missing :wink:

There is a _hidecontext parameter that is added to the URL when we want the view without context. I’d like that boolean to be set to TRUE by default rather than FALSE. This should be a global setting or a user interface setting.

If there is a parameter inside the logwatch.py then you only can hard code it.
Or you write a mail directly to the Munich team and request an extension to be written.
Third option is the GUI thread for a better interface

I know that I promised to bring mk_logwatch in the manual. Unfortunately it is not yet present - but it is still on our ToDo list. Although it may be unwise to promise a date :wink:: a first draft should be available by end of March.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.