How to change the default sidebar snapins for new users

Hi,

does anybody know how to change the set of default snapins a new created user will see?

There are a handful similar questions around (see below), but most of them are very old.
I just wanted to ask if there is meanwhile a solution available.
Thanks,
Simon

https://forum.checkmk.com/t/default-sidebar-snapins/18090/2

1 Like

I only know the “hardcore” variant. :slight_smile:
Inside /lib/python/cmk/gui/plugins/config/base.py there is a list sidebar.
You can modify this list and every new user has now the “new” sidebar settings until he changes something. Also all users who not have touched the sidebar will get the new sidebar.

3 Likes

Maybe we could then put something into ~/local/lib/.... I haven’t tried, though. Would be great if that would work because files below ~local/lib/python can be packaged in an MKP file.

2 Likes

Until now i found no way to make it work from local :frowning:

2 Likes

Thanks Dirk & Andreas,

I will try that!
Regards,
Simon

Hello Simon

we use one main file (SIDEBAR_FILE / sidebar.mk):
Content of sidebar.mk:

{'fold': False,
 'snapins': [('tactical_overview', 'open'),
         ('search', 'open'),
         ('views', 'open'),
         ('bookmarks', 'open'),
         ('biaggr_groups', 'open'),
         ('tag_tree', 'open')]}

This file we’ve customized and it will be distributed via bash scrip:

USER_DIR="/opt/omd/sites/${OMD_SITE}/var/check_mk/web/"
EXCLUDE_USERS_FILE="/opt/wwi/wwi_scripts/sidebar/exclude_users.txt"
SIDEBAR_FILE="/opt/wwi/wwi_scripts/sidebar/sidebar.mk"
for USER_FOLDER in $(ls $USER_DIR|grep -v "^adm"|grep -v "^automation"); do	
# check the excluded users
# -----------------------------
EXCLUDE_USER=$(grep $USER_FOLDER $EXCLUDE_USERS_FILE|tail -1)
if [ "$EXCLUDE_USER" != "$USER_FOLDER" ]; then
	
	# copy only in folders
	# -----------------------------
	if [ ! -f "${USER_DIR}${USER_FOLDER}" ] && [ -d "${USER_DIR}${USER_FOLDER}" ]; then
		cp $SIDEBAR_FILE $USER_DIR""$USER_FOLDER"/"
	fi

fi
done

I hope it helps.

Best regards
Jan-Philipp

2 Likes

Hello Jan-Philipp :wave:,

thanks for sharing this. Great idea!
Best regards,
Simon

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.