Trees | Indices | Help |
|
---|
|
1 ########################################################################### 2 # 3 # This program is part of Zenoss Core, an open source monitoring platform. 4 # Copyright (C) 2007, Zenoss Inc. 5 # 6 # This program is free software; you can redistribute it and/or modify it 7 # under the terms of the GNU General Public License version 2 as published by 8 # the Free Software Foundation. 9 # 10 # For complete information please visit: http://www.zenoss.com/oss/ 11 # 12 ########################################################################### 13 14 from PerformanceConfig import PerformanceConfig 15 16 from sets import Set 17 from ZODB.POSException import POSError 18 19 20228424 """Return information for snmp collection on all devices.""" 25 if devices: 26 if not isinstance(devices, list): 27 devices = Set([devices]) 28 else: 29 devices = Set(devices) 30 snmp = [] 31 for dev in self.config.devices(): 32 if devices and dev.id not in devices: continue 33 dev = dev.primaryAq() 34 if dev.snmpMonitorDevice(): 35 snmp.append(dev.id) 36 return snmp37 3840 result = [] 41 for d in devices: 42 device = self.dmd.Devices.findDevice(d) 43 if device: 44 config = device.getSnmpOidTargets() 45 if config: 46 result.append(config) 47 return result48 4951 """Return a list of devices that have changed. 52 Takes a list of known devices and the time of last known change. 53 The result is a list of devices that have changed, 54 or not in the list.""" 55 lastChanged = dict(devices) 56 new = Set() 57 all = Set() 58 for dev in self.config.devices(): 59 dev = dev.primaryAq() 60 if dev.snmpMonitorDevice(): 61 all.add(dev.id) 62 if lastChanged.get(dev.id, 0) < float(dev.getLastChange()): 63 new.add(dev.id) 64 deleted = Set(lastChanged.keys()) - all 65 return list(new | deleted)66 70 7173 "Template method helper for PerformanceConfig.pushConfig" 74 return listener.callRemote('updateDeviceConfig', config)75 7678 from Products.ZenModel.RRDDataSource import RRDDataSource 79 if isinstance(object, RRDDataSource): 80 if object.sourcetype != 'SNMP': 81 return 82 83 PerformanceConfig.update(self, object)
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0beta1 on Thu Oct 25 16:28:31 2007 | http://epydoc.sourceforge.net |