Beispiel #1
0
    def checkConfiguration(config):
        checkType('config', (dict, ), config)
        checkIPv4('listenIP', checkAttr('listenIP', config))
        checkPort('listenPort', checkAttr('listenPort', config))

        transport = checkAttr('transport', config)
        checkOptions('transport', transport, ['udp', 'tcp'])
        if (transport != 'udp'):
            raise Exception('Transport(%s) not implemented' % str(transport))
Beispiel #2
0
    def checkConfiguration(config):
        checkType('config', (dict,), config)
        checkIPv4('localIP', checkAttr('localIP', config))
        checkIPv4('serverIP', checkAttr('serverIP', config))
        checkPort('serverPort', checkAttr('serverPort', config))
        
        transport = checkAttr('transport', config)
        checkOptions('transport', transport, ['udp', 'tcp'])
        if(transport != 'udp'): raise Exception('Transport(%s) not implemented' % str(transport))

        checkFloat('templateRefreshTimeout', checkAttr('templateRefreshTimeout', config), 1, 86400)
Beispiel #3
0
    def add(self, exporterId, serverIP, serverPort):
        checkInteger('exporterId', exporterId, 0)
        checkIPv4('serverIP', serverIP)
        checkPort('serverPort', serverPort)
        if (exporterId in self.__exporters):
            raise Exception('Exporter(%d) already exists' % (exporterId))
        exporterConfig = copy.deepcopy(self.__configTemplate)
        exporterConfig.update({'serverIP': serverIP, 'serverPort': serverPort})

        session = Session()
        exporter = Exporter(session)
        exporter.configure(exporterConfig)
        exporter.start()
        self.__exporters[exporterId] = exporter
Beispiel #4
0
    def reconfigure(self, serverIP, serverPort):
        checkIPv4('serverIP', serverIP)
        checkPort('serverPort', serverPort)
        self.__serverIP = serverIP
        self.__serverPort = serverPort

        if(not self.__configured): return
        
        for obsDomId in self.__session.getDomainIds():
            domain = self.__session.getDomain(obsDomId)
            domain.getExporterSequentiation().reset()

        if(not self.__running): return
        self.stop()
        self.start()
Beispiel #5
0
    def checkConfiguration(config):
        checkType('config', (dict, ), config)

        if (('localIP' in config) and (config['localIP'] is not None)):
            checkIPv4('localIP', config['localIP'])

        if (('serverIP' in config) and (config['serverIP'] is not None)):
            checkIPv4('serverIP', config['serverIP'])

        if (('serverPort' in config) and (config['serverPort'] is not None)):
            checkPort('serverPort', config['serverPort'])

        if (('transport' in config) and (config['transport'] is not None)):
            checkOptions('transport', config['transport'], ['udp', 'tcp'])
            if (config['transport'] != 'udp'):
                raise Exception('Transport(%s) not implemented' %
                                str(config['transport']))

        if (('templateRefreshTimeout' in config)
                and (config['templateRefreshTimeout'] is not None)):
            checkFloat('templateRefreshTimeout',
                       config['templateRefreshTimeout'], 1, 86400)
Beispiel #6
0
 def checkConfiguration(config):
     checkType('config', (dict, ), config)
     checkIPv4('listenIP', checkAttr('listenIP', config))
     checkPort('listenPort', checkAttr('listenPort', config))
     checkInteger('numWorkers', checkAttr('numWorkers', config), 1)
Beispiel #7
0
 def checkConfiguration(config):
     checkIPv4('deviceIP', checkAttr('deviceIP', config))
     checkPort('devicePort', checkAttr('devicePort', config))
Beispiel #8
0
 def checkConfiguration(config):
     #Comprobamos configuracion 
     checkType('config', (dict,), config)
     checkIPv4('serverIP', checkAttr('serverIP', config))
     checkPort('serverPort', checkAttr('serverPort', config))