#!/bin/sh # # Author: Petter Reinholdtsen set -e nodes=/usr/sbin/sitesummary-nodes muninopts="" # Modify this in collector.cfg to /etc/munin/ to automatically replace # the default munin configuration. MUNINDIR=/var/lib/sitesummary if [ -d /var/cache/munin/www ] ; then # Used since munin version 1.4.0-1 muninhtmldir="/var/cache/munin/www" else muninhtmldir="/var/www/munin" fi # Based on of active config from munin version 1.2.5-1 munindbdir=/var/lib/munin muninlogdir=/var/log/munin muninrundir=/var/run/munin munintmpldir=/etc/munin/templates [ -f /etc/sitesummary/collector.cfg ] && . /etc/sitesummary/collector.cfg # The storage area is not configurable, because too many scripts have # it hardcoded entriesdir=/var/lib/sitesummary/entries generate_munin_config() { # Generate munin config. Edit /etc/cron.d/munin to enable it. # Add -c /var/lib/sitesummary/sitesummary-munin.conf to the calls # to the munin scripts, or change MUNINDIR above. ( if [ -f $MUNINDIR/munin.conf.pre ] ; then cat $MUNINDIR/munin.conf.pre else cat < $MUNINDIR/munin.conf.new && \ chown root:root $MUNINDIR/munin.conf.new && \ chmod a+r $MUNINDIR/munin.conf.new && \ mv $MUNINDIR/munin.conf.new $MUNINDIR/munin.conf } # Only enable if munin and sitesummary is installed. if [ -f /etc/munin/munin.conf ] && [ -x /usr/sbin/sitesummary-nodes ]; then generate_munin_config fi