def process(self, device, results, log): ''' process oid ''' log = log device = device temp_sensors = results[1].get('hardDiskTable', {}) relmap = self.relMap() for snmpindex, row in temp_sensors.items(): name = 'HDD_' + str(row.get('hardDiskIndex')) if not name: log.warn('Skipping temperature sensor with no name') continue if 2 != int(row.get('hardDiskPresence')): continue relmap.append( self.objectMap({ 'id': self.prepId(name), 'title': name, 'snmpindex': snmpindex.strip('.'), 'locator': row.get('hardDiskLocation'), 'presence': BMCPRESENCE.get(row.get('hardDiskPresence'), 'unknown'), 'status': BMCSTATUS.get(row.get('hardDiskStatus'), 'unknown') })) return relmap
def process(self, device, results, log): ''' process oid ''' log = log device = device temp_sensors = results[1].get('cpuTable', {}) relmap = self.relMap() for snmpindex, row in temp_sensors.items(): name = 'CPU_' + str(row.get('cpuIndex')) status = int(row.get('cpuStatus')) if status == 5: continue relmap.append( self.objectMap({ 'id': self.prepId(name), 'title': name, 'snmpindex': snmpindex.strip('.'), 'locator': row.get('cpuLocation'), 'manufacturer': row.get('cpuManufacturer'), 'family': row.get('cpuFamily'), 'type': row.get('cpuType'), 'frequency': row.get('cpuClockRate'), 'status': BMCSTATUS.get(row.get('cpuStatus'), 'unknown'), 'coreCount': row.get('cpuCoreCount'), 'threadCount': row.get('cpuThreadCount'), })) return relmap
def process(self, device, results, log): ''' process oid ''' log = log device = device temp_sensors = results[1].get('powerSupplyTable', {}) relmap = self.relMap() for snmpindex, row in temp_sensors.items(): name = 'PS_' + str(row.get('powerSupplyIndex')) if not name: log.warn('Skipping temperature sensor with no name') continue if 2 != int(row.get('powerSupplyPresence')): continue relmap.append( self.objectMap({ 'id': self.prepId(name), 'title': name, 'snmpindex': snmpindex.strip('.'), 'locator': row.get('powerSupplyLocation'), 'presence': BMCPRESENCE.get(row.get('powerSupplyPresence'), 'unknown'), 'status': BMCSTATUS.get(row.get('powerSupplyStatus'), 'unknown'), 'manufacturer': row.get('powerSupplymanufacture'), 'model': row.get('powerSupplyModel'), 'powerRating': str(row.get('powerSupplyPowerRating')) + '(Watts)', 'inputPower': str(row.get('powerSupplyInputPower')) + '(Watts)', })) return relmap
def process(self, device, results, log): ''' process oid ''' log = log device = device temp_sensors = results[1].get('memoryTable', {}) relmap = self.relMap() for snmpindex, row in temp_sensors.items(): bbit = (int(row.get('memoryDimmIndex'))-1) / 8 mbit = (int(row.get('memoryDimmIndex'))-1) % 4 sbit = (int(row.get('memoryDimmIndex'))-1) % 2 name = 'DIMM_' + str(bbit) + str(mbit) + str(sbit) if not name: log.warn('Skipping temperature sensor with no name') continue status = int(row.get('memoryStatus')) if status == 5: continue relmap.append(self.objectMap({ 'id': self.prepId(name), 'title': name, 'snmpindex': snmpindex.strip('.'), 'locator': row.get('memoryLocation'), 'manufacturer': row.get('memoryManufacturer'), 'size': row.get('memorySize'), 'frequency': row.get('memoryClockRate'), 'status': BMCSTATUS.get(row.get('memoryStatus'), 'unknown') })) return relmap