Exemplo n.º 1
0
	def addLogPath(self, path, tail = True):
		if self.containsLogPath(path):
			logSys.error(path + " already exists")
		else:
			self.monitor.watch_file(path, self.callback)
			FileFilter.addLogPath(self, path, tail)
			logSys.info("Added logfile = %s" % path)			
Exemplo n.º 2
0
 def addLogPath(self, path, tail=False):
     if self.containsLogPath(path):
         logSys.error(path + " already exists")
     else:
         self.monitor.watch_file(path, self.callback)
         FileFilter.addLogPath(self, path, tail)
         logSys.info("Added logfile = %s" % path)
Exemplo n.º 3
0
	def delLogPath(self, path):
		if not self.containsLogPath(path):
			logSys.error(path + " is not monitored")
		else:
			self.monitor.stop_watch(path)
			FileFilter.delLogPath(self, path)
			logSys.info("Removed logfile = %s" % path)
Exemplo n.º 4
0
 def delLogPath(self, path):
     if not self.containsLogPath(path):
         logSys.error(path + " is not monitored")
     else:
         self.monitor.stop_watch(path)
         FileFilter.delLogPath(self, path)
         logSys.info("Removed logfile = %s" % path)
Exemplo n.º 5
0
	def __init__(self, jail):
		FileFilter.__init__(self, jail)
		self.__modified = False
		
		self.__lastModTime = dict()
		self.__file404Cnt = dict()
		logSys.debug("Created FilterPoll")
Exemplo n.º 6
0
	def __init__(self, jail):
		FileFilter.__init__(self, jail)
		self.__modified = False
		# Pyinotify watch manager
		self.__monitor = pyinotify.WatchManager()
		self.__watches = dict()
		logSys.debug("Created FilterPyinotify")
Exemplo n.º 7
0
	def __init__(self, jail):
		FileFilter.__init__(self, jail)
		self.__modified = False
		## The time of the last modification of the file.
		self.__lastModTime = dict()
		self.__file404Cnt = dict()
		logSys.debug("Created FilterPoll")
Exemplo n.º 8
0
 def __init__(self, jail):
     FileFilter.__init__(self, jail)
     self.__modified = False
     # Pyinotify watch manager
     self.__monitor = pyinotify.WatchManager()
     self.__watches = dict()
     logSys.debug("Created FilterPyinotify")
Exemplo n.º 9
0
 def __init__(self, jail):
     FileFilter.__init__(self, jail)
     self.__modified = False
     ## The time of the last modification of the file.
     self.__lastModTime = dict()
     self.__file404Cnt = dict()
     logSys.debug("Created FilterPoll")
Exemplo n.º 10
0
 def delLogPath(self, path):
     if not self.containsLogPath(path):
         logSys.error(path + " is not monitored")
     else:
         del self.__lastModTime[path]
         del self.__file404Cnt[path]
         FileFilter.delLogPath(self, path)
         logSys.info("Removed logfile = %s" % path)
Exemplo n.º 11
0
 def addLogPath(self, path, tail=True):
     if self.containsLogPath(path):
         logSys.error(path + " already exists")
     else:
         self.__lastModTime[path] = 0
         self.__file404Cnt[path] = 0
         FileFilter.addLogPath(self, path, tail)
         logSys.info("Added logfile = %s" % path)
Exemplo n.º 12
0
	def addLogPath(self, path, tail=False):
		if self.containsLogPath(path):
			logSys.error(path + " already exists")
		else:
			wd = self.__monitor.add_watch(path, pyinotify.IN_MODIFY)
			self.__watches.update(wd)
			FileFilter.addLogPath(self, path, tail)
			logSys.info("Added logfile = %s" % path)
Exemplo n.º 13
0
    def __init__(self, jail, **kwargs):
        FileFilter.__init__(self, jail, **kwargs)

        #Initially we set the classifier equal to null
        self.__fail_classifiers = list()
        ## The ip siever:
        self.__ip_sieve = IPSieve()
        self._build_available_feature_list()
Exemplo n.º 14
0
    def __init__(self, jail, **kwargs):
        FileFilter.__init__(self, jail, **kwargs)

        #Initially we set the classifier equal to null
        self.__fail_classifiers = list()
        ## The ip siever:
       	self.__ip_sieve = IPSieve()
        self._build_available_feature_list()
Exemplo n.º 15
0
	def delLogPath(self, path):
		if not self.containsLogPath(path):
			logSys.error(path + " is not monitored")
		else:
			del self.__lastModTime[path]
			del self.__file404Cnt[path]
			FileFilter.delLogPath(self, path)
			logSys.info("Removed logfile = %s" % path)
Exemplo n.º 16
0
 def addLogPath(self, path, tail=False):
     if self.containsLogPath(path):
         logSys.error(path + " already exists")
     else:
         wd = self.__monitor.add_watch(path, pyinotify.IN_MODIFY)
         self.__watches.update(wd)
         FileFilter.addLogPath(self, path, tail)
         logSys.info("Added logfile = %s" % path)
Exemplo n.º 17
0
	def addLogPath(self, path, tail = False):
		if self.containsLogPath(path):
			logSys.error(path + " already exists")
		else:
			self.__lastModTime[path] = 0
			self.__file404Cnt[path] = 0
			FileFilter.addLogPath(self, path, tail)
			logSys.info("Added logfile = %s" % path)	
Exemplo n.º 18
0
	def __init__(self, jail):
		FileFilter.__init__(self, jail)
		self.__modified = False
		# Gamin monitor
		self.monitor = gamin.WatchMonitor()
		fd = self.monitor.get_fd()
		flags = fcntl.fcntl(fd, fcntl.F_GETFD)
		fcntl.fcntl(fd, fcntl.F_SETFD, flags|fcntl.FD_CLOEXEC)
		logSys.debug("Created FilterGamin")
Exemplo n.º 19
0
 def __init__(self, jail):
     FileFilter.__init__(self, jail)
     self.__modified = False
     # Gamin monitor
     self.monitor = gamin.WatchMonitor()
     fd = self.monitor.get_fd()
     flags = fcntl.fcntl(fd, fcntl.F_GETFD)
     fcntl.fcntl(fd, fcntl.F_SETFD, flags | fcntl.FD_CLOEXEC)
     logSys.debug("Created FilterGamin")
Exemplo n.º 20
0
	def delLogPath(self, path):
		if not self.containsLogPath(path):
			logSys.error(path + " is not monitored")
		else:
			wdInt = self.__watches[path]
			wd = self.__monitor.rm_watch(wdInt)
			if wd[wdInt]:
				del self.__watches[path]
				FileFilter.delLogPath(self, path)
				logSys.info("Removed logfile = %s" % path)
			else:
				logSys.error("Failed to remove watch on path: %s", path)
Exemplo n.º 21
0
 def delLogPath(self, path):
     if not self.containsLogPath(path):
         logSys.error(path + " is not monitored")
     else:
         wdInt = self.__watches[path]
         wd = self.__monitor.rm_watch(wdInt)
         if wd[wdInt]:
             del self.__watches[path]
             FileFilter.delLogPath(self, path)
             logSys.info("Removed logfile = %s" % path)
         else:
             logSys.error("Failed to remove watch on path: %s", path)
Exemplo n.º 22
0
 def __init__(self, jail):
     FileFilter.__init__(self, jail)
     self.__modified = False
     # Gamin monitor
     self.monitor = gamin.WatchMonitor()
     logSys.debug("Created FilterGamin")
Exemplo n.º 23
0
	def __init__(self, jail):
		FileFilter.__init__(self, jail)
		self.__modified = False
		
		self.monitor = gamin.WatchMonitor()
		logSys.debug("Created FilterGamin")