Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Info
Use this HOWTO when setting the default behavior of the user interface.

Table of Contents

Introduction

The Checkmk GUI can be customized easily by each user to fit the their personal needs. Here are some examples:

...

It might be useful to define your own defaults for some of these settings , so a new user doesn't have to change everything on his own.

...

Get the factory defaults from the original file, for example:

Code Block
languagebash
themeRDark
title~/lib/python3/cmk/gui/plugins/config/base.py

...

# Default timestamp format to be used in multisite

...


default_ts_format = 'mixed'

...


Create a file below ~/local/share/check_mk/web/plugins/config and define your preferred default setting, for example:

Code Block
languagebash
themeRDark
title~/local/share/check_mk/web/plugins/config/my_base.py
# We prefer to se both, the absolute and the relative time

...


default_ts_format = 'both'


After doing an "omd restart apache", you will find this setting in your GUI:

Code Block
languagebash
themeRDark
OMD[mysite]:

...

~$ omd restart apache


Image Added

The views for which you already explicitly have set the Time stamp format , will not be changed , because the settings in your personal config files below ~/var/check_mk/web/<username> are overriding the default settings.

Example 2: Default Sidebar Snapins

In the case of the sidebar snapins, the file ~/lib/python3/cmk/gui/plugins/config/base.py doesn't help us , because the variable "sidebar" that is set there , seems to have a new data structure. You can find out this structure by explicitly configuring your sidebar in the GUI and then checking out the file ~/var/check_mk/web/<your_username>/sidebar.mk. The structure you find there , can be used in ~/local/share/check_mk/web/plugins/config/my_base.py:

Code Block
languagebash
themeRDark
title~/local/share/check_mk/web/plugins/config/my_base.py
# Newly create users should get these sidebar snapins:

...


sidebar = [

...


        {

...


            'snapin_type_id': 'tactical_overview',

...


            'visibility': 'open'

...


        },

...


        {

...


            'snapin_type_id': 'bookmarks',

...


            'visibility': 'open'

...


        },

...


        {

...


            'snapin_type_id': 'views',

...


            'visibility': 'closed'

...


        },

...


        {

...


            'snapin_type_id': 'search',

...


            'visibility': 'closed'

...


        },

...


        {

...


            'snapin_type_id': 'time',

...


            'visibility': 'closed'

...


        }

...


    ]

Recommendations

Sometimes its it's hard to work out the possible values of a setting. In that case, applying the setting in the GUI and then doing a "grep" in ~/var/check_mk/web might be helpful:

...

Code Block
languagebash
themeRDark
OMD[mysite]:~$ grep -r ts_format ~/var/check_mk/web/

...


/omd/sites/

...

mysite/var/check_mk/web/cmkadmin/viewoptions.mk:{'svcproblems': {'ts_date': '%Y-%m-%d', 'ts_format': 'abs'}}

Filter by label (Content by label)
showLabelsfalse
max5
spacesKB
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel in ("agent_bakery","agent") and type = "page" and space = "KB"
labelsagent agent_bakery

Page Properties
hiddentrue


Related issues