Trees | Indices | Help |
|
---|
|
1 ############################################################################## 2 # 3 # Copyright (C) Zenoss, Inc. 2010, all rights reserved. 4 # 5 # This content is made available according to terms specified in 6 # License.zenoss under the directory where your Zenoss product is installed. 7 # 8 ############################################################################## 9 10 11 __doc__ = """PingDataSource.py 12 13 Defines datasource for zenping 14 """ 15 16 from Globals import InitializeClass 17 from AccessControl import ClassSecurityInfo, Permissions 18 import Products.ZenModel.RRDDataSource as RRDDataSource 19 20 PING_DATAPOINTS = ( 21 'rtt_avg', 22 'rtt_min', 23 'rtt_max', 24 'rtt_losspct', 25 'rtt_stddev', 26 ) 2729 30 PING = 'PING' 31 32 sourcetypes = (PING,) 33 sourcetype = PING 34 35 timeout = 2 36 eventClass = '/Status/Ping' 37 38 cycleTime = 60 39 sampleSize = 1 40 attempts = 2 41 42 _properties = RRDDataSource.RRDDataSource._properties + ( 43 {'id':'cycleTime', 'type':'int', 'mode':'w'}, 44 {'id':'sampleSize', 'type':'int', 'mode':'w'}, 45 {'id':'attempts', 'type':'int', 'mode':'w'}, 46 ) 47 48 security = ClassSecurityInfo() 49 5275 76 InitializeClass(PingDataSource) 7754 if self.sourcetype == self.PING: 55 return "Ping " 56 return RRDDataSource.RRDDataSource.getDescription(self)57 6062 for dp in PING_DATAPOINTS: 63 if self.datapoints._getOb(dp, None) is None: 64 self.manage_addRRDDataPoint(dp)6567 '''validation, etc''' 68 if REQUEST: 69 # ensure default datapoint didn't go away 70 self.addDataPoints() 71 # and eventClass 72 if not REQUEST.form.get('eventClass', None): 73 REQUEST.form['eventClass'] = self.__class__.eventClass 74 return RRDDataSource.RRDDataSource.zmanage_editProperties(self, REQUEST)
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1.1812 on Mon Jul 30 17:11:44 2012 | http://epydoc.sourceforge.net |