From c4d92fba716d8c9d97f2e989103b66e575e7585f Mon Sep 17 00:00:00 2001 From: Erwan Ben Souiden Date: Tue, 26 Mar 2013 16:08:05 +0100 Subject: [PATCH] fix the script name to check_fail2ban everywhere --- files/nagios/README | 14 +++++++------- files/nagios/check_fail2ban | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/files/nagios/README b/files/nagios/README index 99ffc4e0..28e84495 100644 --- a/files/nagios/README +++ b/files/nagios/README @@ -7,21 +7,21 @@ You can use this plugin to monitor all the jails or just a specific jail. How to use ---------- Just have to run the following command: - $ ./check_fail2ban_activity --help + $ ./check_fail2ban --help If you need to use this script with NRPE you just have to do the following steps: 1 allow your user to run the script with the sudo rights. Just add something like that in your /etc/sudoers (use visudo) : - nagios ALL=(ALL) NOPASSWD: //check_fail2ban_activity + nagios ALL=(ALL) NOPASSWD: //check_fail2ban 2 then just add this kind of line in your NRPE config file : - command[check_fail2ban]=/usr/bin/sudo //check_fail2ban_activity + command[check_fail2ban]=/usr/bin/sudo //check_fail2ban 3 don't forget to restart your NRPE daemon -/!\ be careful to let no one able to update the check_fail2ban_activity ;) +/!\ be careful to let no one able to update the check_fail2ban ;) ------------------------------------------------------------------------------ @@ -50,7 +50,7 @@ Answer should be "pong" Help ---- -Usage: //check_fail2ban_activity [-p] [-D "CHECK FAIL2BAN ACTIVITY"] [-v] [-c 2] [-w 1] [-s //socket] [-P /usr/bin/fail2ban-client] +Usage: //check_fail2ban [-p] [-D "CHECK FAIL2BAN ACTIVITY"] [-v] [-c 2] [-w 1] [-s //socket] [-P /usr/bin/fail2ban-client] Options: -h, --help @@ -82,7 +82,7 @@ Example ------- # for a specific jail -$ ./check_fail2ban_activity --verbose -p -j ssh -w 1 -c 5 -P /usr/bin/fail2ban-client +$ ./check_fail2ban --verbose -p -j ssh -w 1 -c 5 -P /usr/bin/fail2ban-client DEBUG : fail2ban_client_path: /usr/bin/fail2ban-client DEBUG : /usr/bin/fail2ban-client exists and is executable DEBUG : final fail2ban command: /usr/bin/fail2ban-client @@ -91,7 +91,7 @@ DEBUG : it seems the connection with the fail2ban server is ok CHECK FAIL2BAN ACTIVITY - OK - 0 current banned IP(s) for the specific jail ssh | currentBannedIP=0 # for all the current jails -$ ./check_fail2ban_activity --verbose -p -w 1 -c 5 -P /usr/bin/fail2ban-client +$ ./check_fail2ban --verbose -p -w 1 -c 5 -P /usr/bin/fail2ban-client DEBUG : fail2ban_client_path: /usr/bin/fail2ban-client DEBUG : /usr/bin/fail2ban-client exists and is executable DEBUG : final fail2ban command: /usr/bin/fail2ban-client diff --git a/files/nagios/check_fail2ban b/files/nagios/check_fail2ban index 01ff2dae..148c92d5 100755 --- a/files/nagios/check_fail2ban +++ b/files/nagios/check_fail2ban @@ -1,7 +1,7 @@ #!/usr/bin/perl # ------------------------------------------------------- -# -=- -=- +# -=- -=- # ------------------------------------------------------- # # Description : This plugin checks if the fail2ban server is running @@ -49,22 +49,22 @@ # ------------ # # Just have to run the following command: -# $ ./check_fail2ban_activity --help +# $ ./check_fail2ban --help # # If you need to use this script with NRPE you just have to do the # following steps: # # 1 allow your user to run the script with the sudo rights. Just add # something like that in your /etc/sudoers (use visudo) : -# nagios ALL=(ALL) NOPASSWD: //check_fail2ban_activity +# nagios ALL=(ALL) NOPASSWD: //check_fail2ban # # 2 then just add this kind of line in your NRPE config file : -# command[check_fail2ban]=/usr/bin/sudo //check_fail2ban_activity +# command[check_fail2ban]=/usr/bin/sudo //check_fail2ban # # 3 don't forget to restart your NRPE daemon # # -# /!\ be careful to let no one able to update the check_fail2ban_activity ;) +# /!\ be careful to let no one able to update the check_fail2ban ;) # ------------------------------------------------------------------------------ # # #################################################################### @@ -92,7 +92,7 @@ use Getopt::Long qw(:config no_ignore_case); my $version = '0.1'; my $author = 'Erwan Labynocle Ben Souiden'; my $a_mail = 'erwan@aleikoum.net'; -my $script_name = 'check_fail2ban_activity'; +my $script_name = 'check_fail2ban'; my $verbose_value = 0; my $version_value = 0; my $more_value = 0;