diff options
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | debian/changelog | 2 | ||||
| -rwxr-xr-x | munin-plugin-agesinceseen | 41 | 
3 files changed, 45 insertions, 0 deletions
| @@ -58,6 +58,8 @@ install-server:  	$(INSTALL) -d $(DESTDIR)/usr/share/munin/plugins/.  	$(INSTALL) munin-plugin $(DESTDIR)/usr/share/munin/plugins/sitesummary_sites +	$(INSTALL) munin-plugin-agesinceseen \ +		$(DESTDIR)/usr/share/munin/plugins/sitesummary_agesinceseen  	$(INSTALL) -d $(DESTDIR)/etc/nagios3  	$(INSTALL_DATA) nagios.cfg \ diff --git a/debian/changelog b/debian/changelog index 9dc7e34..20b1513 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,8 @@ sitesummary (0.0.59) UNRELEASED; urgency=low    * New function get_debian_ver() reporting /etc/debian_release content      in SiteSummary perl module.    * Create Nagios hostclass using the result from get_debian_ver(). +  * New munin plugin drawing graph based on agesinceseen vaules donated +    by Sverre Jensen.   -- Petter Reinholdtsen <pere@debian.org>  Tue, 26 Jan 2010 08:56:53 +0100 diff --git a/munin-plugin-agesinceseen b/munin-plugin-agesinceseen new file mode 100755 index 0000000..e6fb239 --- /dev/null +++ b/munin-plugin-agesinceseen @@ -0,0 +1,41 @@ +#!/bin/sh +# +# Author: Snorre Jensen +# License: GNU General Public License + +ssfile="/var/lib/sitesummary/www/index.html" +if [ ! -r $ssfile ] ; then +    echo Cannot read $ssfile >&2 +    exit -1 +fi + +array=(\>0\ days \>3\ days \>one\ week \>14\ days \>30\ days \>90\ days) +array2=(3_days one_week 14_days 30_days 90_days) +len=${#array[*]} +len2=${#array2[*]} +i=0 + +if [ "$1" = "config" ]; then +    echo 'graph_title SiteSummary AgeSinceSeen' +    echo 'graph_order 0_days 3_days one_week 14_days 30_days 90_days' +    echo 'graph_vlabel count' +    echo 'graph_scale yes' +    echo 'graph_args --base 1000 -l 0' +    echo 'graph_height 400' +    echo 'graph_category SiteSummary' +    echo '0_days.label 0_days' +    echo '0_days.draw AREA' +    while [ $i -lt $len2 ]; do +	echo "${array2[$i]}.label ${array2[$i]}" +		#echo "${array2[$i]}.stack" | sed 's/\ /-/g' +	echo "${array2[$i]}.draw STACK" +	let i++ +    done +else +    while [ $i -lt $len ]; do +	label=${array[$i]}.value  +	value=`cat $ssfile | grep "${array[$i]}" | awk '{ print $3 }'` +	echo "$label $value" | sed 's/>//g' | sed 's/\ /_/' +	let i++ +    done +fi | 
