Exemplo n.º 1
0
 def __init__(self, **kwargs):
     signal.signal(signal.SIGHUP, self.signalhandler)
     signal.signal(signal.SIGTERM, self.signalhandler)
     self.config = config.pingconf()
     init_generic_logging(stderr=True, read_config=True)
     self._isrunning = 1
     self._looptime = int(self.config.get("checkinterval", 60))
     LOGGER.info("Setting checkinterval=%i", self._looptime)
     self.db = db.db()
     sock = kwargs.get("socket", None)
     self.pinger = megaping.MegaPing(sock)
     self._nrping = int(self.config.get("nrping", 3))
     # To keep status...
     self.netboxmap = {}  # hash netboxid -> netbox
     self.down = []  # list of netboxids down
     self.replies = {}  # hash netboxid -> circbuf
     self.ipToNetboxid = {}
Exemplo n.º 2
0
    def __init__(self, socket=None, foreground=False):
        if not foreground:
            signal.signal(signal.SIGHUP, self.signalhandler)
        signal.signal(signal.SIGTERM, self.signalhandler)
        signal.signal(signal.SIGINT, self.signalhandler)

        self.config = config.pingconf()
        init_generic_logging(stderr=True, read_config=True)
        self._isrunning = 1
        self._looptime = int(self.config.get("checkinterval", 60))
        _logger.info("Setting checkinterval=%i", self._looptime)
        self.db = db.db()
        self.pinger = megaping.MegaPing(socket)
        self._nrping = int(self.config.get("nrping", 3))
        # To keep status...
        self.netboxmap = {}  # hash netboxid -> netbox
        self.down = []  # list of netboxids down
        self.replies = {}  # hash netboxid -> circbuf
        self.ip_to_netboxid = {}
Exemplo n.º 3
0
 def __init__(self, **kwargs):
     signal.signal(signal.SIGHUP, self.signalhandler)
     signal.signal(signal.SIGTERM, self.signalhandler)
     self.config=config.pingconf()
     debug.setDebugLevel(int(self.config.get("debuglevel",5)))
     debug.debug("Setting debuglevel=%s "% self.config.get("debuglevel",5))
     self._isrunning=1
     self._looptime=int(self.config.get("checkinterval",60))
     debug.debug("Setting checkinterval=%i" %self._looptime)
     self._debuglevel=0
     self.db=db.db()
     sock = kwargs.get("socket",None)
     self.pinger=megaping.MegaPing(sock)
     self._nrping = int(self.config.get("nrping" ,3))
     # To keep status...
     self.netboxmap = {} # hash netboxid -> netbox
     self.down = []      # list of netboxids down
     self.replies = {}      # hash netboxid -> circbuf
     self.ipToNetboxid = {}