From 55f72f0a06a05178f75eb52fbce0e2af6f73a6c8 Mon Sep 17 00:00:00 2001 From: Thomas Jansson Date: Fri, 28 May 2010 12:03:33 +0200 Subject: [PATCH] Initial version --- plugins/other/denyhosts | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 plugins/other/denyhosts diff --git a/plugins/other/denyhosts b/plugins/other/denyhosts new file mode 100755 index 00000000..d1456c4b --- /dev/null +++ b/plugins/other/denyhosts @@ -0,0 +1,39 @@ +#!/bin/bash +# +# Plugin to monitor the number of hosts denied by DenyHosts +# +# $Log$ +# Revision 1.0 2009/06/05 16:00:00 tjansson +# Initial revision +# +# Parameters: +# +# config (required) +# autoconf (optional - used by munin-config) +# +# Magick markers (optional): +#%# family=auto +#%# capabilities=autoconf + +LOG=/etc/hosts.deny +if [ "$1" = "autoconf" ]; then + if [ -r "$LOG" ]; then + echo yes + exit 0 + else + echo no + exit 1 + fi +fi + +if [ "$1" = "config" ]; then + + echo 'graph_title Hosts denied by DenyHosts' + echo 'graph_args --base 1000 -l 0' + echo 'graph_vlabel denied hosts ' + echo 'graph_category network' + echo 'HostsDenied.label Hosts denied by DenyHosts' + exit 0 +fi + +echo HostsDenied.value `egrep -c "DenyHosts" $LOG`