Projet

Général

Profil

Paste
Télécharger au format
Statistiques
| Branche: | Révision:

root / plugins / system / blockhosts @ 81e9ffca

Historique | Voir | Annoter | Télécharger (930 octets)

1 6a931418 D. Becker
#!/bin/sh
2
# Plugin to monitor the number of hosts denied by BlockHosts
3
#
4
# $Log$
5
# based on: 
6
# denyhosts plugin
7
# Revision 1.0  2009/06/05 16:00:00 tjansson
8
#
9
# Modified by d.becker 2010/02/04
10
#
11
# Parameters:
12
#       config   (required)
13
#       autoconf (optional - used by munin-config)
14
 
15
LOG=/etc/hosts.allow
16
17
if [ "$1" = "autoconf" ]; then
18
        if [ -r "$LOG" ]; then
19
                echo yes
20
                exit 0
21
        else
22
                echo no
23
                exit 1
24
        fi
25
fi
26
 
27
if [ "$1" = "config" ]; then
28
 
29
        echo 'graph_title Hosts denied by BlockHosts'
30
        echo 'graph_args -l 0'
31
        echo 'graph_vlabel denied hosts '
32
        echo 'graph_category system'
33
        echo 'HostsDenied.label Hosts denied by BlockHosts'
34
        echo 'HostsWatched.label Hosts watched by BlockHosts'
35
	exit 0
36
fi
37
 
38
echo HostsDenied.value  `egrep -c " : deny" $LOG`
39
echo HostsWatched.value `egrep -c "#bh: ip:" $LOG`