prefixtemplate.py

Go to the documentation of this file.
00001 # -*- coding: utf8 -*-
00002 # This file is part of Fail2Ban.
00003 #
00004 # Fail2Ban is free software; you can redistribute it and/or modify
00005 # it under the terms of the GNU General Public License as published by
00006 # the Free Software Foundation; either version 2 of the License, or
00007 # (at your option) any later version.
00008 #
00009 # Fail2Ban is distributed in the hope that it will be useful,
00010 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 # GNU General Public License for more details.
00013 #
00014 # You should have received a copy of the GNU General Public License
00015 # along with Fail2Ban; if not, write to the Free Software
00016 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 
00018 # Author: Cyril Jaquier
00019 # 
00020 # $Revision: 645 $
00021 
00022 __author__ = "Cyril Jaquier"
00023 __version__ = "$Revision: 645 $"
00024 __date__ = "$Date: 2008-01-16 23:55:04 +0100 (Wed, 16 Jan 2008) $"
00025 __copyright__ = "Copyright (c) 2004 Cyril Jaquier"
00026 __license__ = "GPL"
00027 
00028 from template import Template, Templates
00029 
00030 class PrefixTemplate(Template):
00031 
00032     def __init__(self):
00033         Template.__init__(self, Template.TEMPLATE_PREFIX, "<PREFIX>")
00034     
00035 
00036 class PrefixTemplates(Templates):
00037     
00038     def __init__(self):
00039         Templates.__init__(self)
00040         # i60p295 sshd[12365]:
00041         template = PrefixTemplate()
00042         template.setRegex("\S+ \S+\[\d+\]:")
00043         self.templates.append(template)
00044         # [sshd] error: PAM:
00045         template = PrefixTemplate()
00046         template.setRegex("\[\S+\] \S+: \S+:")
00047         self.templates.append(template)
00048         # HOSTNAME courieresmtpd
00049         template = PrefixTemplate()
00050         template.setRegex("\S+ \S+:")
00051         self.templates.append(template)
Generated on Sat May 18 03:01:45 2013 for Fail2Ban by  doxygen 1.6.3