Пример #1
0
 def __call__(self):
     BaseMonitor.__call__(self)
     d = LocalAgentMonitor.__call__(self)
     d.addCallback(self.pingHost)
     d.addErrback(log.error)
     d.addCallback(self.getPingReturn)
     d.addErrback(log.error)
Пример #2
0
 def __call__(self):
     BaseMonitor.__call__(self)
     d = LocalAgentMonitor.__call__(self)
     d.addCallback(self.pingHost)
     d.addErrback(log.error)
     d.addCallback(self.getPingReturn)
     d.addErrback(log.error)
Пример #3
0
 def __call__(self):
     # call the superclass, but only to do the checks; don't connect, since
     # we need to iterate through the ports and connect several times per
     # port
     BaseMonitor.__call__(self, connect=False)
     for port in self.ports:
         d = self.doPing(port)
         d.addCallback(self.getPingReturn, port)
         d.addErrback(log.error)
         d.addCallback(self.protocol.connectionLost, 'completed ping')
Пример #4
0
    def __init__(self, uid, cfg):
        LocalAgentMonitor.__init__(self)
        BaseMonitor.__init__(self, uid, cfg)

        # get the info in order to make the next ping
        self.binary = self.cfg.defaults.binary
        count = '-c %s' % self.cfg.defaults.count
        self.args = [count, self.host]
        port = int(cfg.app.agents.local_command.port)
        self.reactorArgs = ('127.0.0.1', port, self)
Пример #5
0
    def __init__(self, uid, cfg):
        LocalAgentMonitor.__init__(self)
        BaseMonitor.__init__(self, uid, cfg)

        # get the info in order to make the next ping
        self.binary = self.cfg.defaults.binary
        count = "-c %s" % self.cfg.defaults.count
        self.args = [count, self.host]
        port = int(cfg.app.agents.local_command.port)
        self.reactorArgs = ("127.0.0.1", port, self)
Пример #6
0
 def __call__(self):
     HTTPClientFactory.__init__(self, self.page_url,
         method=self.method, agent=self.agent,
         timeout=self.defaults.interval)
     BaseMonitor.__call__(self)
     # this deferred is created above when
     # HTTPClientFactory.__init__() is called.
     d = self.deferred
     d.addCallback(self.logStatus)
     d.addErrback(self.errorHandlerPartialPage)
     d.addErrback(self.errorHandlerTimeout)
Пример #7
0
 def __init__(self, uid, cfg):
     BaseMonitor.__init__(self, uid, cfg)
     self.ports = [int(x.strip()) for x in cfg.check.ports.split(',')]
     count = cfg.check.count or cfg.defaults.count or 1
     self.count = int(count)
     timeout = cfg.check.timeout or cfg.defaults.timeout or 1
     self.timeout = int(timeout)
     self.data = {
         'gain': {},
         'loss': {},
         'percent': {},
         'error': {}}
Пример #8
0
 def __call__(self):
     HTTPClientFactory.__init__(self,
                                self.page_url,
                                method=self.method,
                                agent=self.agent,
                                timeout=self.defaults.interval)
     BaseMonitor.__call__(self)
     # this deferred is created above when
     # HTTPClientFactory.__init__() is called.
     d = self.deferred
     d.addCallback(self.logStatus)
     d.addErrback(self.errorHandlerPartialPage)
     d.addErrback(self.errorHandlerTimeout)
Пример #9
0
 def __init__(self, uid, cfg):
     BaseMonitor.__init__(self, uid, cfg)
     self.page_url = 'http://%s' % self.checkConfig.uri
     # XXX write a getTimeout method
     #timeout = self.checkConfig.timeout
     #timeout = self.defaults.timeout
     self.agent = cfg.user_agent_string
     self.method = 'HEAD'
     self.status = None
     # XXX write a method to get the http port from defaults or service
     # config
     #port = self.checkConfig.http_port
     #import pdb;pdb.set_trace()
     port = int(self.defaults.remote_port)
     self.reactorArgs = (self.host, port, self)
Пример #10
0
 def __init__(self, uid, cfg):
     BaseMonitor.__init__(self, uid, cfg)
     self.page_url = 'http://%s' % self.checkConfig.uri
     # XXX write a getTimeout method
     #timeout = self.checkConfig.timeout
     #timeout = self.defaults.timeout
     self.agent = cfg.user_agent_string
     self.method = 'HEAD'
     self.status = None
     # XXX write a method to get the http port from defaults or service
     # config
     #port = self.checkConfig.http_port
     #import pdb;pdb.set_trace()
     port = int(self.defaults.remote_port)
     self.reactorArgs = (self.host, port, self)
Пример #11
0
 def __init__(self, uid):
     BaseMonitor.__init__(self, uid, cfg)
     self.page_url = ''
     self.text_check = ''
     self.checkdata = self.service.entries.entry(uri=self.uid)
Пример #12
0
 def __init__(self, uid):
     BaseMonitor.__init__(self, uid, cfg)
     self.page_url = ''
     self.text_check = ''
     self.checkdata = self.service.entries.entry(uri=self.uid)