Add password access for munin web
authorAndy Witter <awitter@georgialibraries.org>
Mon, 11 Nov 2013 14:58:30 +0000 (09:58 -0500)
committerAndy Witter <awitter@georgialibraries.org>
Mon, 11 Nov 2013 14:58:30 +0000 (09:58 -0500)
GenaSYS.sh
templates/setup.sh

index d13845a..c0ddee1 100755 (executable)
@@ -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"
index 29d8db6..34576c0 100755 (executable)
@@ -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