40 lines
861 B
Plaintext
40 lines
861 B
Plaintext
|
#!/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`
|