aboutsummaryrefslogtreecommitdiffstats
path: root/munin-plugin-agesinceseen
diff options
context:
space:
mode:
Diffstat (limited to 'munin-plugin-agesinceseen')
-rwxr-xr-xmunin-plugin-agesinceseen41
1 files changed, 41 insertions, 0 deletions
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