LINUX.ORG.RU

История изменений

Исправление mky, (текущая версия) :

In every line of failregex, the part that matches the host name or IP address must be wrapped in a (?P<host> ... ) sandwich. This is a Python-specific regex extension that assigns the contents of the match to the name <host>. The <host> tag is how you tell fail2ban which host was connecting, so it has to be present in every line of failregex. If it's not, fail2ban will issue an error message about «No 'host' group».

As a convenience, you can use the predefined entity <HOST> in your regexes. <HOST> is an alias for (?:::f{4,6}:)?(?P<host>\S+), which matches either a hostname or an IPv4 address (possibly embedded in an IPv6 address).

То есть <HOST> это не просто так, а регулярное выражение, соответствующее ip-адресу, поэтому с простой строкой не совпадёт. Пробуйте через ″(?P<host> ... )″.

Исходная версия mky, :

In every line of failregex, the part that matches the host name or IP address must be wrapped in a (?P<host> ... ) sandwich. This is a Python-specific regex extension that assigns the contents of the match to the name <host>. The <host> tag is how you tell fail2ban which host was connecting, so it has to be present in every line of failregex. If it's not, fail2ban will issue an error message about «No 'host' group».

As a convenience, you can use the predefined entity <HOST> in your regexes. <HOST> is an alias for (?:::f{4,6}:)?(?P<host>\S+), which matches either a hostname or an IPv4 address (possibly embedded in an IPv6 address). [\quote]

То есть <HOST> это не просто так, а регулярное выражение, соответствующее ip-адресу, поэтому с простой строкой не совпадёт. Пробуйте через ″(?P<host> ... )″.