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 __doc__="""Monitor 15 16 Base class for all Monitor or Monitor Configuration Classes. This is 17 an abstract class that is used for the devices to monitors 18 relationship which says which monitors monitor which devices. 19 20 $Id: Monitor.py,v 1.5 2004/04/14 22:11:48 edahl Exp $""" 21 22 __version__ = "$Revision: 1.5 $"[11:-2] 23 24 from Globals import InitializeClass 25 26 from ZenModelRM import ZenModelRM 27 from DeviceManagerBase import DeviceManagerBase 28 from RRDView import RRDView 29 from Products.ZenWidgets import messaging 3032 meta_type = 'Monitor' 33 36122 123 124 InitializeClass(Monitor) 12538 from Products.ZenUtils.Utils import unused 39 unused(target) 40 bc = ZenModelRM.breadCrumbs(self) 41 return [bc[0],bc[-1]]4244 """see IManageDevice""" 45 mroot = self.getDmdRoot("Monitors")._getOb(self.monitorRootName) 46 return filter(lambda x: x != self.id, mroot.objectIds())47 4850 """see IManageDevice""" 51 mroot = self.getDmdRoot("Monitors")._getOb(self.monitorRootName) 52 return mroot._getOb(moveTargetName)53 54 5861 """ Provide a method to set performance monitor from any organizer """ 62 if not performanceMonitor: 63 if REQUEST: 64 messaging.IMessageSender(self).sendToBrowser( 65 'Error', 66 'No monitor was selected.', 67 priority=messaging.WARNING 68 ) 69 return self.callZenScreen(REQUEST) 70 if deviceNames is None: 71 if REQUEST: 72 messaging.IMessageSender(self).sendToBrowser( 73 'Error', 74 'No devices were selected.', 75 priority=messaging.WARNING 76 ) 77 return self.callZenScreen(REQUEST) 78 for devname in deviceNames: 79 dev = self.devices._getOb(devname) 80 dev.setPerformanceMonitor(performanceMonitor) 81 if REQUEST: 82 messaging.IMessageSender(self).sendToBrowser( 83 'Monitor Set', 84 'Performance monitor was set to %s.' % performanceMonitor 85 ) 86 if REQUEST.has_key('oneKeyValueSoInstanceIsntEmptyAndEvalToFalse'): 87 return REQUEST['message'] 88 else: 89 return self.callZenScreen(REQUEST)9092 return 'Daemons/%s' % self.id93 98100 """resolve template and graph names to objects 101 and pass to graph performance""" 102 import types 103 if not drange: drange = self.defaultDateRange 104 templates = self.getRRDTemplates() 105 if template: 106 templates = [template] 107 if type(graph) in types.StringTypes: 108 for t in templates: 109 if hasattr(t.graphDefs, graph): 110 template = t 111 graph = getattr(t.graphDefs, graph) 112 break 113 targetpath = self.rrdPath() 114 objpaq = self.primaryAq() 115 return self.performanceGraphUrl(objpaq, targetpath, template, graph, drange)116 117 118 # FIXME: OMG this is such a hack to let thresholds instances be 119 # created against a monitor
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0beta1 on Thu May 7 11:46:25 2009 | http://epydoc.sourceforge.net |