Ejemplo n.º 1
0
    def fetchPerf(self, device):
        """
        Get performance data for all the monitored processes on a device

        @parameter device: proxy object to the remote computer
        @type device: Device object
        """
        oids = []
        log.debug('In fetchPerf')
        for pid, pidConf in device.pids.items():
            #log.debug('Processing PID: %s , %s'%(pid, InPktsT+ str(pid)))
            #log.debug('Processing PID: %s , %s'%(pid, OutPktsT+ str(pid)))
            #log.debug('Processing PID: %s , %s'%(pid, InDropT+ str(pid)))
            #log.debug('Processing PID: %s , %s'%(pid, OutDropT+ str(pid)))
            #log.debug('Processing PID: %s , %s'%(pid, InOctetsT+ str(pid)))
            #log.debug('Processing PID: %s , %s'%(pid, OutOctetsT+ str(pid)))
            oids.extend([
                InPktsT + str(pid), OutPktsT + str(pid), InDropT + str(pid),
                OutDropT + str(pid), InOctetsT + str(pid),
                OutOctetsT + str(pid)
            ])
        log.debug('%s' % oids)
        if not oids:
            return defer.succeed(([], device))

        d = Chain(device.get, iter(chunk(oids,
                                         device.maxOidsPerRequest))).run()
        d.addCallback(self.storePerfStats, device)
        d.addErrback(self.deviceFailure, device)
        return d
Ejemplo n.º 2
0
    def fetchPerf(self, device):
        """
        Get performance data for all the monitored processes on a device

        @parameter device: proxy object to the remote computer
        @type device: Device object
        """
        oids = []
        for pid, pidConf in device.pids.items():
            oids.extend([CPU + str(pid), MEM + str(pid)])
        if not oids:
            return defer.succeed(([], device))

        d = Chain(device.get, iter(chunk(oids, device.maxOidsPerRequest))).run()
        d.addCallback(self.storePerfStats, device)
        d.addErrback(self.deviceFailure, device)
        return d