2010-05-28 12:03:33 +02:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
2018-08-02 02:03:42 +02:00
|
|
|
# Plugin to monitor the number of hosts denied by DenyHosts
|
2010-05-28 12:03:33 +02:00
|
|
|
#
|
|
|
|
# $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
|
|
|
|
else
|
|
|
|
echo no
|
|
|
|
fi
|
2018-09-16 04:01:57 +02:00
|
|
|
exit 0
|
2010-05-28 12:03:33 +02:00
|
|
|
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`
|