def connectionLost(self, reason): # parse returned data log.debug(self.factory.data) parse = OutputParser(self.factory.data) loss = parse.getPingLoss() gain = parse.getPingGain() host = self.getHost() # threshold checks, messaging, and workflow self.processRules(gain, host=host, loss=loss, gain=gain) # update state information self.updateState() # dump info to log file log.info('State Data: '+str(self.factory.state.data)+'\n') # final cleanup LocalAgentClient.connectionLost(self, reason) ClientMixin.teardown(self)
def connectionLost(self, reason): # parse returned data log.debug(self.factory.data) parse = OutputParser(self.factory.data) loss = parse.getPingLoss() gain = parse.getPingGain() host = self.getHost() # threshold checks, messaging, and workflow self.processRules(gain, host=host, loss=loss, gain=gain) # update state information self.updateState() # dump info to log file log.info('State Data: ' + str(self.factory.state.data) + '\n') # final cleanup LocalAgentClient.connectionLost(self, reason) ClientMixin.teardown(self)
def connectionMade(self): LocalAgentClient.connectionMade(self) ClientMixin.setup(self)