Package DataCollector :: Module DeviceProxy
[hide private]
[frames] | no frames]

Source Code for Module DataCollector.DeviceProxy

 1  ########################################################################### 
 2  # 
 3  # This program is part of Zenoss Core, an open source monitoring platform. 
 4  # Copyright (C) 2008, 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  __doc__ = """DeviceProxy 
15  Memoxing object for SNMP-collecting devices 
16  """ 
17   
18  from twisted.spread import pb 
19 -class DeviceProxy(pb.Copyable, pb.RemoteCopy):
20 """ 21 Provide a cache of configuration information as needed by plugins 22 while running 23 """ 24
25 - def __init__(self):
26 """ 27 Do not use base classes intializers 28 """ 29 pass
30 31
32 - def getSnmpLastCollection(self):
33 """ 34 Return the time of the last collection time 35 36 @return: time of the last collection 37 @rtype: Python DateTime object 38 """ 39 from DateTime import DateTime 40 return DateTime(float(self._snmpLastCollection))
41 42
43 - def getSnmpStatus(self):
44 """ 45 Numeric status of our SNMP collection 46 47 @return: status 48 @rtype: number 49 """ 50 return getattr(self, '_snmpStatus', 0)
51 getSnmpStatusNumber = getSnmpStatus 52 53
54 - def getId(self):
55 """ 56 Return our id 57 58 @return: identification 59 @rtype: string 60 """ 61 return self.id
62 63 pb.setUnjellyableForClass(DeviceProxy, DeviceProxy) 64