2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00
contrib-munin/plugins/system/blockhosts

40 lines
927 B
Plaintext
Raw Normal View History

2010-02-04 14:28:28 +01:00
#!/bin/sh
# Plugin to monitor the number of hosts denied by BlockHosts
#
# $Log$
# based on:
2010-02-04 14:28:28 +01:00
# denyhosts plugin
# Revision 1.0 2009/06/05 16:00:00 tjansson
#
# Modified by d.becker 2010/02/04
#
# Parameters:
# config (required)
# autoconf (optional - used by munin-config)
2010-02-04 14:28:28 +01:00
LOG=/etc/hosts.allow
if [ "$1" = "autoconf" ]; then
if [ -r "$LOG" ]; then
echo yes
exit 0
else
echo no
exit 1
fi
fi
2010-02-04 14:28:28 +01:00
if [ "$1" = "config" ]; then
2010-02-04 14:28:28 +01:00
echo 'graph_title Hosts denied by BlockHosts'
echo 'graph_args -l 0'
echo 'graph_vlabel denied hosts '
echo 'graph_category security'
2010-02-04 14:28:28 +01:00
echo 'HostsDenied.label Hosts denied by BlockHosts'
echo 'HostsWatched.label Hosts watched by BlockHosts'
exit 0
fi
2010-02-04 14:28:28 +01:00
echo HostsDenied.value `egrep -c " : deny" $LOG`
echo HostsWatched.value `egrep -c "#bh: ip:" $LOG`