In Centos 6, fail2ban writes weid characters to log file

Hi. In Centos 6.3 I installed fail2ban with 'yum install fail2ban' from EPEL fedora repositories.

The default logging fail2ban writes to /var/log/messages

I changed it to write to a separate file /var/log/fail2ban.log like this:

/etc/fail2ban/fail2ban.conf

logtarget = /var/log/fail2ban.log

In both cases I see weird characters in the log, it doesn't make any sense. Please observe below.

Am I missing some package ? The way I installed centos 6.3 is from a minimal install .iso

Jan 31 23:46:38 localhost fail2ban.server : INFO Changed logging target to SYSLOG for Fail2ban v0.8.8

Jan 31 23:46:38 localhost fail2ban.jail : INFO Creating new jail 'ssh-iptables'

Jan 31 23:46:38 localhost fail2ban.jail : INFO Jail 'ssh-iptables' uses pyinotify

Jan 31 23:46:38 localhost fail2ban.jail : INFO Initiated 'pyinotify' backend

Message from syslogd@localhost at Jan 31 23:46:38 …

©<30>fail2ban.filter : INFO Added logfile = /var/log/secure

Jan 31 23:46:38 localhost ©<30>fail2ban.filter : INFO Added logfile = /var/log/secure

Message from syslogd@localhost at Jan 31 23:46:38 …

©<30>fail2ban.filter : INFO Set maxRetry = 5

Jan 31 23:46:38 localhost ©<30>fail2ban.filter : INFO Set maxRetry = 5

Message from syslogd@localhost at Jan 31 23:46:38 …

©<30>fail2ban.filter : INFO Set findtime = 600

Jan 31 23:46:38 localhost ©<30>fail2ban.filter : INFO Set findtime = 600

Jan 31 23:46:38 localhost fail2ban.actions: INFO Set banTime = 600

Jan 31 23:46:38 localhost fail2ban.jail : INFO Jail 'ssh-iptables' started

Jan 31 23:46:38 localhost fail2ban.actions.action: ERROR printf %b "Subject: [Fail2Ban] SSH: started#012Date: date -u +"%a, %d %h %Y %T +0000"#012From: Fail2Ban <fail2ban@example.com>#012To: root\n#012Hi,\n#012The jail SSH has been started successfully.\n#012Regards,\n#012Fail2Ban" | /usr/sbin/sendmail -f fail2ban@example.com root returned 7f00

Jan 31 23:46:38 localhost fail2ban.actions.action: INFO HINT on 7f00: "Command not found". Make sure that all commands in 'printf %b "Subject: [Fail2Ban] SSH: started\nDate: date -u +"%a, %d %h %Y %T +0000"\nFrom: Fail2Ban <fail2ban@example.com>\nTo: root\n\nHi,\n\nThe jail SSH has been started successfully.\n\nRegards,\n\nFail2Ban" | /usr/sbin/sendmail -f fail2ban@example.com root' are in the PATH of fail2ban-server process (grep -a PATH= /proc/pidof -x fail2ban-server/environ). You may want to start "fail2ban-server -f" separately, initiate it with "fail2ban-client reload" in another shell session and observe if additional informative error messages appear in the terminals.

1 Reply

I solved the problem by uninstalling fail2ban with 'yum remove fail2ban' and installed it from .rpm

http://yum1.freepbxdistro.org/pbx/3.211 … noarch.rpm">http://yum1.freepbxdistro.org/pbx/3.211.63/x86_64/RPMS/fail2ban/fail2ban-0.8.7.1-89.noarch.rpm

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct