Is there someone who get fail2ban work with cacti?

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
sblantipodi
Posts: 24
Joined: Fri Aug 05, 2011 9:21 am

Is there someone who get fail2ban work with cacti?

Post by sblantipodi »

As title,
I copied the fail2ban_stats.sh in /usr/share/cacti/scripts
added the template from the fail2ban archieve but it doesn't display any graph.
sblantipodi
Posts: 24
Joined: Fri Aug 05, 2011 9:21 am

Re: Is there someone who get fail2ban work with cacti?

Post by sblantipodi »

Ok, now it displays the graph, the scripts

Code: Select all

FAIL2BAN="fail2ban-client"

JAIL=$1

if [ -z $JAIL ]; then
        echo "Usage:" `basename $0` "<jail>"
        exit
fi

IFS=""

STATS=$($FAIL2BAN status $JAIL)

TOTAL_FAILED=$(echo $STATS | grep "Total failed:" | awk '{ print $5 }')
TOTAL_BANNED=$(echo $STATS | grep "Total banned:" | awk '{ print $4 }')

echo "failed:"$TOTAL_FAILED "banned:"$TOTAL_BANNED
show correct value if executed directly but graph is blank.

It show, failed nan banned nan.

No one use fail2ban here?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Is there someone who get fail2ban work with cacti?

Post by gandalf »

Please see 2nd link of my sig for debugging
R.
sblantipodi
Posts: 24
Joined: Fri Aug 05, 2011 9:21 am

Re: Is there someone who get fail2ban work with cacti?

Post by sblantipodi »

gandalf wrote:Please see 2nd link of my sig for debugging
R.
Thanks for the answer.

the fail2ban template doesn't work and it is also unuseful, there is no way to monitor two or more jail since it doesn't let us to specify two or more jail.
No one created a "working and useful" template for fail2ban?

Thanks.
sblantipodi
Posts: 24
Joined: Fri Aug 05, 2011 9:21 am

Re: Is there someone who get fail2ban work with cacti?

Post by sblantipodi »

this sh scripts want a jail name:

Code: Select all

FAIL2BAN="fail2ban-client"                                                                                            |
                                                                                                                      |
JAIL=$1                                                                                                               |
                                                                                                                      |
if [ -z $JAIL ]; then                                                                                                 |
        echo "Usage:" `basename $0` "<jail>"                                                                          |
        exit                                                                                                          |
fi                                                                                                                    |
                                                                                                                      |
IFS=""                                                                                                                |
                                                                                                                      |
STATS=$($FAIL2BAN status $JAIL)                                                                                       |
                                                                                                                      |
TOTAL_FAILED=$(echo $STATS | grep "Total failed:" | awk '{ print $5 }')                                               |
TOTAL_BANNED=$(echo $STATS | grep "Total banned:" | awk '{ print $4 }')                                               |
                                                                                                                      |
echo "failed:"$TOTAL_FAILED "banned:"$TOTAL_BANNED   


What is a jail name? What should I pass to the scripts?
sblantipodi
Posts: 24
Joined: Fri Aug 05, 2011 9:21 am

Re: Is there someone who get fail2ban work with cacti?

Post by sblantipodi »

can't get rid of the NAN value.
https://www.dropbox.com/s/e81x2vpaeiexh ... 282%29.PNG

the debug attached on that link.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests