def process(self, device, results, log): """ Process the SNMP information returned from a device """ self._log = log log.info('HRSWRunMap Processing %s for device %s', self.name(), device.id) getdata, tabledata = results log.debug("%s tabledata = %s", device.id, tabledata) # get the SNMP process data pidtable = tabledata.get("hrSWRunEntry") if pidtable is None: log.error("Unable to get data for %s from hrSWRunEntry %s" " -- skipping model", HRSWRUNENTRY, device.id) return None log.debug("=== Process information received ===") for p in sorted(pidtable.keys()): log.debug("snmpidx: %s\tprocess: %s" % (p, pidtable[p])) if not pidtable.values(): log.warning("No process information from hrSWRunEntry %s", HRSWRUNENTRY) return None cmds = map(self._extractProcessText, pidtable.values()) cmds = filter(lambda(cmd):cmd, cmds) rm = self.relMap() matchData = device.osProcessClassMatchData rm.extend(map(self.objectMap, buildObjectMapData(matchData, cmds))) return rm
def new_process(self, device, results, log): ''' Model processes according to new style. Handles style introduced by Zenoss 4.2 2013-10-15 RPS. ''' processes = ifilter(bool, imap(get_processText, results.values()[0])) oms = imap( self.objectMap, buildObjectMapData(device.osProcessClassMatchData, processes)) for om in oms: yield om
def new_process(self, device, results, log): ''' Model processes according to new style. Handles style introduced by Zenoss 4.2 2013-10-15 RPS. ''' processes = ifilter(bool, imap(get_processText, results.values()[0])) oms = imap( self.objectMap, buildObjectMapData(device.osProcessClassMatchData, processes)) for om in oms: yield om
def process(self, device, results, log): log.info('Processing %s for device %s', self.name(), device.id) if not results: log.error("Unable to get data for %s -- skipping model", device.id) return None psOutputLines = self._filterLines(results.splitlines()) cmds = map(lambda (s): s.strip(), psOutputLines) cmds = filter(lambda (s): s, cmds) rm = self.relMap() matchData = device.osProcessClassMatchData rm.extend(map(self.objectMap, buildObjectMapData(matchData, cmds))) return rm
def process(self, device, results, log): log.info('Processing %s for device %s', self.name(), device.id) if not results: log.error("Unable to get data for %s -- skipping model", device.id) return None psOutputLines = self._filterLines(results.splitlines()) cmds = map(lambda(s):s.strip(), psOutputLines) cmds = filter(lambda(s):s, cmds) rm = self.relMap() matchData = device.osProcessClassMatchData rm.extend(map(self.objectMap, buildObjectMapData(matchData, cmds))) return rm
def process(self, device, results, log): """collect wmi information from this device""" # TODO: Remove the next two lines when WMI process monitoring is # implemented. log.warn("WMI process discovery is currently not supported") return [ self.relMap(), ] log.info('Collecting process information for device %s', device.id) cmds = map(self._extractProcessText, results['Win32_Process']) cmds = filter(bool, cmds) rm = self.relMap() matchData = device.osProcessClassMatchData rm.extend(map(self.objectMap, buildObjectMapData(matchData, cmds))) return rm