Projet

Général

Profil

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

root / plugins / network / hostsdeny @ 17f78427

Historique | Voir | Annoter | Télécharger (1,38 ko)

1
#!/bin/bash
2
#
3
# Plugin to monitor the number of hosts in /etc/hosts.deny
4
# that are deined access to sshd
5
#
6
# Based on denyhosts plugin by tjansson (2009)
7
#
8
# Copyright (C) 2009 Kåre Hartvig Jensen (kaare.hartvig.jensen@gmail.com)
9
#
10
# This program is free software: you can redistribute it and/or modify
11
# it under the terms of the GNU General Public License as published by
12
# the Free Software Foundation, either version 3 of the License, or
13
# (at your option) any later version.
14
#
15
# This program is distributed in the hope that it will be useful,
16
# but WITHOUT ANY WARRANTY; without even the implied warranty of
17
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
# GNU General Public License for more details.
19
#
20
# You should have received a copy of the GNU General Public License
21
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
#
23

    
24
if [ "$1" = "autoconf" ]; then
25
        if [ -r "$LOG" ]; then
26
                echo yes
27
                exit 0
28
        else
29
                echo no
30
                exit 1
31
        fi
32
fi
33

    
34
if [ "$1" = "config" ]; then
35

    
36
        echo 'graph_title Hosts denied sshd access in /etc/hosts.deny'
37
        echo 'graph_args --base 1000 -l 0'
38
        echo 'graph_vlabel Hosts denied '
39
        echo 'graph_category system'
40
        echo 'HostsDenied.label Hosts denied'
41
        exit 0
42
fi
43

    
44
echo HostsDenied.value  `cat /etc/hosts.deny | grep sshd | wc -l`