~ubuntu-branches/ubuntu/saucy/fail2ban/saucy

« back to all changes in this revision

Viewing changes to files/nagios/README

  • Committer: Package Import Robot
  • Author(s): Yaroslav Halchenko
  • Date: 2013-05-13 11:58:56 UTC
  • mfrom: (1.1.15) (10.2.13 sid)
  • Revision ID: package-import@ubuntu.com-20130513115856-x7six9p53qcie0vl
Tags: 0.8.9-1
* New upstream release
  - significant improvements in documentation (Closes: #400416)
  - roundcube auth filter (Closes: #699442)
  - enforces C locale for dates (Closes: #686341)
  - provides bash_completion.d/fail2ban
* debian/jail.conf:
  - added findtime and documentation on those basic options from jail.conf
    (Closes: #704568)
  - added new sample jails definitions for ssh-route, ssh-iptables-ipset{4,6},
    roundcube-auth, sogo-auth, mysqld-auth
* debian/control:
  - suggest system-log-daemon (Closes: #691001)
  - boost policy compliance to 3.9.4
* debian/rules:
  - run fail2ban's unittests at build time but ignore the failures
    (there are still some known issues to fix up to guarantee robust testing
    in clean chroots etc).
    Only pyinotify was added to build-depends since gamin might still be
    buggy on older releases and get stuck, which would complicate
    backporting

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Description
 
2
-----------
 
3
This plugin checks if the fail2ban server is running and how many IPs are currently banned.
 
4
You can use this plugin to monitor all the jails or just a specific jail.
 
5
 
 
6
 
 
7
How to use
 
8
----------
 
9
Just have to run the following command:
 
10
    $ ./check_fail2ban --help
 
11
 
 
12
If you need to use this script with NRPE you just have to do the 
 
13
following steps:
 
14
 
 
15
1 allow your user to run the script with the sudo rights. Just add
 
16
  something like that in your /etc/sudoers (use visudo) :
 
17
        nagios ALL=(ALL) NOPASSWD: /<path-to>/check_fail2ban
 
18
 
 
19
2 then just add this kind of line in your NRPE config file :
 
20
  command[check_fail2ban]=/usr/bin/sudo /<path-to>/check_fail2ban
 
21
 
 
22
3 don't forget to restart your NRPE daemon
 
23
   
 
24
/!\ be careful to let no one able to update the check_fail2ban ;)
 
25
------------------------------------------------------------------------------
 
26
 
 
27
 
 
28
Notes (from f2ban.txt)
 
29
-----
 
30
It seems that Fail2ban is currently not working, please login and check
 
31
 
 
32
HELP:
 
33
 
 
34
1.) stop the Service
 
35
/etc/init.d/fail2ban stop
 
36
 
 
37
2.) delete the socket if available
 
38
rm /tmp/fail2ban.sock
 
39
 
 
40
3.) start the Service 
 
41
/etc/init.d/fail2ban start
 
42
 
 
43
4.) check if fail2ban is working
 
44
fail2ban-client ping
 
45
Answer should be "pong"
 
46
 
 
47
5.) if the answer is not "pong" run away or  CRY FOR HELP ;-)
 
48
 
 
49
 
 
50
Help
 
51
----
 
52
 
 
53
Usage: /<path-to>/check_fail2ban [-p] [-D "CHECK FAIL2BAN ACTIVITY"] [-v] [-c 2] [-w 1] [-s /<path-to>/socket] [-P /usr/bin/fail2ban-client]
 
54
 
 
55
Options:
 
56
 -h, --help
 
57
    Print detailed help screen
 
58
 -V, --version
 
59
    Print version information
 
60
 -D, --display=STRING
 
61
    To modify the output display 
 
62
    default is "CHECK FAIL2BAN ACTIVITY"
 
63
 -P, --path-fail2ban_client=STRING
 
64
    Specify the path to the tw_cli binary
 
65
    default value is /usr/bin/fail2ban-client
 
66
 -c, --critical=INT
 
67
    Specify a critical threshold
 
68
    default is 2
 
69
 -w, --warning=INT
 
70
    Specify a warning threshold
 
71
    default is 1
 
72
 -s, --socket=STRING
 
73
    Specify a socket path
 
74
    default is unset
 
75
 -p, --perfdata
 
76
    If you want to activate the perfdata output
 
77
 -v, --verbose
 
78
    Show details for command-line debugging (Nagios may truncate the output)
 
79
 
 
80
 
 
81
Example
 
82
-------
 
83
 
 
84
# for a specific jail
 
85
$ ./check_fail2ban --verbose -p -j ssh -w 1 -c 5 -P /usr/bin/fail2ban-client
 
86
DEBUG : fail2ban_client_path: /usr/bin/fail2ban-client
 
87
DEBUG : /usr/bin/fail2ban-client exists and is executable
 
88
DEBUG : final fail2ban command: /usr/bin/fail2ban-client
 
89
DEBUG : warning threshold : 1, critical threshold : 5
 
90
DEBUG : it seems the connection with the fail2ban server is ok
 
91
CHECK FAIL2BAN ACTIVITY - OK - 0 current banned IP(s) for the specific jail ssh | currentBannedIP=0
 
92
 
 
93
# for all the current jails
 
94
$ ./check_fail2ban --verbose -p -w 1 -c 5 -P /usr/bin/fail2ban-client
 
95
DEBUG : fail2ban_client_path: /usr/bin/fail2ban-client
 
96
DEBUG : /usr/bin/fail2ban-client exists and is executable
 
97
DEBUG : final fail2ban command: /usr/bin/fail2ban-client
 
98
DEBUG : warning threshold : 1, critical threshold : 5
 
99
DEBUG : it seems the connection with the fail2ban server is ok
 
100
DEBUG : jails list: apache, ssh-ddos, ssh
 
101
DEBUG : the jail apache has currently 0 banned IPs
 
102
DEBUG : the jail ssh-ddos has currently 0 banned IPs
 
103
DEBUG : the jail ssh has currently 0 banned IPs
 
104
CHECK FAIL2BAN ACTIVITY - OK - 3 detected jails with 0 current banned IP(s) | currentBannedIP=0