Projet

Général

Profil

Révision 6a931418

ID6a931418055b40e5864e22401f8a242a56b7c6c8
Parent 391d1526
Enfant a15365dd

Ajouté par D. Becker il y a presque 14 ans

Initial version

Voir les différences:

plugins/other/blockhosts
1
#!/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`

Formats disponibles : Unified diff