From b1121b882f3038a199fbc68514481e412cd9f4f4 Mon Sep 17 00:00:00 2001 From: Bernd Dau Date: Wed, 24 Feb 2010 09:46:55 +0100 Subject: [PATCH] Initial version --- plugins/other/s9y | 113 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100755 plugins/other/s9y diff --git a/plugins/other/s9y b/plugins/other/s9y new file mode 100755 index 00000000..f66b688e --- /dev/null +++ b/plugins/other/s9y @@ -0,0 +1,113 @@ +#!/bin/bash +# $Id: s9y 7 2010-02-24 22:15:37Z root $ +# $Rev: 7 $ +# $Author: root $ +# $Date: 2010-02-24 23:15:37 +0100 (Mi, 24. Feb 2010) $ +# +# +: </tmp/s9y-env.txt + +if [ "$1" = "autoconf" ]; then + echo no + echo "Set the needed Variables in munin-node" + exit 0 +fi + SPAM=`mysql --defaults-extra-file=$extrafile -D $database -B --skip-column-names -e "select count(*) from serendipity_spamblocklog;"` + +if [ "$1" = "config" ]; then + + echo 'graph_title Spam Entries in Serendipity' + echo 'graph_args --base 1000 --lower-limit 0' + echo 'graph_vlabel Entries' + echo 'graph_category other' + echo 'graph_total Total' + echo 'graph_info counts the moderated and rejected Comment Entries in Serendipity which where classified as Spam' + echo 'spam.label SPAM' + echo "resettype $resettype" + echo "spam.value $SPAM" + + exit 0 +fi + +#### resettype? +if [ -n $resettype ] +then + if [ "$resettype" = "monthly" ] + then + day=`date '+%d'` + if [ $day -eq 1 && "`date '+%H%M'`" -eq 0 ] + then + mysql --defaults-extra-file=$extrafile -D $database -B --skip-column-names -e "delete from serendipity_spamblocklog where 1=1;" + fi + fi +fi + +echo "spam.value $SPAM"