fail2ban error

Discussion in 'Installation/Configuration' started by robertlouwen, Mar 28, 2010.

  1. robertlouwen

    robertlouwen New Member

    I have this error in Ispconfig control panel: Unable to read /var/log/fail2ban.log
    When I look in /var/log there is no fail2ban.log so I create one, permissions 774 and owner root:root
    Then the error changes in: fail2ban is not installed

    I am using: Perfect server Fedora 12 ( i686 ), ISPConfig v 3.0.2.1

    Who has an idea ?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Make sure that the fail2ban binray on your system is in the path, so that it can be found with the "which" command.
     
  3. robertlouwen

    robertlouwen New Member

    Hello Till,

    I think fail2ban is not in the path
    Code:
    [root@obelix /]# which fail2ban
    /usr/bin/which: no fail2ban in (/usr/lib/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib/courier-imap/sbin:/usr/lib/courier-imap/bin:/usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
    Now, how do I get it inot the path ?
     
  4. billcouper81

    billcouper81 New Member

    The fact the log file didn't exist indicates that it might not be installed??

    Code:
    yum install fail2ban
    chkconfig --levels 235 fail2ban on
    /etc/init.d/fail2ban start
    
     
  5. robertlouwen

    robertlouwen New Member

    Hello BillCouper,

    I am sure fail2ban is installed ! To be very sure I rebooted my box and I saw fail2ban in the list with started services.

    So it must be something else...
     
  6. falko

    falko Super Moderator Howtoforge Staff

    What's the output of
    Code:
    updatedb
    locate fail2ban
    ?
     
  7. robertlouwen

    robertlouwen New Member

    Hello Falko,

    The output of locate fail2ban is a long list so I attached it to this message.
     

    Attached Files:

  8. falko

    falko Super Moderator Howtoforge Staff

    fail2ban seems to be installed. I've created a bug report in our bugtracker, so we will check this.
     
  9. Mosquito

    Mosquito New Member

    What is the output of the following two commands
    Code:
    cat /etc/fail2ban/fail2ban.conf
    
    Code:
    ls -la /var/log | grep "fail"
    
     
  10. robertlouwen

    robertlouwen New Member

    cat /etc/fail2ban/fail2ban.conf
    Code:
    # Fail2Ban configuration file
    #
    # Author: Cyril Jaquier
    #
    # $Revision: 629 $
    #
    
    [Definition]
    
    # Option:  loglevel
    # Notes.:  Set the log level output.
    #          1 = ERROR
    #          2 = WARN
    #          3 = INFO
    #          4 = DEBUG
    # Values:  NUM  Default:  3
    #
    loglevel = 3
    
    # Option:  logtarget
    # Notes.:  Set the log target. This could be a file, SYSLOG, STDERR or STDOUT.
    #          Only one log target can be specified.
    # Values:  STDOUT STDERR SYSLOG file  Default:  /var/log/fail2ban.log
    #
    logtarget = SYSLOG
    
    # Option: socket
    # Notes.: Set the socket file. This is used to communicate with the daemon. Do
    #         not remove this file when Fail2ban runs. It will not be possible to
    #         communicate with the server afterwards.
    # Values: FILE  Default:  /var/run/fail2ban/fail2ban.sock
    #
    socket = /var/run/fail2ban/fail2ban.sock
    
    ls -la /var/log | grep "fail"
    Code:
    -rwxrwxrwx  1 root     root             36 2010-03-28 21:52 fail2ban.log
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    Thats most likely a problem with your path variable. ISPConfig checks with:

    which fail2ban

    and

    which fail2ban-client

    if fail2ban is installed. If both commands return that fail2ban is not installed, ispconfig displays that its not installed.
     
  12. robertlouwen

    robertlouwen New Member

    Hello Till,

    Code:
    [root@obelix /]# which fail2ban
    /usr/bin/which: no fail2ban in (/usr/lib/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
    Code:
    [root@obelix /]# which fail2ban-client
    /usr/bin/fail2ban-client
    Have a nice day.
     
  13. robertlouwen

    robertlouwen New Member

    Update

    I have reason to believe this problem is solved.

    If someone can confirm that the information in the attached fail2ban log is the expected information in fail2ban.log then the problem is solved.

    What did I try: update to ispconfig v3.0.2.1, create /var/log/fail2ban.log, owner root:root, permissions 774.

    A big thank you to everybody.
     

    Attached Files:

    Last edited: Apr 4, 2010

Share This Page