From: Andy Witter Date: Mon, 11 Nov 2013 14:58:30 +0000 (-0500) Subject: Add password access for munin web X-Git-Tag: GenaSYS-2.5.0~9 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=aec9bda5029a20aee76aa1f75293eb152c9db023;p=contrib%2Fpines%2Fgenasys.git Add password access for munin web --- diff --git a/GenaSYS.sh b/GenaSYS.sh index d13845a..c0ddee1 100755 --- a/GenaSYS.sh +++ b/GenaSYS.sh @@ -2724,6 +2724,9 @@ then cp -f "$TEMPLATEDIR/monitor/extinfo_icinga.cfg" "setup_${NODE_FOLDER}/Icinga-Nagios" cp -f "$TEMPLATEDIR/monitor/munin-cron.crontab" "setup_${NODE_FOLDER}/Munin" cp -f "$TEMPLATEDIR/icinga.debconf" "setup_${NODE_FOLDER}/.icinga.debconf" + echo "$MONITOR_ADMIN_PASSWORD" > "setup_${NODE_FOLDER}/.munin_admin_password" + chmod 700 "setup_${NODE_FOLDER}/.munin_admin_password" + chmod 700 "setup_${NODE_FOLDER}/.munin_admin_password" sed -i "s^MONITOR_PW^${MONITOR_ADMIN_PASSWORD}^g" "setup_${NODE_FOLDER}/.icinga.debconf" fi sed -i "s^tar_file^$NODE_FOLDER^g" "setup_${NODE_FOLDER}/setup_$NODE_FOLDER.sh" diff --git a/templates/setup.sh b/templates/setup.sh index 29d8db6..34576c0 100755 --- a/templates/setup.sh +++ b/templates/setup.sh @@ -654,6 +654,16 @@ then a2ensite munin-vhost.conf fi +## Setup htpasswd for Munin. +if [ -e ${WD}/.munin_admin_password ] +then + MUNIN_PWD="$(cat ${WD}/.munin_admin_password)" + echo + echo "Generating password for muninadmin ..." + sleep 2 + htpasswd -bc /var/cache/munin/www muninadmin ${MUNIN_PWD} && rm -f ${WD}/.munin_admin_password +fi + ## Setup Apache2 for Icinga if [ -e /etc/apache2/sites-available/icinga-vhost.conf ] then