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
I only know the “hardcore” variant.
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.
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.
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