You can subscribe to this list here.
2007 |
Jan
|
Feb
(65) |
Mar
(276) |
Apr
(544) |
May
(638) |
Jun
(225) |
Jul
(204) |
Aug
(294) |
Sep
(532) |
Oct
(506) |
Nov
(324) |
Dec
(359) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(208) |
Feb
(225) |
Mar
(248) |
Apr
(388) |
May
(222) |
Jun
(47) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <sv...@ze...> - 2007-04-17 19:39:17
|
Author: ecn Date: 2007-04-17 15:39:16 -0400 (Tue, 17 Apr 2007) New Revision: 4720 Added: trunk/Products/ZenWin/WinCollector.py Modified: trunk/Products/ZenHub/services/EventService.py trunk/Products/ZenWin/wmiclient.py trunk/Products/ZenWin/zeneventlog.py trunk/Products/ZenWin/zenwin.py Log: * hoist common code WinCollector * get zeneventlog limping along Modified: trunk/Products/ZenHub/services/EventService.py =================================================================== --- trunk/Products/ZenHub/services/EventService.py 2007-04-17 18:06:16 UTC (rev 4719) +++ trunk/Products/ZenHub/services/EventService.py 2007-04-17 19:39:16 UTC (rev 4720) @@ -26,3 +26,5 @@ def remote_getDevicePingIssues(self, *args, **kwargs): return self.zem.getDevicePingIssues(*args, **kwargs) + def remote_getWmiConnIssues(self): + return self.zem.getWmiConnIssues() Added: trunk/Products/ZenWin/WinCollector.py Modified: trunk/Products/ZenWin/wmiclient.py =================================================================== --- trunk/Products/ZenWin/wmiclient.py 2007-04-17 18:06:16 UTC (rev 4719) +++ trunk/Products/ZenWin/wmiclient.py 2007-04-17 19:39:16 UTC (rev 4720) @@ -105,7 +105,7 @@ self.event = event - def __call__(self, timeout=0): + def nextEvent(self, timeout=0): """Poll for next event wait timeout for response return value. """ return self.event.NextEvent(timeout).Properties_("TargetInstance").Value Modified: trunk/Products/ZenWin/zeneventlog.py =================================================================== --- trunk/Products/ZenWin/zeneventlog.py 2007-04-17 18:06:16 UTC (rev 4719) +++ trunk/Products/ZenWin/zeneventlog.py 2007-04-17 19:39:16 UTC (rev 4720) @@ -1,6 +1,6 @@ ################################################################# # -# Copyright (c) 2006 Zenoss, Inc. All rights reserved. +# Copyright (c) 2007 Zenoss, Inc. All rights reserved. # ################################################################# @@ -9,65 +9,40 @@ import gc import time import logging -import xmlrpclib -import socket +from socket import getfqdn import pywintypes import pythoncom import wmiclient -from zenutils.Utils import basicAuthUrl -from zenutils.StatusMonitor import StatusMonitor -from StatusTest import StatusTest -from WinServiceTest import WinServiceTest -from WinEventlog import WinEventlog +import Globals +from WinCollector import WinCollector as Base +from Products.ZenEvents.ZenEventClasses import Heartbeat -class zeneventlog(StatusMonitor): +TIMEOUT_CODE = 2147209215 +RPC_ERROR_CODE = 2147023170 - manager = socket.getfqdn() - - startevt = {'eventClass':'/App/Start', 'device':socket.getfqdn(), - 'summary': 'zeneventlog started', - 'component':'zeneventlog', - 'severity':0} - stopevt = {'eventClass':'/App/Stop', 'device':socket.getfqdn(), - 'summary': 'zeneventlog stopped', - 'component':'zeneventlog', - 'severity': 4} - heartbeat = {'eventClass':'/Heartbeat', 'device':socket.getfqdn(), - 'component': 'zeneventlog'} +class zeneventlog(Base): + agent = "zeneventlog" - def __init__(self, config=""): - StatusMonitor.__init__(self, config=config) - self.configCycleInterval = 20 + def __init__(self): + Base.__init__(self) self.devices = {} - - def validConfig(self): - """let getConfig know if we have a working config or not""" - return len(self.devices) - - - def loadConfig(self): + def updateDevices(self, devices): """get the config data from server""" - if time.time()-self.configTime > self.configCycleInterval*60: - self.log.info("reloading configuration") - url = basicAuthUrl(self.username, self.password,self.winurl) - server = xmlrpclib.Server(url) - polltime, devices = server.getDeviceWinInfo(0, True) - for name,user,passwd,sev,url in devices: - try: - if self.checkwmi(name): - self.log.info('wmi prob on %s skipping', name) - continue - if self.devices.has_key(name): continue - self.devices[name] = self.getWatcher(name,user,passwd,sev) - except pywintypes.com_error: - self.log.exception("wmi connect failed on %s", name) - self.configTime = time.time() + for name,user,passwd,sev,url in devices: + try: + if name not in self.wmiprobs: + self.log.info('wmi prob on %s skipping', name) + continue + if name in self.devices: + continue + self.devices[name] = self.getWatcher(name,user,passwd,sev) + except pywintypes.com_error: + self.log.exception("wmi connect failed on %s", name) - def getWatcher(self, name, user, passwd, minSeverity): """Setup WMI connection to monitored server. """ @@ -87,14 +62,15 @@ pythoncom.PumpWaitingMessages() baddevices = [] for name, w in self.devices.items(): - if self.checkwmi(name): continue + if name in self.wmiprobs: + continue self.log.debug("polling %s", name) try: while 1: - lrec = w() - if not lrec.Message: continue - evt = self.mkevt(name, lrec) - self.zem.sendEvent(evt) + lrec = w.nextEvent() + if not lrec.Message: + continue + self.sendEvent(self.mkevt(name, lrec)) except pywintypes.com_error, e: msg = "wmi connection failed: " code,txt,info,param = e @@ -102,18 +78,20 @@ if info: wcode, source, descr, hfile, hcont, scode = info scode = abs(scode) - if descr: wmsg = descr.strip() + if descr: + wmsg = descr.strip() msg += wmsg - if scode == 2147209215: # timeout + if scode == TIMEOUT_CODE: self.log.debug("timeout %s", name) - elif scode == 2147023170: # rpc error + elif scode == RPC_ERROR_CODE: self.log.warn("%s %s", name, msg) else: self.log.warn("%s %s", name, msg) self.log.warn("removing %s", name) baddevices.append(name) - for name in baddevices: del self.devices[name] - self.zem.sendEvent(self.heartbeat) + for name in baddevices: + del self.devices[name] + self.sendEvent(self.heartbeat) gc.collect() self.log.info("Com InterfaceCount: %d", pythoncom._GetInterfaceCount()) self.log.info("Com GatewayCount: %d", pythoncom._GetGatewayCount()) @@ -127,20 +105,19 @@ evtkey = "%s_%s" % (lrec.SourceName, lrec.EventCode) sev = 4 - lrec.EventType #lower severity by one level if sev < 1: sev = 1 - evt = {} - evt['device'] = name - evt['eventClassKey'] = evtkey - evt['eventGroup'] = lrec.LogFile - evt['component'] = lrec.SourceName - evt['ntevid'] = lrec.EventCode - evt['summary'] = lrec.Message.strip() - evt['agent'] = "zeneventlog" - evt['severity'] = sev - evt['manager'] = self.manager + evt = dict(device=name, + eventClassKey=evtkey, + eventGroup=lrec.LogFile, + component=lrec.SourceName, + ntevid=lrec.EventCode, + summary=lrec.Message.strip(), + agent="zeneventlog", + severity=sev, + manager=self.manager) self.log.debug("device:%s msg:'%s'", name, lrec.Message) return evt if __name__ == "__main__": zw = zeneventlog() - zw.mainLoop() + zw.run() Modified: trunk/Products/ZenWin/zenwin.py =================================================================== --- trunk/Products/ZenWin/zenwin.py 2007-04-17 18:06:16 UTC (rev 4719) +++ trunk/Products/ZenWin/zenwin.py 2007-04-17 19:39:16 UTC (rev 4720) @@ -13,9 +13,9 @@ from twisted.internet import reactor, defer import Globals -from Products.ZenHub.PBDaemon import FakeRemote, PBDaemon as Base +from WinCollector import WinCollector as Base from Products.ZenHub.services import WmiConfig -from Products.ZenEvents.ZenEventClasses import Heartbeat +from Products.ZenEvents.ZenEventClasses import Heartbeat, Status_Wmi_Conn from StatusTest import StatusTest from WinServiceTest import WinServiceTest @@ -24,26 +24,13 @@ class zenwin(Base): agent = "zenwin" - cycleInterval = 60. - configCycleInterval = 20. - initialServices = ['EventService', 'WmiConfig'] - - heartbeat = dict(eventClass=Heartbeat, - device=getfqdn(), - component='zenwin') - def __init__(self): + Base.__init__(self) self.wmiprobs = [] self.devices = [] - Base.__init__(self) - def validConfig(self): - """let getConfig know if we have a working config or not""" - return self.devices - - def getPlugins(self): """Build a list of plugin instances for a device. """ @@ -55,7 +42,7 @@ self.stop() raise SystemExit("No plugins found for list: '%s'" % ( ",".join(self.options.load))) - pnames = [ p.name for p in plugins ] + pnames = [p.name for p in plugins] return plugins @@ -102,8 +89,8 @@ problems, self.cycleInterval*2) for r in running[:]: - evt = { 'eventClass': '/Status/Wmi/Conn', - 'agent': 'zenwin', + evt = { 'eventClass': Status_Wmi_Conn, + 'agent': self.agent, 'severity':'4', 'summary': 'Timeout failure during WMI check', 'device': r.name, @@ -122,26 +109,18 @@ self.log.info("ref: %d", sys.gettotalrefcount()) - def scanCycle(self, ignored=None): - now = time.time() - try: - self.processLoop() - except Exception, ex: - self.log.exception("Error processing main loop") - delay = time.time() - now - reactor.callLater(min(0, self.cycleInterval - delay), self.scanCycle) - - + def updateDevices(self, devices): + devices = [] + for n,u,p,s in devices: + if self.options.device and self.options.device != n: continue + st = StatusTest(self, n, u, p, s, self.options.debug) + st.setPlugins(self.getPlugins()) + devices.append(st) + if devices: + self.devices = devices + def buildOptions(self): Base.buildOptions(self) - self.parser.add_option('-d', '--device', - dest='device', - default=None, - help="single device to collect") - self.parser.add_option('--debug', - dest='debug', - default=False, - help="turn on additional debugging") self.parser.add_option('--threads', dest='threads', default=4, @@ -155,49 +134,7 @@ help="plugin name to load can " "have more than one") - def configService(self): - return self.services.get('WmiConfig', FakeRemote()) - - def updateConfig(self, cfg): - for a, v in cfg.monitor: - current = getattr(self, a, None) - if current is not None and current != v: - self.log.info("Setting %s to %r", a, v); - setattr(self, a, v) - self.heartbeat['timeout'] = self.cycleInterval*3 - self.log.debug('Device data: %r', (cfg.devices,)) - devices = [] - for n,u,p,s in cfg.devices: - if self.options.device and self.options.device != n: continue - st = StatusTest(self, n, u, p, s, self.options.debug) - st.setPlugins(self.getPlugins()) - devices.append(st) - if devices: - self.devices = devices - - - def error(self, why): - why.printTraceback() - self.log.error(why.getErrorMessage()) - - - def reconfigure(self): - try: - d = self.configService().callRemote('getConfig') - d.addCallbacks(self.updateConfig, self.error) - except Exception, ex: - self.log.exception("Error fetching config") - return defer.fail(ex) - reactor.callLater(self.configCycleInterval, self.reconfigure) - return d - - - def connected(self): - d = self.reconfigure() - d.addCallback(self.scanCycle) - - if __name__ == "__main__": zw = zenwin() zw.run() |
From: <sv...@ze...> - 2007-04-17 18:06:18
|
Author: edahl Date: 2007-04-17 14:06:16 -0400 (Tue, 17 Apr 2007) New Revision: 4719 Modified: trunk/Products/ZenEvents/MySqlEventManager.py Log: * fix masking issue with mysql connections Modified: trunk/Products/ZenEvents/MySqlEventManager.py =================================================================== --- trunk/Products/ZenEvents/MySqlEventManager.py 2007-04-17 17:20:31 UTC (rev 4718) +++ trunk/Products/ZenEvents/MySqlEventManager.py 2007-04-17 18:06:16 UTC (rev 4719) @@ -68,8 +68,8 @@ sevsum = self.checkCache(select) if sevsum: return sevsum zem = self.dmd.ZenEventManager + conn = zem.connect() try: - conn = zem.connect() curs = conn.cursor() curs.execute(select) sumdata = {} |
From: <sv...@ze...> - 2007-04-17 17:20:35
|
Author: marc Date: 2007-04-17 13:20:31 -0400 (Tue, 17 Apr 2007) New Revision: 4718 Modified: trunk/Products/ZenModel/migrate/menus.py Log: Updated menu item orderings Modified: trunk/Products/ZenModel/migrate/menus.py =================================================================== --- trunk/Products/ZenModel/migrate/menus.py 2007-04-17 17:08:51 UTC (rev 4717) +++ trunk/Products/ZenModel/migrate/menus.py 2007-04-17 17:20:31 UTC (rev 4718) @@ -21,7 +21,7 @@ menuxml = os.path.join(zenhome, "Products/ZenModel/data/menus.xml") ZenPackItems = dict( - ordering=50.0, + ordering=0.0, id= 'addToZenPack', description='Add to ZenPack...', action= 'dialog_addToZenPack', @@ -76,19 +76,19 @@ 'IpInterface', 'OSProcess'], description='PerfConf', - ordering=0.0, + ordering=1.0, id='objRRDTemplate', permissions=('Change Device',) ), dict(action='../objRRDTemplate', allowed_classes=['OperatingSystem'], description='PerfConf', - ordering=0.0, + ordering=1.0, id='objRRDTemplate_os', permissions=('Change Device',) ), dict( - ordering=0.0, + ordering=2.0, id= 'addToZenPack', description='Add to ZenPack...', action= 'dialog_addToZenPack', @@ -107,7 +107,7 @@ 'OSProcess', 'IpRouteEntry'], description='Lock', - ordering=0.0, + ordering=3.0, id='lockObject', isdialog=True, permissions=('Change Device',) @@ -121,7 +121,7 @@ 'OSProcess', 'IpRouteEntry'], description='Delete', - ordering=0.0, + ordering=4.0, id='deleteObject', isdialog=True, permissions=('Change Device',) @@ -129,7 +129,7 @@ dict(action='editStatusMonitorConf', allowed_classes=['StatusMonitorConf'], description='Edit', - ordering=0.0, + ordering=5.0, id='editStatusMonitorConf', permissions=('Manage DMD',) ), @@ -137,56 +137,56 @@ allowed_classes=['DeviceClass', 'Device'], description='Push Changes to Collectors', - ordering=0.0, + ordering=6.0, id='pushConfig', permissions=('Change Device',) ), dict(action='../pushConfig', allowed_classes=['OperatingSystem'], description='Push Changes to Collectors', - ordering=0.0, + ordering=7.0, id='pushConfig_os', permissions=('Change Device',) ), dict(action='deviceCustomEdit', allowed_classes=['Device'], description='Custom', - ordering=0.0, + ordering=8.0, id='deviceCustomEdit', permissions=('View',) ), dict(action='../deviceCustomEdit', allowed_classes=['OperatingSystem'], description='Custom', - ordering=0.0, + ordering=9.0, id='deviceCustomEdit_os', permissions=('View',) ), dict(action='eventClassInstEdit', allowed_classes=['EventClassInst'], description='Edit', - ordering=0.0, + ordering=10.0, id='eventClassInstEdit', permissions=('Manage DMD',) ), dict(action='ipServiceClassEdit', allowed_classes=['IpServiceClass'], description='Edit', - ordering=0.0, + ordering=11.0, id='ipServiceClassEdit', permissions=('Manage DMD',) ), dict(action='deviceManagement', allowed_classes=['Device'], description='Manage', - ordering=0.0, + ordering=12.0, id='deviceManagement', permissions=('Change Device',) ), dict(action='../deviceManagement', allowed_classes=['OperatingSystem'], description='Manage', - ordering=0.0, + ordering=13.0, id='deviceManagement_os', permissions=('Change Device',) ), @@ -197,70 +197,70 @@ dict(action='serviceOrganizerManage', allowed_classes=['ServiceOrganizer'], description='Manage', - ordering=0.0, + ordering=14.0, id='serviceOrganizerManage', permissions=('Manage DMD',) ), dict(action='osProcessOrganizerManage', allowed_classes=['OSProcessOrganizer'], description='Manage', - ordering=0.0, + ordering=15.0, id='osProcessOrganizerManage', permissions=('Manage DMD',) ), dict(action='ipServiceClassManage', allowed_classes=['IpServiceClass'], description='Manage', - ordering=0.0, + ordering=16.0, id='ipServiceClassManage', permissions=('Manage DMD',) ), dict(action='editManufacturer', allowed_classes=['Manufacturer'], description='Edit', - ordering=0.0, + ordering=17.0, id='editManufacturer', permissions=('Manage DMD',) ), dict(action='osProcessManage', allowed_classes=['OSProcess'], description='Manage', - ordering=0.0, + ordering=18.0, id='osProcessManage', permissions=('Manage DMD',) ), dict(action='serviceClassManage', allowed_classes=['ServiceClass'], description='Manage', - ordering=0.0, + ordering=19.0, id='serviceClassManage', permissions=('Manage DMD',) ), dict(action='editPerformanceConf', allowed_classes=['PerformanceConf'], description='Edit', - ordering=0.0, + ordering=20.0, id='editPerformanceConf', permissions=('Manage DMD',) ), dict(action='ipServiceManage', allowed_classes=['IpService'], description='Manage', - ordering=0.0, + ordering=21.0, id='ipServiceManage', permissions=('Manage DMD',) ), dict(action='editProductClass', allowed_classes=['ProductClass'], description='Edit', - ordering=0.0, + ordering=22.0, id='editProductClass', permissions=('Manage DMD',) ), dict(action='osProcessClassManage', allowed_classes=['OSProcessClass'], description='Manage', - ordering=0.0, + ordering=23.0, id='osProcessClassManage', permissions=('Manage DMD',) ), @@ -271,56 +271,56 @@ 'DeviceClass', 'System'], description='Manage', - ordering=0.0, + ordering=24.0, id='deviceOrganizerManage', permissions=('Manage DMD',) ), dict(action='editDevice', allowed_classes=['Device'], description='Edit', - ordering=0.0, + ordering=25.0, id='editDevice', permissions=('Change Device',) ), dict(action='../editDevice', allowed_classes=['OperatingSystem'], description='Edit', - ordering=0.0, + ordering=26.0, id='editDevice_os', permissions=('Change Device',) ), dict(action='winServiceManage', allowed_classes=['WinService'], description='Manage', - ordering=0.0, + ordering=27.0, id='winServiceManage', permissions=('Manage DMD',) ), dict(action='eventClassInstSequence', allowed_classes=['EventClassInst'], description='Sequence', - ordering=0.0, + ordering=28.0, id='eventClassInstSequence', permissions=('View',) ), dict(action='osProcessClassEdit', allowed_classes=['OSProcessClass'], description='Edit', - ordering=0.0, + ordering=29.0, id='osProcessClassEdit', permissions=('Manage DMD',) ), dict(action='performanceTemplates', allowed_classes=['DeviceClass'], description='All Performance Templates', - ordering=98.0, + ordering=30.0, id='performanceTemplates', permissions=('View Device',) ), dict(action='perfConfig', allowed_classes=['DeviceClass'], description='Perf Config', - ordering=99.0, + ordering=31.0, id='perfConfig', permissions=('Change Device',) ), @@ -338,21 +338,21 @@ 'EventClassInst', 'EventClass'], description='zProperties', - ordering=0.0, + ordering=32.0, id='zPropertyEdit', permissions=('View',) ), dict(action='../zPropertyEdit', allowed_classes=['OperatingSystem'], description='zProperties', - ordering=0.0, + ordering=33.0, id='zPropertyEdit_os', permissions=('View',) ), dict(action='serviceClassEdit', allowed_classes=['ServiceClass'], description='Edit', - ordering=0.0, + ordering=34.0, id='serviceClassEdit', permissions=('Manage DMD',) ), @@ -360,7 +360,7 @@ 'Organizer_list': [ ZenPackItems, dict( - ordering=0.0, + ordering=1.0, id= 'addOrganizer', description='Add New Organizer...', action= 'dialog_addOrganizer', @@ -368,7 +368,7 @@ isdialog= True, ), dict( - ordering=1.0, + ordering=2.0, id= 'moveOrganizer', description='Move Organizers...', action= 'dialog_moveOrganizer', @@ -376,7 +376,7 @@ isdialog= True, ), dict( - ordering=2.0, + ordering=3.0, id= 'removeOrganizers', description='Delete Organizers...', action= 'dialog_removeOrganizer', @@ -387,21 +387,21 @@ 'Service_list': [ ZenPackItems, dict( - ordering=0.0, + ordering=1.0, id= 'addServiceClass', description='Add Service...', action= 'dialog_addServiceClass', permissions=('Manage DMD',), isdialog= True), dict( - ordering=0.0, + ordering=2.0, id= 'removeServiceClasses', description='Delete Services...', action= 'dialog_removeServiceClasses', permissions=('Manage DMD',), isdialog= True), dict( - ordering=0.0, + ordering=3.0, id= 'moveServiceClasses', description='Move Services...', action= 'dialog_moveServiceClasses', @@ -411,21 +411,21 @@ 'OSProcess_list': [ ZenPackItems, dict( - ordering=0.0, + ordering=1.0, id= 'addOSProcess', description='Add Process...', action= 'dialog_addOSProcess', permissions=('Manage DMD',), isdialog= True), dict( - ordering=0.0, + ordering=2.0, id= 'removeOSProcesses', description='Delete Processes...', action= 'dialog_removeOSProcesses', permissions=('Manage DMD',), isdialog= True), dict( - ordering=0.0, + ordering=3.0, id= 'moveOSProcesses', description='Move Processes...', action= 'dialog_moveOSProcesses', @@ -435,14 +435,14 @@ 'Manufacturer_list': [ ZenPackItems, dict( - ordering=0.0, + ordering=1.0, id= 'addManufacturer', description='Add Manufacturer...', action= 'dialog_addManufacturer', permissions=('Manage DMD',), isdialog= True), dict( - ordering=0.0, + ordering=2.0, id= 'removeManufacturers', description='Delete Manufacturers...', action= 'dialog_removeManufacturers', @@ -452,21 +452,21 @@ 'Mib_list': [ ZenPackItems, dict( - ordering=0.0, + ordering=1.0, id= 'addMibModule', description='Add Mib...', action= 'dialog_addMibModule', permissions=('Manage DMD',), isdialog= True), dict( - ordering=0.0, + ordering=2.0, id= 'removeMibModules', description='Delete Mibs...', action= 'dialog_removeMibModules', permissions=('Manage DMD',), isdialog= True), dict( - ordering=0.0, + ordering=3.0, id= 'moveMibModules', description='Move Mibs...', action= 'dialog_moveMibModules', @@ -476,21 +476,21 @@ 'EventMapping_list': [ ZenPackItems, dict( - ordering=0.0, + ordering=1.0, id= 'addInstance', description='Add Mapping...', action= 'dialog_createInstance', permissions=('Manage DMD',), isdialog= True), dict( - ordering=1.0, + ordering=2.0, id= 'removeInstances', description='Delete Mappings...', action= 'dialog_removeInstances', permissions=('Manage DMD',), isdialog= True), dict( - ordering=2.0, + ordering=3.0, id= 'moveInstances', description='Move Mappings...', action= 'dialog_moveInstances', @@ -499,14 +499,14 @@ ], 'PerformanceMonitor_list': [ dict( - ordering=0.0, + ordering=1.0, id= 'addPMonitor', description='Add Monitor...', action= 'dialog_addMonitor', permissions=('Manage DMD',), isdialog= True), dict( - ordering=0.0, + ordering=2.0, id= 'removePMonitors', description='Delete Monitors...', action= 'dialog_removeMonitors', @@ -515,14 +515,14 @@ ], 'StatusMonitor_list': [ dict( - ordering=0.0, + ordering=1.0, id= 'addSMonitor', description='Add Monitor...', action= 'dialog_addMonitor', permissions=('Manage DMD',), isdialog= True), dict( - ordering=0.0, + ordering=2.0, id= 'removeSMonitors', description='Delete Monitors...', action= 'dialog_removeMonitors', @@ -533,7 +533,7 @@ # 'ReportClass_list': [ZenPackItems], 'ZenPack_list':[ dict( - ordering=0.0, + ordering=1.0, id= 'addZenPack', description='Create a new ZenPack...', action= 'dialog_addZenPack', @@ -541,7 +541,7 @@ isdialog=True, ), dict( - ordering=1.0, + ordering=2.0, id= 'removeZenPack', description='Delete ZenPack', permissions=('Manage DMD',), @@ -551,7 +551,7 @@ ], 'Device_list':[ dict( - ordering=0.0, + ordering=1.0, id= 'moveclass', description='Move to Class...', action= 'dialog_moveDevices', @@ -559,7 +559,7 @@ isdialog=True ), dict( - ordering=0.0, + ordering=2.0, id= 'setGroups', description='Set Groups...', action= 'dialog_setGroups', @@ -567,7 +567,7 @@ isdialog=True ), dict( - ordering=0.0, + ordering=3.0, id= 'setSystems', description='Set Systems...', action= 'dialog_setSystems', @@ -575,7 +575,7 @@ isdialog=True ), dict( - ordering=0.0, + ordering=4.0, id= 'setLocation', description='Set Location...', action= 'dialog_setLocation', @@ -583,7 +583,7 @@ isdialog=True ), dict( - ordering=0.0, + ordering=5.0, id= 'removeDevices', description='Delete devices...', action= 'dialog_removeDevices', @@ -591,7 +591,7 @@ isdialog=True ), dict( - ordering=0.0, + ordering=6.0, id= 'lockDevices', description='Lock devices...', action= 'dialog_lockDevices', @@ -601,7 +601,7 @@ ], 'IpInterface':[ dict( - ordering=0.0, + ordering=1.0, id= 'addIpInterface', description='Add IpInterface...', action= 'dialog_addIpInterface', @@ -609,7 +609,7 @@ permissions=('Change Device',), ), dict( - ordering=0.0, + ordering=2.0, id= 'deleteIpInterfaces', description='Delete IpInterfaces...', action= 'dialog_deleteIpInterfaces', @@ -617,7 +617,7 @@ permissions=('Change Device',), ), dict( - ordering=0.0, + ordering=3.0, id= 'lockIpInterfaces', description='Lock IpInterfaces...', action= 'dialog_lockIpInterfaces', @@ -627,7 +627,7 @@ ], 'OSProcess':[ dict( - ordering=0.0, + ordering=1.0, id= 'addOSProcess', description='Add OSProcess...', action= 'dialog_addOSProcess', @@ -635,7 +635,7 @@ permissions=('Change Device',), ), dict( - ordering=0.0, + ordering=2.0, id= 'deleteOSProcesses', description='Delete OSProcesses...', action= 'dialog_deleteOSProcesses', @@ -643,7 +643,7 @@ permissions=('Change Device',), ), dict( - ordering=0.0, + ordering=3.0, id= 'lockOSProcesses', description='Lock OSProcesses...', action= 'dialog_lockOSProcesses', @@ -653,7 +653,7 @@ ], 'FileSystem':[ dict( - ordering=0.0, + ordering=1.0, id= 'addFileSystem', description='Add File System...', action= 'dialog_addFileSystem', @@ -661,7 +661,7 @@ permissions=('Change Device',), ), dict( - ordering=0.0, + ordering=2.0, id= 'deleteFileSystems', description='Delete FileSystems...', action= 'dialog_deleteFileSystems', @@ -669,7 +669,7 @@ permissions=('Change Device',), ), dict( - ordering=0.0, + ordering=3.0, id= 'lockFileSystems', description='Lock FileSystems...', action= 'dialog_lockFileSystems', @@ -679,7 +679,7 @@ ], 'IpRouteEntry':[ dict( - ordering=0.0, + ordering=1.0, id= 'addIpRouteEntry', description='Add IpRouteEntry...', action= 'dialog_addIpRouteEntry', @@ -687,7 +687,7 @@ permissions=('Change Device',), ), dict( - ordering=0.0, + ordering=2.0, id= 'deleteIpRouteEntries', description='Delete IpRouteEntries...', action= 'dialog_deleteIpRouteEntries', @@ -695,7 +695,7 @@ permissions=('Change Device',), ), dict( - ordering=0.0, + ordering=3.0, id= 'lockIpRouteEntries', description='Lock IpRouteEntries...', action= 'dialog_lockIpRouteEntries', @@ -705,7 +705,7 @@ ], 'IpService':[ dict( - ordering=0.0, + ordering=1.0, id= 'addIpService', description='Add IpService...', action= 'dialog_addIpService', @@ -713,7 +713,7 @@ permissions=('Change Device',), ), dict( - ordering=0.0, + ordering=2.0, id= 'deleteIpServices', description='Delete IpServices...', action= 'dialog_deleteIpServices', @@ -721,7 +721,7 @@ permissions=('Change Device',), ), dict( - ordering=0.0, + ordering=3.0, id= 'lockIpServices', description='Lock IpServices...', action= 'dialog_lockIpServices', @@ -731,7 +731,7 @@ ], 'WinService':[ dict( - ordering=0.0, + ordering=1.0, id= 'addWinService', description='Add WinService...', action= 'dialog_addWinService', @@ -739,7 +739,7 @@ permissions=('Change Device',), ), dict( - ordering=0.0, + ordering=2.0, id= 'deleteWinServices', description='Delete WinServices...', action= 'dialog_deleteWinServices', @@ -747,7 +747,7 @@ permissions=('Change Device',), ), dict( - ordering=0.0, + ordering=3.0, id= 'lockWinServices', description='Lock WinServices...', action= 'dialog_lockWinServices', @@ -757,7 +757,7 @@ ], 'Event_list':[ dict( - ordering=0.0, + ordering=1.0, id= 'acknowledgeEvents', description='Acknowledge Events', action= ('javascript:submitFormToMethod(' @@ -765,7 +765,7 @@ permissions=('Manage DMD',) ), dict( - ordering=0.0, + ordering=2.0, id= 'historifyEvents', description='Move Events to History...', action= 'dialog_moveEventsToHistory', @@ -773,14 +773,14 @@ isdialog= True ), dict( - ordering=0.0, + ordering=3.0, id= 'exportAllEvents', description='Download as CSV', action= 'javascript:goExport()', permissions=('View',) ), dict( - ordering=0.0, + ordering=4.0, id= 'createEventMap', description='Map Events to Class...', action= 'dialog_createEventMap', @@ -790,7 +790,7 @@ ], 'HistoryEvent_list':[ dict( - ordering=0.0, + ordering=1.0, id= 'createEventMap', description='Map Events to Class...', action= 'dialog_createEventMap', @@ -798,14 +798,14 @@ isdialog= True ), dict( - ordering=0.0, + ordering=2.0, id= 'exportAllEvents', description='Download as CSV', action= 'javascript:goExport()', permissions=('View',) ), dict( - ordering=0.0, + ordering=3.0, id= 'undeleteHistoryEvents', description='Undelete Events...', action= 'dialog_undeleteHistoryEvents', @@ -815,7 +815,7 @@ ], 'DataSource_list':[ dict( - ordering=0.0, + ordering=1.0, id = 'addDataSource', description = 'Add DataSource...', action = 'dialog_addDataSource', @@ -823,7 +823,7 @@ isdialog=True, ), dict( - ordering=1.0, + ordering=2.0, id = 'deleteDataSource', description = 'Delete DataSource...', action = 'dialog_deleteDataSource', @@ -833,7 +833,7 @@ ], 'DataPoint_list':[ dict( - ordering=0.0, + ordering=1.0, id = 'addDataPoint', description = 'Add DataPoint...', action = 'dialog_addDataPoint', @@ -841,7 +841,7 @@ isdialog=True, ), dict( - ordering=1.0, + ordering=2.0, id = 'deleteDataPoint', description = 'Delete DataPoint...', action = 'dialog_deleteDataPoint', @@ -851,7 +851,7 @@ ], 'Threshold_list':[ dict( - ordering=0.0, + ordering=1.0, id = 'addThreshold', description = 'Add Threshold...', action = 'dialog_addThreshold', @@ -859,7 +859,7 @@ isdialog=True, ), dict( - ordering=1.0, + ordering=2.0, id = 'deleteThreshold', description = 'Delete Threshold...', action = 'dialog_deleteThreshold', @@ -869,7 +869,7 @@ ], 'Graph_list':[ dict( - ordering=0.0, + ordering=1.0, id = 'addGraph', description = 'Add Graph...', action = 'dialog_addGraph', @@ -877,7 +877,7 @@ isdialog=True, ), dict( - ordering=1.0, + ordering=2.0, id = 'deleteGraph', description = 'Delete Graph...', action = 'dialog_deleteGraph', @@ -885,7 +885,7 @@ isdialog=True, ), dict( - ordering=2.0, + ordering=3.0, id = 'resequenceGraphs', description = 'Re-sequence Graphs', action = 'manage_resequenceRRDGraphs', @@ -903,7 +903,7 @@ permissions=('Change Device',), ), dict( - ordering=0.0, + ordering=2.0, id= 'addNetwork', description='Add Network...', action= 'dialog_addNetwork', @@ -913,7 +913,7 @@ ], 'IpAddresses':[ dict( - ordering=0.0, + ordering=1.0, id= 'deleteIpAddress', description='Delete IpAddresses...', action= 'dialog_deleteIpAddress', @@ -923,7 +923,7 @@ ], 'Manage': [ dict( - ordering=0.0, + ordering=1.0, id= 'changeClass', description='Change Class', action= 'dialog_changeClass', @@ -932,7 +932,7 @@ allowed_classes = ('Device','OperatingSystem'), ), dict( - ordering=0.0, + ordering=2.0, id= 'modelDevice', description='Model Device', action= 'collectDevice', @@ -940,7 +940,7 @@ allowed_classes = ('Device','OperatingSystem'), ), dict( - ordering=0.0, + ordering=3.0, id= 'resetIp', description='Reset IP', action= 'dialog_resetIp', @@ -949,7 +949,7 @@ allowed_classes = ('Device','OperatingSystem'), ), dict( - ordering=0.0, + ordering=4.0, id= 'resetCommunity', description='Reset Community', action= 'manage_snmpCommunity', @@ -957,7 +957,7 @@ allowed_classes = ('Device','OperatingSystem'), ), dict( - ordering=0.0, + ordering=5.0, id= 'renameDevice', description='Rename Device', action= 'dialog_renameDevice', @@ -966,7 +966,7 @@ allowed_classes = ('Device','OperatingSystem'), ), dict( - ordering=0.0, + ordering=6.0, id= 'deleteDevice', description='Delete Device', action= 'dialog_deleteDevice', @@ -977,7 +977,7 @@ ], 'Add': [ dict( - ordering=0.0, + ordering=1.0, id= 'addIpInterface', description='Add IpInterface...', action= 'dialog_addIpInterface', @@ -986,7 +986,7 @@ allowed_classes = ('OperatingSystem',), ), dict( - ordering=0.0, + ordering=2.0, id= 'addOSProcess', description='Add OSProcess...', action= 'dialog_addOSProcess', @@ -995,7 +995,7 @@ allowed_classes = ('OperatingSystem',), ), dict( - ordering=0.0, + ordering=3.0, id= 'addFileSystem', description='Add File System...', action= 'dialog_addFileSystem', @@ -1004,7 +1004,7 @@ allowed_classes = ('OperatingSystem',), ), dict( - ordering=0.0, + ordering=4.0, id= 'addIpRouteEntry', description='Add Route...', action= 'dialog_addIpRouteEntry', @@ -1013,7 +1013,7 @@ allowed_classes = ('OperatingSystem',), ), dict( - ordering=0.0, + ordering=5.0, id= 'addIpService', description='Add IpService...', action= 'dialog_addIpService', @@ -1022,7 +1022,7 @@ allowed_classes = ('OperatingSystem',), ), dict( - ordering=0.0, + ordering=6.0, id= 'addWinService', description='Add WinService...', action= 'dialog_addWinService', @@ -1031,7 +1031,7 @@ allowed_classes = ('OperatingSystem',), ), dict( - ordering=0.0, + ordering=7.0, id= 'addReportOrganizer', description='Add Report Organizer...', action= 'dialog_addReportClass', @@ -1040,7 +1040,7 @@ allowed_classes = ('ReportClass',), ), dict( - ordering=0.0, + ordering=8.0, id= 'addReport', description='Add Report...', action= 'dialog_addReport', @@ -1054,7 +1054,7 @@ dmd.Networks.buildMenus( {'Actions':[ dict( - ordering=0.0, + ordering=1.0, id= 'discover', description= 'Discover Devices', action= 'discoverDevices', |
From: <sv...@ze...> - 2007-04-17 17:08:51
|
Author: jstevens Date: 2007-04-17 13:08:51 -0400 (Tue, 17 Apr 2007) New Revision: 4717 Modified: trunk/Products/ZenModel/migrate/menus.py Log: Added Add Network item. Also ordered a few menus. Modified: trunk/Products/ZenModel/migrate/menus.py =================================================================== --- trunk/Products/ZenModel/migrate/menus.py 2007-04-17 15:57:13 UTC (rev 4716) +++ trunk/Products/ZenModel/migrate/menus.py 2007-04-17 17:08:51 UTC (rev 4717) @@ -368,7 +368,7 @@ isdialog= True, ), dict( - ordering=0.0, + ordering=1.0, id= 'moveOrganizer', description='Move Organizers...', action= 'dialog_moveOrganizer', @@ -376,7 +376,7 @@ isdialog= True, ), dict( - ordering=0.0, + ordering=2.0, id= 'removeOrganizers', description='Delete Organizers...', action= 'dialog_removeOrganizer', @@ -483,14 +483,14 @@ permissions=('Manage DMD',), isdialog= True), dict( - ordering=0.0, + ordering=1.0, id= 'removeInstances', description='Delete Mappings...', action= 'dialog_removeInstances', permissions=('Manage DMD',), isdialog= True), dict( - ordering=0.0, + ordering=2.0, id= 'moveInstances', description='Move Mappings...', action= 'dialog_moveInstances', @@ -541,7 +541,7 @@ isdialog=True, ), dict( - ordering=0.0, + ordering=1.0, id= 'removeZenPack', description='Delete ZenPack', permissions=('Manage DMD',), @@ -815,6 +815,7 @@ ], 'DataSource_list':[ dict( + ordering=0.0, id = 'addDataSource', description = 'Add DataSource...', action = 'dialog_addDataSource', @@ -822,6 +823,7 @@ isdialog=True, ), dict( + ordering=1.0, id = 'deleteDataSource', description = 'Delete DataSource...', action = 'dialog_deleteDataSource', @@ -831,6 +833,7 @@ ], 'DataPoint_list':[ dict( + ordering=0.0, id = 'addDataPoint', description = 'Add DataPoint...', action = 'dialog_addDataPoint', @@ -838,6 +841,7 @@ isdialog=True, ), dict( + ordering=1.0, id = 'deleteDataPoint', description = 'Delete DataPoint...', action = 'dialog_deleteDataPoint', @@ -847,6 +851,7 @@ ], 'Threshold_list':[ dict( + ordering=0.0, id = 'addThreshold', description = 'Add Threshold...', action = 'dialog_addThreshold', @@ -854,6 +859,7 @@ isdialog=True, ), dict( + ordering=1.0, id = 'deleteThreshold', description = 'Delete Threshold...', action = 'dialog_deleteThreshold', @@ -863,6 +869,7 @@ ], 'Graph_list':[ dict( + ordering=0.0, id = 'addGraph', description = 'Add Graph...', action = 'dialog_addGraph', @@ -870,6 +877,7 @@ isdialog=True, ), dict( + ordering=1.0, id = 'deleteGraph', description = 'Delete Graph...', action = 'dialog_deleteGraph', @@ -877,6 +885,7 @@ isdialog=True, ), dict( + ordering=2.0, id = 'resequenceGraphs', description = 'Re-sequence Graphs', action = 'manage_resequenceRRDGraphs', @@ -886,13 +895,21 @@ ], 'Subnetworks':[ dict( - ordering=0.0, + ordering=1.0, id= 'deleteNetwork', description='Delete Networks...', action= 'dialog_deleteNetwork', isdialog=True, permissions=('Change Device',), ), + dict( + ordering=0.0, + id= 'addNetwork', + description='Add Network...', + action= 'dialog_addNetwork', + isdialog=True, + permissions=('Change Device',), + ), ], 'IpAddresses':[ dict( |
From: <sv...@ze...> - 2007-04-17 16:04:53
|
Author: marc Date: 2007-04-17 11:33:46 -0400 (Tue, 17 Apr 2007) New Revision: 4714 Modified: trunk/Products/ZenModel/ZenMenuItem.py trunk/Products/ZenModel/ZenMenuable.py trunk/Products/ZenWidgets/skins/zenui/zenuimacros.pt Log: #1214 * Now ordering on attribute, needs to set order for existing menu items Modified: trunk/Products/ZenModel/ZenMenuItem.py =================================================================== --- trunk/Products/ZenModel/ZenMenuItem.py 2007-04-17 15:18:58 UTC (rev 4713) +++ trunk/Products/ZenModel/ZenMenuItem.py 2007-04-17 15:33:46 UTC (rev 4714) @@ -52,9 +52,9 @@ def __cmp__(self, other): if other and other.ordering: - return cmp(self.ordering, other.ordering) + return cmp(other.ordering, self.ordering) else: - return cmp(self.ordering, 0.0) + return cmp(0.0, self.ordering) InitializeClass(ZenMenuItem) Modified: trunk/Products/ZenModel/ZenMenuable.py =================================================================== --- trunk/Products/ZenModel/ZenMenuable.py 2007-04-17 15:18:58 UTC (rev 4713) +++ trunk/Products/ZenModel/ZenMenuable.py 2007-04-17 15:33:46 UTC (rev 4714) @@ -116,7 +116,7 @@ return None elif len(menus.keys())==1: return menus.values()[0] - else: + else: return menus InitializeClass(ZenMenuable) Modified: trunk/Products/ZenWidgets/skins/zenui/zenuimacros.pt =================================================================== --- trunk/Products/ZenWidgets/skins/zenui/zenuimacros.pt 2007-04-17 15:18:58 UTC (rev 4713) +++ trunk/Products/ZenWidgets/skins/zenui/zenuimacros.pt 2007-04-17 15:33:46 UTC (rev 4714) @@ -21,11 +21,16 @@ </tal:block> </a> </li> -<div class="submenu" tal:attributes="id string:${menu}_submenu"> +<div class="submenu" + tal:define="items python:here.getMenus(menu, here)" + tal:attributes="id string:${menu}_submenu"> + <tal:block tal:condition="items"> + <tal:block tal:define="dummy items/sort"/> + </tal:block> <div class="menu_top_rounded"> </div> <div class="menu_bottom"> </div> <ul> - <li tal:repeat="item python:here.getMenus(menu, here)"> + <li tal:repeat="item items"> <a tal:define="mypath python:test(item.action.startswith('javascript'), item.action, '%s/%s' % (basepath, item.action)); @@ -34,6 +39,8 @@ mypath)" tal:attributes="href actionpath" tal:content="item/description">description</a> + <tal:block tal:condition="python:getattr(request, 'showMenuOrder', None)" + tal:content="item/ordering"/> </li> </ul> </div> |
From: <sv...@ze...> - 2007-04-17 15:57:23
|
Author: ecn Date: 2007-04-17 11:57:13 -0400 (Tue, 17 Apr 2007) New Revision: 4716 Added: trunk/Products/ZenWin/wmiclient.py Modified: trunk/Products/ZenWin/ trunk/Products/ZenWin/zenwin.py Log: * runs from $ZENHOME Property changes on: trunk/Products/ZenWin ___________________________________________________________________ Name: svn:ignore + *.pyc Copied: trunk/Products/ZenWin/wmiclient.py (from rev 4715, trunk/zenwin/wmiclient.py) Modified: trunk/Products/ZenWin/zenwin.py =================================================================== --- trunk/Products/ZenWin/zenwin.py 2007-04-17 15:49:53 UTC (rev 4715) +++ trunk/Products/ZenWin/zenwin.py 2007-04-17 15:57:13 UTC (rev 4716) @@ -30,7 +30,7 @@ initialServices = ['EventService', 'WmiConfig'] heartbeat = dict(eventClass=Heartbeat, - device=socket.getfqdn(), + device=getfqdn(), component='zenwin') def __init__(self): |
From: <sv...@ze...> - 2007-04-17 15:50:06
|
Author: jstevens Date: 2007-04-17 11:49:53 -0400 (Tue, 17 Apr 2007) New Revision: 4715 Removed: trunk/Products/ZenStatus/zencommand.py Log: fixes #975 * Should be exclusively using ZenRRD/zencommand.py instead. Deleted: trunk/Products/ZenStatus/zencommand.py |
From: <sv...@ze...> - 2007-04-17 15:21:32
|
Author: ecn Date: 2007-04-17 11:18:58 -0400 (Tue, 17 Apr 2007) New Revision: 4713 Modified: trunk/bin/zenwin Log: * make executable... hope svn picks that up Modified: trunk/bin/zenwin =================================================================== --- trunk/bin/zenwin 2007-04-17 15:16:44 UTC (rev 4712) +++ trunk/bin/zenwin 2007-04-17 15:18:58 UTC (rev 4713) @@ -6,6 +6,5 @@ PRGNAME=zenwin.py CFGFILE=$CFGDIR/zenwin.conf PIDFILE=$VARDIR/$PRGNAME.pid - generic "$@" |
From: <sv...@ze...> - 2007-04-17 15:16:45
|
Author: ecn Date: 2007-04-17 11:16:44 -0400 (Tue, 17 Apr 2007) New Revision: 4712 Modified: trunk/Products/ZenWin/zenwin.py Log: * mostly convert zenwin to a PBDeamon Modified: trunk/Products/ZenWin/zenwin.py =================================================================== --- trunk/Products/ZenWin/zenwin.py 2007-04-17 15:15:46 UTC (rev 4711) +++ trunk/Products/ZenWin/zenwin.py 2007-04-17 15:16:44 UTC (rev 4712) @@ -1,75 +1,54 @@ ################################################################# # -# Copyright (c) 2006 Zenoss, Inc. All rights reserved. +# Copyright (c) 2007 Zenoss, Inc. All rights reserved. # ################################################################# import sys import os -import gc import time -import logging -import xmlrpclib -import socket -import pywintypes +from socket import getfqdn import pythoncom -from zenutils.Utils import basicAuthUrl -from zenutils.StatusMonitor import StatusMonitor -from zenutils.SendEvent import SendEvent +from twisted.internet import reactor, defer + +import Globals +from Products.ZenHub.PBDaemon import FakeRemote, PBDaemon as Base +from Products.ZenHub.services import WmiConfig +from Products.ZenEvents.ZenEventClasses import Heartbeat + from StatusTest import StatusTest from WinServiceTest import WinServiceTest from WinEventlog import WinEventlog -class zenwin(StatusMonitor): - - startevt = {'eventClass':'/App/Start', 'device':socket.getfqdn(), - 'summary': 'zenwin started', - 'component':'zenwin', - 'severity':0} - stopevt = {'eventClass':'/App/Stop', 'device':socket.getfqdn(), - 'summary': 'zenwin stopped', - 'component':'zenwin', - 'severity': 4} - heartbeat = {'eventClass':'/Heartbeat', 'device':socket.getfqdn(), - 'component': 'zenwin'} - +class zenwin(Base): - def __init__(self, config=""): - StatusMonitor.__init__(self, config=config) + agent = "zenwin" + cycleInterval = 60. + configCycleInterval = 20. + + initialServices = ['EventService', 'WmiConfig'] + + heartbeat = dict(eventClass=Heartbeat, + device=socket.getfqdn(), + component='zenwin') + + def __init__(self): self.wmiprobs = [] - self.configCycleInterval = 20 self.devices = [] + Base.__init__(self) - def validConfig(self): """let getConfig know if we have a working config or not""" return self.devices - def loadConfig(self): - """get the config data from server""" - if time.time()-self.configTime > self.configCycleInterval*60: - self.log.info("reloading configuration") - url = basicAuthUrl(self.username, self.password,self.winurl) - server = xmlrpclib.Server(url, encoding='iso-8859-1') - devices = [] - for n,u,p,s in server.getWinServices(): - if self.options.device and self.options.device != n: continue - st = StatusTest(self.zem,n,u,p,s, self.options.debug) - st.setPlugins(self.getPlugins()) - devices.append(st) - if devices: self.devices = devices - self.configTime = time.time() - - def getPlugins(self): """Build a list of plugin instances for a device. """ plugins = (WinServiceTest(), WinEventlog()) if not self.options.load: - #self.options.load = ['WinServiceTest', 'WinEventlog'] self.options.load = ['WinServiceTest'] plugins = [p for p in plugins if p.name in self.options.load] if not plugins: @@ -77,32 +56,35 @@ raise SystemExit("No plugins found for list: '%s'" % ( ",".join(self.options.load))) pnames = [ p.name for p in plugins ] - #self.log.debug("loaded plugins: %s", ",".join(pnames)) return plugins - def processLoop(self): + def processLoop(self, unused=None): """Run WMI queries in two stages ExecQuery in semi-sync mode. then process results later (when they have already returned) """ self.count = 0 if self.options.debug: - # in debug mode open wmi connections sequentially (ie no threads) + # in debug mode open wmi connections sequentially (ie no threads) for srec in self.devices: - if not self.checkwmi(srec.name): srec.run() - else: self.log.warn("skipping %s no wmi connection",srec.name) + if srec.name not in self.wmiprobs: + srec.run() + else: + self.log.warn("skipping %s no wmi connection",srec.name) else: - # connect to WMI service in separate thread if no ping problem detected. + # connect to WMI service in separate thread if no + # ping problem detected. devices = self.devices[:] running = [] now = time.time() while devices or running: - #self.log.debug("devices:%d runing:%d",len(devices),len(running)) + self.log.debug("devices:%d runing:%d", + len(devices), len(running)) running = [ srec for srec in running if not srec.done() ] needthreads = self.options.threads - len(running) while devices and needthreads > 0: srec = devices.pop() - if not self.checkwmi(srec.name): + if srec.name not in self.wmiprobs: srec.start() self.count += 1 self.log.debug("count = %d", self.count) @@ -110,14 +92,15 @@ needthreads -= 1 else: self.log.warn("skipping %s no wmi connection",srec.name) - if needthreads == 0 or not devices: time.sleep(1) - if time.time() - now > self.cycle*2: + if needthreads == 0 or not devices: + time.sleep(1) + if time.time() - now > self.cycleInterval*2: problems = ', '.join([r.name for r in running]) self.log.warning('%d servers (%s) still collecting ' 'after %d seconds, giving up', len(running), problems, - self.cycle*2) + self.cycleInterval*2) for r in running[:]: evt = { 'eventClass': '/Status/Wmi/Conn', 'agent': 'zenwin', @@ -125,30 +108,96 @@ 'summary': 'Timeout failure during WMI check', 'device': r.name, 'component' : ''} - self.zem.sendEvent(evt) + self.sendEvent(evt) running.remove(r) break - + #[ srec.close() for srec in self.devices ] sys.stdout.flush() - self.zem.sendEvent(self.heartbeat) - gc.collect() + self.sendEvent(self.heartbeat) + import gc; gc.collect() self.log.info("Com InterfaceCount: %d", pythoncom._GetInterfaceCount()) self.log.info("Com GatewayCount: %d", pythoncom._GetGatewayCount()) if hasattr(sys, "gettotalrefcount"): self.log.info("ref: %d", sys.gettotalrefcount()) + def scanCycle(self, ignored=None): + now = time.time() + try: + self.processLoop() + except Exception, ex: + self.log.exception("Error processing main loop") + delay = time.time() - now + reactor.callLater(min(0, self.cycleInterval - delay), self.scanCycle) + + def buildOptions(self): - StatusMonitor.buildOptions(self) - self.parser.add_option('--threads', dest='threads', - default=4, type="int", - help="number of parallel threads during collection") - self.parser.add_option("-l", "--load", action="append", - dest="load", default=[], - help="plugin name to load can have more than one") + Base.buildOptions(self) + self.parser.add_option('-d', '--device', + dest='device', + default=None, + help="single device to collect") + self.parser.add_option('--debug', + dest='debug', + default=False, + help="turn on additional debugging") + self.parser.add_option('--threads', + dest='threads', + default=4, + type="int", + help="number of parallel threads " + "during collection") + self.parser.add_option("-l", "--load", + action="append", + dest="load", + default=[], + help="plugin name to load can " + "have more than one") + def configService(self): + return self.services.get('WmiConfig', FakeRemote()) + + def updateConfig(self, cfg): + for a, v in cfg.monitor: + current = getattr(self, a, None) + if current is not None and current != v: + self.log.info("Setting %s to %r", a, v); + setattr(self, a, v) + self.heartbeat['timeout'] = self.cycleInterval*3 + self.log.debug('Device data: %r', (cfg.devices,)) + devices = [] + for n,u,p,s in cfg.devices: + if self.options.device and self.options.device != n: continue + st = StatusTest(self, n, u, p, s, self.options.debug) + st.setPlugins(self.getPlugins()) + devices.append(st) + if devices: + self.devices = devices + + + def error(self, why): + why.printTraceback() + self.log.error(why.getErrorMessage()) + + + def reconfigure(self): + try: + d = self.configService().callRemote('getConfig') + d.addCallbacks(self.updateConfig, self.error) + except Exception, ex: + self.log.exception("Error fetching config") + return defer.fail(ex) + reactor.callLater(self.configCycleInterval, self.reconfigure) + return d + + + def connected(self): + d = self.reconfigure() + d.addCallback(self.scanCycle) + + if __name__ == "__main__": zw = zenwin() - zw.mainLoop() + zw.run() |
From: <sv...@ze...> - 2007-04-17 15:15:46
|
Author: ecn Date: 2007-04-17 11:15:46 -0400 (Tue, 17 Apr 2007) New Revision: 4711 Added: trunk/bin/zenwin Log: * and then there were 14. Added: trunk/bin/zenwin |
From: <sv...@ze...> - 2007-04-17 15:15:22
|
Author: ecn Date: 2007-04-17 11:14:55 -0400 (Tue, 17 Apr 2007) New Revision: 4710 Added: trunk/Products/ZenHub/services/WmiConfig.py trunk/Products/ZenWin/ trunk/Products/ZenWin/StatusTest.py trunk/Products/ZenWin/WinEventlog.py trunk/Products/ZenWin/WinServiceTest.py trunk/Products/ZenWin/zeneventlog.py trunk/Products/ZenWin/zenwin.py trunk/Products/ZenWin/zenwinmodeler.py Log: * prepare for zenwin conversion to enlightenment Added: trunk/Products/ZenHub/services/WmiConfig.py Copied: trunk/Products/ZenWin/StatusTest.py (from rev 4709, trunk/zenwin/StatusTest.py) Copied: trunk/Products/ZenWin/WinEventlog.py (from rev 4709, trunk/zenwin/WinEventlog.py) Copied: trunk/Products/ZenWin/WinServiceTest.py (from rev 4709, trunk/zenwin/WinServiceTest.py) Copied: trunk/Products/ZenWin/zeneventlog.py (from rev 4709, trunk/zenwin/zeneventlog.py) Copied: trunk/Products/ZenWin/zenwin.py (from rev 4709, trunk/zenwin/zenwin.py) Copied: trunk/Products/ZenWin/zenwinmodeler.py (from rev 4709, trunk/zenwin/zenwinmodeler.py) |
From: <sv...@ze...> - 2007-04-17 14:15:14
|
Author: chris Date: 2007-04-17 10:14:48 -0400 (Tue, 17 Apr 2007) New Revision: 4709 Added: trunk/Products/ZenEvents/MessageProcessing.py trunk/Products/ZenEvents/zenmail.py Log: added. this is the first cut at slurping in email messages and turning them into events Added: trunk/Products/ZenEvents/MessageProcessing.py Added: trunk/Products/ZenEvents/zenmail.py |
From: <sv...@ze...> - 2007-04-17 12:46:30
|
Author: ecn Date: 2007-04-17 08:46:30 -0400 (Tue, 17 Apr 2007) New Revision: 4708 Modified: trunk/Products/ZenHub/PBDaemon.py Log: * fix connection callback Modified: trunk/Products/ZenHub/PBDaemon.py =================================================================== --- trunk/Products/ZenHub/PBDaemon.py 2007-04-17 12:07:53 UTC (rev 4707) +++ trunk/Products/ZenHub/PBDaemon.py 2007-04-17 12:46:30 UTC (rev 4708) @@ -90,7 +90,6 @@ def connect(self): - d = defer.Deferred() factory = ReconnectingPBClientFactory() self.log.debug("Connecting to %s", self.options.hubHost) reactor.connectTCP(self.options.hubHost, self.options.hubPort, factory) @@ -100,7 +99,7 @@ c = credentials.UsernamePassword(username, password) factory.gotPerspective = self.gotPerspective factory.startLogin(c) - return d + return self.initialConnect def eventService(self): @@ -163,8 +162,7 @@ def errback(error): self.log.error('Unable to connect to zenhub: \n%s' % error) self.stop() - d.addCallback(callback) - d.addErrback(errback) + d.addCallbacks(callback, errback) reactor.run() self.log.info('%s shutting down' % self.name) |
From: <sv...@ze...> - 2007-04-17 12:08:11
|
Author: jstevens Date: 2007-04-17 08:07:53 -0400 (Tue, 17 Apr 2007) New Revision: 4707 Modified: trunk/Products/ZenRRD/RRDDaemon.py Log: Threshold and ThresholdManager moved into their own file. Modified: trunk/Products/ZenRRD/RRDDaemon.py =================================================================== --- trunk/Products/ZenRRD/RRDDaemon.py 2007-04-17 01:41:16 UTC (rev 4706) +++ trunk/Products/ZenRRD/RRDDaemon.py 2007-04-17 12:07:53 UTC (rev 4707) @@ -25,6 +25,7 @@ from twisted.python import failure from Products.ZenHub.PBDaemon import FakeRemote, PBDaemon as Base +from Products.ZenRRD.ThresholdManager import ThresholdManager, Threshold BAD_SEVERITY=Event.Warning @@ -35,86 +36,8 @@ COMMON_EVENT_INFO = { 'manager': socket.getfqdn(), } - -class Threshold: - 'Hold threshold config and send events based on the current value' - count = 0 - label = '' - minimum = None - maximum = None - eventClass = Perf_Snmp - severity = Event.Info - escalateCount = 0 - - def __init__(self, label, minimum, maximum, eventClass, severity, count): - self.label = label - self.update(minimum, maximum, eventClass, severity, count) - - - def update(self, minimum, maximum, eventClass, severity, count): - self.minimum = minimum - self.maximum = maximum - self.eventClass = eventClass - self.severity = severity - self.escalateCount = count - - - def check(self, device, cname, oid, value, eventCb): - 'Check the value for min/max thresholds, and post events' - if value is None: - return - thresh = None - if self.maximum is not None and value > self.maximum: - thresh = self.maximum - how = 'exceeded' - if self.minimum is not None and value < self.minimum: - thresh = self.minimum - how = 'not met' - if thresh is not None: - self.count += 1 - severity = self.severity - if self.escalateCount and self.count >= self.escalateCount: - severity += 1 - summary = '%s %s threshold of %s %s: current value %.2f' % ( - device, self.label, thresh, how, float(value)) - eventCb(device=device, - summary=summary, - eventClass=self.eventClass, - eventKey=oid, - component=cname, - severity=severity) - else: - if self.count: - summary = '%s %s threshold restored current value: %.2f' % ( - device, self.label, value) - eventCb(device=device, - summary=summary, - eventClass=self.eventClass, - eventKey=oid, - component=cname, - severity=Event.Clear) - self.count = 0 - -class ThresholdManager: - "manage a collection of thresholds" - def __init__(self): - self.thresholds = {} - def update(self, config): - before = self.thresholds - self.thresholds = {} - for label, minimum, maximum, eventClass, severity, count in config: - t = before.get(label, None) - if t: - t.update(minimum, maximum, eventClass, severity, count) - else: - t = Threshold(label, minimum, maximum, eventClass, severity, count) - self.thresholds[label] = t - - def __iter__(self): - return iter(self.thresholds.values()) - class RRDDaemon(Base): 'Holds the code common to performance gathering daemons.' |
From: <sv...@ze...> - 2007-04-17 01:41:15
|
Author: ecn Date: 2007-04-16 21:41:16 -0400 (Mon, 16 Apr 2007) New Revision: 4706 Modified: trunk/Products/ZenHub/services/StatusConfig.py Log: * fix unknown reference to globabl in PBDaemon * do a very simple change notification scheme for ZenStatus Modified: trunk/Products/ZenHub/services/StatusConfig.py =================================================================== --- trunk/Products/ZenHub/services/StatusConfig.py 2007-04-17 01:38:25 UTC (rev 4705) +++ trunk/Products/ZenHub/services/StatusConfig.py 2007-04-17 01:41:16 UTC (rev 4706) @@ -57,8 +57,6 @@ def update(self, object): if not self.listeners: return - return - # the PerformanceConf changed from Products.ZenModel.PerformanceConf import PerformanceConf if isinstance(object, PerformanceConf): @@ -69,30 +67,9 @@ ] # listener.callRemote('updateDeviceList', devices) - # device has been changed: - if isinstance(object, Device): - self.notifyAll(object) - return - - # somethinge else... mark the devices as out-of-date - from Products.ZenModel.DeviceClass import DeviceClass + for listener in self.listeners: + listener.callRemote('notifyConfigChanged') - import transaction - while object: - # walk up until you hit an organizer or a device - if isinstance(object, DeviceClass): - for device in object.getSubDevices(): - device.setLastChange() - transaction.commit() - break - - if isinstance(object, Device): - object.setLastChange() - transaction.commit() - break - - object = aq_parent(object) - def deleted(self, obj): for listener in self.listeners: if isinstance(obj, Device): |
From: <sv...@ze...> - 2007-04-17 01:38:25
|
Author: ecn Date: 2007-04-16 21:38:25 -0400 (Mon, 16 Apr 2007) New Revision: 4705 Modified: trunk/Products/ZenHub/PBDaemon.py trunk/Products/ZenRRD/RRDDaemon.py trunk/Products/ZenStatus/zenstatus.py trunk/Products/ZenUtils/Driver.py Log: * fix unknown reference to globabl in PBDaemon * do a very simple change notification scheme for ZenStatus Modified: trunk/Products/ZenHub/PBDaemon.py =================================================================== --- trunk/Products/ZenHub/PBDaemon.py 2007-04-16 22:36:58 UTC (rev 4704) +++ trunk/Products/ZenHub/PBDaemon.py 2007-04-17 01:38:25 UTC (rev 4705) @@ -53,6 +53,13 @@ DEFAULT_HUB_PASSWORD = 'zenoss' DEFAULT_HUB_MONITOR = getfqdn() +class HubDown(Exception): pass + +class FakeRemote: + def callRemote(self, name, *args): + from twisted.internet import defer + return defer.fail(HubDown("ZenHub is down")) + class PBDaemon(ZenDaemon, pb.Referenceable): name = 'pbdaemon' @@ -67,6 +74,7 @@ self.stopEvent = stopEvent.copy() for evt in self.startEvent, self.stopEvent: evt.update(dict(component=self.name, device=getfqdn())) + self.initialConnect = defer.Deferred() def gotPerspective(self, perspective): @@ -75,11 +83,9 @@ self.log.warning("Reconnected to ZenHub") self.perspective = perspective d2 = self.getInitialServices() - if d.called: - self.log.debug('adding stop as getInitialServices errback') - d2.addErrback(lambda e: self.stop()) - else: + if self.initialConnect: self.log.debug('chaining getInitialServices with d2') + self.initialConnect, d = None, self.initialConnect d2.chainDeferred(d) @@ -98,7 +104,7 @@ def eventService(self): - return self.services['EventService'] + return self.services.get('EventService', FakeRemote()) def getService(self, serviceName, serviceListeningInterface=None): Modified: trunk/Products/ZenRRD/RRDDaemon.py =================================================================== --- trunk/Products/ZenRRD/RRDDaemon.py 2007-04-16 22:36:58 UTC (rev 4704) +++ trunk/Products/ZenRRD/RRDDaemon.py 2007-04-17 01:38:25 UTC (rev 4705) @@ -24,7 +24,7 @@ from twisted.internet import reactor, defer from twisted.python import failure -from Products.ZenHub.PBDaemon import PBDaemon as Base +from Products.ZenHub.PBDaemon import FakeRemote, PBDaemon as Base BAD_SEVERITY=Event.Warning @@ -135,9 +135,7 @@ device=socket.getfqdn())) def getDevicePingIssues(self): - if 'EventService' in self.services: - return self.services['EventService'].callRemote('getDevicePingIssues') - return defer.fail("Not connected to ZenHub") + return self.eventService().callRemote('getDevicePingIssues') def remote_setPropertyItems(self, items): self.log.debug("Async update of collection properties") @@ -195,8 +193,5 @@ self.stop() def model(self): - class Fake: - def callRemote(self, *args, **kwargs): - return defer.fail("No connection to ZenHub") - return self.services.get(self.initialServices[-1], Fake()) + return self.services.get(self.initialServices[-1], FakeRemote()) Modified: trunk/Products/ZenStatus/zenstatus.py =================================================================== --- trunk/Products/ZenStatus/zenstatus.py 2007-04-16 22:36:58 UTC (rev 4704) +++ trunk/Products/ZenStatus/zenstatus.py 2007-04-17 01:38:25 UTC (rev 4705) @@ -11,7 +11,7 @@ from twisted.internet import reactor, defer import Globals # make zope imports work -from Products.ZenHub.PBDaemon import PBDaemon as Base +from Products.ZenHub.PBDaemon import FakeRemote, PBDaemon as Base from Products.ZenUtils.Driver import drive, driveLater from Products.ZenStatus.ZenTcpClient import ZenTcpClient from Products.ZenEvents.ZenEventClasses import Heartbeat @@ -80,6 +80,7 @@ cycleInterval = 300 configCycleInterval = 20 properties = ('cycleInterval', 'configCycleInterval') + reconfigureTimeout = None def __init__(self): Base.__init__(self, keeproot=True) @@ -88,13 +89,7 @@ self.status = Status() def configService(self): - class FakeService: - def callRemote(self, *args): - return defer.fail("Config Service is down") - try: - return self.services['StatusConfig'] - except KeyError: - return FakeService() + return self.services.get('StatusConfig', FakeRemote()) def startScan(self, ignored=None): d = drive(self.scanCycle) @@ -109,6 +104,11 @@ self.log.error(why.getErrorMessage()) self.stop() + def remote_notifyConfigChanged(self): + if self.reconfigureTimeout and not self.reconfigureTimeout.called: + self.reconfigureTimeout.cancel() + self.reconfigureTimeout = reactor.callLater(5, drive, self.reconfigure) + def remote_setPropertyItems(self, items): self.log.debug("Async update of collection properties") self.setPropertyItems(items) @@ -131,8 +131,13 @@ yield self.configService().callRemote('propertyItems') self.setPropertyItems(driver.next()) - driveLater(self.configCycleInterval * 60, self.configCycle) + d = driveLater(self.configCycleInterval * 60, self.configCycle) + d.addErrback(self.error) + yield drive(self.reconfigure) + driver.next() + + def reconfigure(self, driver): self.log.debug("Getting service status") yield self.configService().callRemote('serviceStatus') self.counts = {} @@ -147,9 +152,14 @@ count = self.counts.get((s.device, s.component), 0) self.ipservices.append(ZenTcpClient(s, count)) self.log.debug("ZenStatus configured") + + def error(self, why): + self.log.error(why.getErrorMessage()) + def scanCycle(self, driver): - driveLater(self.cycleInterval, self.scanCycle) + d = driveLater(self.cycleInterval, self.scanCycle) + d.addErrback(self.error) if not self.status.done(): duration = self.status.duration() Modified: trunk/Products/ZenUtils/Driver.py =================================================================== --- trunk/Products/ZenUtils/Driver.py 2007-04-16 22:36:58 UTC (rev 4704) +++ trunk/Products/ZenUtils/Driver.py 2007-04-17 01:38:25 UTC (rev 4705) @@ -74,9 +74,11 @@ def driveLater(secs, callable): "Drive the callable at a later time" + d = defer.Deferred() def driveAgain(): - drive(callable) + drive(callable).chainDeferred(d) reactor.callLater(secs, driveAgain) + return d def test(): |
From: <sv...@ze...> - 2007-04-16 22:36:58
|
Author: jstevens Date: 2007-04-16 18:36:58 -0400 (Mon, 16 Apr 2007) New Revision: 4704 Modified: trunk/Products/ZenHub/PBDaemon.py Log: Moved gotPerspective to a method so can be overridden. Modified: trunk/Products/ZenHub/PBDaemon.py =================================================================== --- trunk/Products/ZenHub/PBDaemon.py 2007-04-16 19:42:54 UTC (rev 4703) +++ trunk/Products/ZenHub/PBDaemon.py 2007-04-16 22:36:58 UTC (rev 4704) @@ -67,23 +67,24 @@ self.stopEvent = stopEvent.copy() for evt in self.startEvent, self.stopEvent: evt.update(dict(component=self.name, device=getfqdn())) - + + + def gotPerspective(self, perspective): + ''' This gets called every time we reconnect. + ''' + self.log.warning("Reconnected to ZenHub") + self.perspective = perspective + d2 = self.getInitialServices() + if d.called: + self.log.debug('adding stop as getInitialServices errback') + d2.addErrback(lambda e: self.stop()) + else: + self.log.debug('chaining getInitialServices with d2') + d2.chainDeferred(d) + + def connect(self): - d = defer.Deferred() - - def gotPerspective(perspective): - "Every time we reconnect this function is called" - self.log.warning("Connected to ZenHub") - self.perspective = perspective - d2 = self.getInitialServices() - if d.called: - self.log.debug('adding stop as getInitialServices errback') - d2.addErrback(lambda e: self.stop()) - else: - self.log.debug('chaining getInitialServices with d2') - d2.chainDeferred(d) - factory = ReconnectingPBClientFactory() self.log.debug("Connecting to %s", self.options.hubHost) reactor.connectTCP(self.options.hubHost, self.options.hubPort, factory) @@ -91,10 +92,11 @@ password = self.options.password self.log.debug("Logging in as %s", username) c = credentials.UsernamePassword(username, password) - factory.gotPerspective = gotPerspective + factory.gotPerspective = self.gotPerspective factory.startLogin(c) return d + def eventService(self): return self.services['EventService'] |
From: <sv...@ze...> - 2007-04-16 19:44:20
|
Author: ecn Date: 2007-04-16 15:42:54 -0400 (Mon, 16 Apr 2007) New Revision: 4703 Modified: trunk/Products/ZenEvents/zentrap.py Log: * get then of v1 traps more easily Modified: trunk/Products/ZenEvents/zentrap.py =================================================================== --- trunk/Products/ZenEvents/zentrap.py 2007-04-16 19:39:38 UTC (rev 4702) +++ trunk/Products/ZenEvents/zentrap.py 2007-04-16 19:42:54 UTC (rev 4703) @@ -143,7 +143,7 @@ 3 : 'snmp_linkUp', 4 : 'snmp_authenticationFailure', 5 : 'snmp_egpNeighorLoss', - 6 : self.oid2name('%s.0.%d' % (enterprise, specific)) + 6 : self.oid2name('%s' % (enterprise,)) }.get(generic, eventType + "_%d" % specific) for binding in extract(data, 'pdu/trap/variable_bindings'): oid = grind(binding['name']) |
From: <sv...@ze...> - 2007-04-16 19:39:45
|
Author: ecn Date: 2007-04-16 15:39:38 -0400 (Mon, 16 Apr 2007) New Revision: 4702 Modified: trunk/Products/ZenModel/PerformanceConf.py trunk/Products/ZenRRD/RenderServer.py Log: * work around missing url encodings in python2.3 Modified: trunk/Products/ZenModel/PerformanceConf.py =================================================================== --- trunk/Products/ZenModel/PerformanceConf.py 2007-04-16 19:36:05 UTC (rev 4701) +++ trunk/Products/ZenModel/PerformanceConf.py 2007-04-16 19:39:38 UTC (rev 4702) @@ -20,6 +20,18 @@ import logging log = logging.getLogger("zen.PerformanceConf") +try: + from base64 import urlsafe_b64encode + raise ImportError +except ImportError, ex: + def urlsafe_b64encode(s): + import base64 + s = base64.encodestring(s) + s = s.replace('+','-') + s = s.replace('/','_') + s = s.replace('\n','') + return s + import xmlrpclib from sets import Set @@ -293,7 +305,7 @@ continue ngopts.append(o) import base64 - gopts = base64.urlsafe_b64encode(zlib.compress('|'.join(ngopts), 9)) + gopts = urlsafe_b64encode(zlib.compress('|'.join(ngopts), 9)) url = "%s/render?gopts=%s&drange=%d&width=%s" % ( self.renderurl,gopts,drange, width) if self.renderurl.startswith("http"): Modified: trunk/Products/ZenRRD/RenderServer.py =================================================================== --- trunk/Products/ZenRRD/RenderServer.py 2007-04-16 19:36:05 UTC (rev 4701) +++ trunk/Products/ZenRRD/RenderServer.py 2007-04-16 19:39:38 UTC (rev 4702) @@ -28,6 +28,14 @@ except ImportError: pass +try: + from base64 import urlsafe_b64decode + raise ImportError +except ImportError: + def urlsafe_b64decode(s): + import base64 + return base64.decodestring(s.replace('-','+').replace('_','/')) + from Products.ZenUtils.PObjectCache import PObjectCache from Products.ZenUtils.PObjectCache import CacheObj @@ -71,8 +79,7 @@ def render(self, gopts=None, drange=None, remoteUrl=None, width=None, ftype='PNG', REQUEST=None): """render a graph and return it""" - import base64 - gopts = zlib.decompress(base64.urlsafe_b64decode(gopts)) + gopts = zlib.decompress(urlsafe_b64decode(gopts)) gopts = gopts.split('|') gopts = [g for g in gopts if g] gopts.append('--width=%s' % width) |
From: <sv...@ze...> - 2007-04-16 19:36:54
|
Author: ecn Date: 2007-04-16 15:36:05 -0400 (Mon, 16 Apr 2007) New Revision: 4701 Modified: trunk/Products/ZenHub/services/ZenRender.py Log: * close connections that fail to render Modified: trunk/Products/ZenHub/services/ZenRender.py =================================================================== --- trunk/Products/ZenHub/services/ZenRender.py 2007-04-16 19:06:55 UTC (rev 4700) +++ trunk/Products/ZenHub/services/ZenRender.py 2007-04-16 19:36:05 UTC (rev 4701) @@ -42,7 +42,8 @@ del args['ftype'] request.setHeader('Content-type', 'image/%s' % ftype) def write(result): - request.write(result) + if result: + request.write(result) request.finish() def error(reason): log.error("Unable to fetch graph: %s", reason) |
From: <sv...@ze...> - 2007-04-16 19:06:58
|
Author: marc Date: 2007-04-16 15:06:55 -0400 (Mon, 16 Apr 2007) New Revision: 4700 Modified: trunk/Products/ZenModel/ZenMenu.py trunk/Products/ZenModel/ZenMenuItem.py trunk/Products/ZenModel/migrate/menus.py trunk/Products/ZenRelations/RelationshipBase.py Log: #1214 * Added ordering attribute * Added __cmp__ to ZenMenuItem to make it sortable by ordering * Added ordering to menu instance (run zenmigrate) * Still not being ordered because sorting is still done by keys (item id) Modified: trunk/Products/ZenModel/ZenMenu.py =================================================================== --- trunk/Products/ZenModel/ZenMenu.py 2007-04-16 17:20:13 UTC (rev 4699) +++ trunk/Products/ZenModel/ZenMenu.py 2007-04-16 19:06:55 UTC (rev 4700) @@ -39,7 +39,7 @@ security.declareProtected('Change Device', 'manage_addZenMenuItem') def manage_addZenMenuItem(self, id=None, description='', action='', permissions=(Permissions.view,), isdialog=False, isglobal=True, - banned_classes=(), allowed_classes=(), REQUEST=None): + banned_classes=(), allowed_classes=(), ordering=0.0, REQUEST=None): """ Add a menu item to a menu """ mi = None if id: @@ -54,6 +54,7 @@ mi.isglobal = isglobal mi.banned_classes = list(banned_classes) mi.allowed_classes = list(allowed_classes) + mi.ordering = ordering return mi security.declareProtected('Change Device', 'manage_deleteZenMenuItem') Modified: trunk/Products/ZenModel/ZenMenuItem.py =================================================================== --- trunk/Products/ZenModel/ZenMenuItem.py 2007-04-16 17:20:13 UTC (rev 4699) +++ trunk/Products/ZenModel/ZenMenuItem.py 2007-04-16 19:06:55 UTC (rev 4700) @@ -25,6 +25,7 @@ isdialog = False banned_classes = () allowed_classes = () + ordering = 0.0 _properties = ( {'id':'description', 'type':'text', 'mode':'w'}, @@ -34,6 +35,7 @@ {'id':'banned_classes','type':'lines','mode':'w'}, {'id':'allowed_classes','type':'lines','mode':'w'}, {'id':'isdialog', 'type':'boolean','mode':'w'}, + {'id':'ordering', 'type':'float','mode':'w'}, ) _relations = ( @@ -48,5 +50,11 @@ parent = parent.getParentNode() return parent + def __cmp__(self, other): + if other and other.ordering: + return cmp(self.ordering, other.ordering) + else: + return cmp(self.ordering, 0.0) + InitializeClass(ZenMenuItem) Modified: trunk/Products/ZenModel/migrate/menus.py =================================================================== --- trunk/Products/ZenModel/migrate/menus.py 2007-04-16 17:20:13 UTC (rev 4699) +++ trunk/Products/ZenModel/migrate/menus.py 2007-04-16 19:06:55 UTC (rev 4700) @@ -21,6 +21,7 @@ menuxml = os.path.join(zenhome, "Products/ZenModel/data/menus.xml") ZenPackItems = dict( + ordering=50.0, id= 'addToZenPack', description='Add to ZenPack...', action= 'dialog_addToZenPack', @@ -75,16 +76,19 @@ 'IpInterface', 'OSProcess'], description='PerfConf', + ordering=0.0, id='objRRDTemplate', permissions=('Change Device',) ), dict(action='../objRRDTemplate', allowed_classes=['OperatingSystem'], description='PerfConf', + ordering=0.0, id='objRRDTemplate_os', permissions=('Change Device',) ), dict( + ordering=0.0, id= 'addToZenPack', description='Add to ZenPack...', action= 'dialog_addToZenPack', @@ -103,6 +107,7 @@ 'OSProcess', 'IpRouteEntry'], description='Lock', + ordering=0.0, id='lockObject', isdialog=True, permissions=('Change Device',) @@ -116,6 +121,7 @@ 'OSProcess', 'IpRouteEntry'], description='Delete', + ordering=0.0, id='deleteObject', isdialog=True, permissions=('Change Device',) @@ -123,6 +129,7 @@ dict(action='editStatusMonitorConf', allowed_classes=['StatusMonitorConf'], description='Edit', + ordering=0.0, id='editStatusMonitorConf', permissions=('Manage DMD',) ), @@ -130,48 +137,56 @@ allowed_classes=['DeviceClass', 'Device'], description='Push Changes to Collectors', + ordering=0.0, id='pushConfig', permissions=('Change Device',) ), dict(action='../pushConfig', allowed_classes=['OperatingSystem'], description='Push Changes to Collectors', + ordering=0.0, id='pushConfig_os', permissions=('Change Device',) ), dict(action='deviceCustomEdit', allowed_classes=['Device'], description='Custom', + ordering=0.0, id='deviceCustomEdit', permissions=('View',) ), dict(action='../deviceCustomEdit', allowed_classes=['OperatingSystem'], description='Custom', + ordering=0.0, id='deviceCustomEdit_os', permissions=('View',) ), dict(action='eventClassInstEdit', allowed_classes=['EventClassInst'], description='Edit', + ordering=0.0, id='eventClassInstEdit', permissions=('Manage DMD',) ), dict(action='ipServiceClassEdit', allowed_classes=['IpServiceClass'], description='Edit', + ordering=0.0, id='ipServiceClassEdit', permissions=('Manage DMD',) ), dict(action='deviceManagement', allowed_classes=['Device'], description='Manage', + ordering=0.0, id='deviceManagement', permissions=('Change Device',) ), dict(action='../deviceManagement', allowed_classes=['OperatingSystem'], description='Manage', + ordering=0.0, id='deviceManagement_os', permissions=('Change Device',) ), @@ -182,60 +197,70 @@ dict(action='serviceOrganizerManage', allowed_classes=['ServiceOrganizer'], description='Manage', + ordering=0.0, id='serviceOrganizerManage', permissions=('Manage DMD',) ), dict(action='osProcessOrganizerManage', allowed_classes=['OSProcessOrganizer'], description='Manage', + ordering=0.0, id='osProcessOrganizerManage', permissions=('Manage DMD',) ), dict(action='ipServiceClassManage', allowed_classes=['IpServiceClass'], description='Manage', + ordering=0.0, id='ipServiceClassManage', permissions=('Manage DMD',) ), dict(action='editManufacturer', allowed_classes=['Manufacturer'], description='Edit', + ordering=0.0, id='editManufacturer', permissions=('Manage DMD',) ), dict(action='osProcessManage', allowed_classes=['OSProcess'], description='Manage', + ordering=0.0, id='osProcessManage', permissions=('Manage DMD',) ), dict(action='serviceClassManage', allowed_classes=['ServiceClass'], description='Manage', + ordering=0.0, id='serviceClassManage', permissions=('Manage DMD',) ), dict(action='editPerformanceConf', allowed_classes=['PerformanceConf'], description='Edit', + ordering=0.0, id='editPerformanceConf', permissions=('Manage DMD',) ), dict(action='ipServiceManage', allowed_classes=['IpService'], description='Manage', + ordering=0.0, id='ipServiceManage', permissions=('Manage DMD',) ), dict(action='editProductClass', allowed_classes=['ProductClass'], description='Edit', + ordering=0.0, id='editProductClass', permissions=('Manage DMD',) ), dict(action='osProcessClassManage', allowed_classes=['OSProcessClass'], description='Manage', + ordering=0.0, id='osProcessClassManage', permissions=('Manage DMD',) ), @@ -246,48 +271,56 @@ 'DeviceClass', 'System'], description='Manage', + ordering=0.0, id='deviceOrganizerManage', permissions=('Manage DMD',) ), dict(action='editDevice', allowed_classes=['Device'], description='Edit', + ordering=0.0, id='editDevice', permissions=('Change Device',) ), dict(action='../editDevice', allowed_classes=['OperatingSystem'], description='Edit', + ordering=0.0, id='editDevice_os', permissions=('Change Device',) ), dict(action='winServiceManage', allowed_classes=['WinService'], description='Manage', + ordering=0.0, id='winServiceManage', permissions=('Manage DMD',) ), dict(action='eventClassInstSequence', allowed_classes=['EventClassInst'], description='Sequence', + ordering=0.0, id='eventClassInstSequence', permissions=('View',) ), dict(action='osProcessClassEdit', allowed_classes=['OSProcessClass'], description='Edit', + ordering=0.0, id='osProcessClassEdit', permissions=('Manage DMD',) ), dict(action='performanceTemplates', allowed_classes=['DeviceClass'], description='All Performance Templates', + ordering=98.0, id='performanceTemplates', permissions=('View Device',) ), dict(action='perfConfig', allowed_classes=['DeviceClass'], description='Perf Config', + ordering=99.0, id='perfConfig', permissions=('Change Device',) ), @@ -305,18 +338,21 @@ 'EventClassInst', 'EventClass'], description='zProperties', + ordering=0.0, id='zPropertyEdit', permissions=('View',) ), dict(action='../zPropertyEdit', allowed_classes=['OperatingSystem'], description='zProperties', + ordering=0.0, id='zPropertyEdit_os', permissions=('View',) ), dict(action='serviceClassEdit', allowed_classes=['ServiceClass'], description='Edit', + ordering=0.0, id='serviceClassEdit', permissions=('Manage DMD',) ), @@ -324,6 +360,7 @@ 'Organizer_list': [ ZenPackItems, dict( + ordering=0.0, id= 'addOrganizer', description='Add New Organizer...', action= 'dialog_addOrganizer', @@ -331,6 +368,7 @@ isdialog= True, ), dict( + ordering=0.0, id= 'moveOrganizer', description='Move Organizers...', action= 'dialog_moveOrganizer', @@ -338,6 +376,7 @@ isdialog= True, ), dict( + ordering=0.0, id= 'removeOrganizers', description='Delete Organizers...', action= 'dialog_removeOrganizer', @@ -348,18 +387,21 @@ 'Service_list': [ ZenPackItems, dict( + ordering=0.0, id= 'addServiceClass', description='Add Service...', action= 'dialog_addServiceClass', permissions=('Manage DMD',), isdialog= True), dict( + ordering=0.0, id= 'removeServiceClasses', description='Delete Services...', action= 'dialog_removeServiceClasses', permissions=('Manage DMD',), isdialog= True), dict( + ordering=0.0, id= 'moveServiceClasses', description='Move Services...', action= 'dialog_moveServiceClasses', @@ -369,18 +411,21 @@ 'OSProcess_list': [ ZenPackItems, dict( + ordering=0.0, id= 'addOSProcess', description='Add Process...', action= 'dialog_addOSProcess', permissions=('Manage DMD',), isdialog= True), dict( + ordering=0.0, id= 'removeOSProcesses', description='Delete Processes...', action= 'dialog_removeOSProcesses', permissions=('Manage DMD',), isdialog= True), dict( + ordering=0.0, id= 'moveOSProcesses', description='Move Processes...', action= 'dialog_moveOSProcesses', @@ -390,12 +435,14 @@ 'Manufacturer_list': [ ZenPackItems, dict( + ordering=0.0, id= 'addManufacturer', description='Add Manufacturer...', action= 'dialog_addManufacturer', permissions=('Manage DMD',), isdialog= True), dict( + ordering=0.0, id= 'removeManufacturers', description='Delete Manufacturers...', action= 'dialog_removeManufacturers', @@ -405,18 +452,21 @@ 'Mib_list': [ ZenPackItems, dict( + ordering=0.0, id= 'addMibModule', description='Add Mib...', action= 'dialog_addMibModule', permissions=('Manage DMD',), isdialog= True), dict( + ordering=0.0, id= 'removeMibModules', description='Delete Mibs...', action= 'dialog_removeMibModules', permissions=('Manage DMD',), isdialog= True), dict( + ordering=0.0, id= 'moveMibModules', description='Move Mibs...', action= 'dialog_moveMibModules', @@ -426,18 +476,21 @@ 'EventMapping_list': [ ZenPackItems, dict( + ordering=0.0, id= 'addInstance', description='Add Mapping...', action= 'dialog_createInstance', permissions=('Manage DMD',), isdialog= True), dict( + ordering=0.0, id= 'removeInstances', description='Delete Mappings...', action= 'dialog_removeInstances', permissions=('Manage DMD',), isdialog= True), dict( + ordering=0.0, id= 'moveInstances', description='Move Mappings...', action= 'dialog_moveInstances', @@ -446,12 +499,14 @@ ], 'PerformanceMonitor_list': [ dict( + ordering=0.0, id= 'addPMonitor', description='Add Monitor...', action= 'dialog_addMonitor', permissions=('Manage DMD',), isdialog= True), dict( + ordering=0.0, id= 'removePMonitors', description='Delete Monitors...', action= 'dialog_removeMonitors', @@ -460,12 +515,14 @@ ], 'StatusMonitor_list': [ dict( + ordering=0.0, id= 'addSMonitor', description='Add Monitor...', action= 'dialog_addMonitor', permissions=('Manage DMD',), isdialog= True), dict( + ordering=0.0, id= 'removeSMonitors', description='Delete Monitors...', action= 'dialog_removeMonitors', @@ -476,6 +533,7 @@ # 'ReportClass_list': [ZenPackItems], 'ZenPack_list':[ dict( + ordering=0.0, id= 'addZenPack', description='Create a new ZenPack...', action= 'dialog_addZenPack', @@ -483,6 +541,7 @@ isdialog=True, ), dict( + ordering=0.0, id= 'removeZenPack', description='Delete ZenPack', permissions=('Manage DMD',), @@ -492,6 +551,7 @@ ], 'Device_list':[ dict( + ordering=0.0, id= 'moveclass', description='Move to Class...', action= 'dialog_moveDevices', @@ -499,6 +559,7 @@ isdialog=True ), dict( + ordering=0.0, id= 'setGroups', description='Set Groups...', action= 'dialog_setGroups', @@ -506,6 +567,7 @@ isdialog=True ), dict( + ordering=0.0, id= 'setSystems', description='Set Systems...', action= 'dialog_setSystems', @@ -513,6 +575,7 @@ isdialog=True ), dict( + ordering=0.0, id= 'setLocation', description='Set Location...', action= 'dialog_setLocation', @@ -520,6 +583,7 @@ isdialog=True ), dict( + ordering=0.0, id= 'removeDevices', description='Delete devices...', action= 'dialog_removeDevices', @@ -527,6 +591,7 @@ isdialog=True ), dict( + ordering=0.0, id= 'lockDevices', description='Lock devices...', action= 'dialog_lockDevices', @@ -536,6 +601,7 @@ ], 'IpInterface':[ dict( + ordering=0.0, id= 'addIpInterface', description='Add IpInterface...', action= 'dialog_addIpInterface', @@ -543,6 +609,7 @@ permissions=('Change Device',), ), dict( + ordering=0.0, id= 'deleteIpInterfaces', description='Delete IpInterfaces...', action= 'dialog_deleteIpInterfaces', @@ -550,6 +617,7 @@ permissions=('Change Device',), ), dict( + ordering=0.0, id= 'lockIpInterfaces', description='Lock IpInterfaces...', action= 'dialog_lockIpInterfaces', @@ -559,6 +627,7 @@ ], 'OSProcess':[ dict( + ordering=0.0, id= 'addOSProcess', description='Add OSProcess...', action= 'dialog_addOSProcess', @@ -566,6 +635,7 @@ permissions=('Change Device',), ), dict( + ordering=0.0, id= 'deleteOSProcesses', description='Delete OSProcesses...', action= 'dialog_deleteOSProcesses', @@ -573,6 +643,7 @@ permissions=('Change Device',), ), dict( + ordering=0.0, id= 'lockOSProcesses', description='Lock OSProcesses...', action= 'dialog_lockOSProcesses', @@ -582,6 +653,7 @@ ], 'FileSystem':[ dict( + ordering=0.0, id= 'addFileSystem', description='Add File System...', action= 'dialog_addFileSystem', @@ -589,6 +661,7 @@ permissions=('Change Device',), ), dict( + ordering=0.0, id= 'deleteFileSystems', description='Delete FileSystems...', action= 'dialog_deleteFileSystems', @@ -596,6 +669,7 @@ permissions=('Change Device',), ), dict( + ordering=0.0, id= 'lockFileSystems', description='Lock FileSystems...', action= 'dialog_lockFileSystems', @@ -605,6 +679,7 @@ ], 'IpRouteEntry':[ dict( + ordering=0.0, id= 'addIpRouteEntry', description='Add IpRouteEntry...', action= 'dialog_addIpRouteEntry', @@ -612,6 +687,7 @@ permissions=('Change Device',), ), dict( + ordering=0.0, id= 'deleteIpRouteEntries', description='Delete IpRouteEntries...', action= 'dialog_deleteIpRouteEntries', @@ -619,6 +695,7 @@ permissions=('Change Device',), ), dict( + ordering=0.0, id= 'lockIpRouteEntries', description='Lock IpRouteEntries...', action= 'dialog_lockIpRouteEntries', @@ -628,6 +705,7 @@ ], 'IpService':[ dict( + ordering=0.0, id= 'addIpService', description='Add IpService...', action= 'dialog_addIpService', @@ -635,6 +713,7 @@ permissions=('Change Device',), ), dict( + ordering=0.0, id= 'deleteIpServices', description='Delete IpServices...', action= 'dialog_deleteIpServices', @@ -642,6 +721,7 @@ permissions=('Change Device',), ), dict( + ordering=0.0, id= 'lockIpServices', description='Lock IpServices...', action= 'dialog_lockIpServices', @@ -651,6 +731,7 @@ ], 'WinService':[ dict( + ordering=0.0, id= 'addWinService', description='Add WinService...', action= 'dialog_addWinService', @@ -658,6 +739,7 @@ permissions=('Change Device',), ), dict( + ordering=0.0, id= 'deleteWinServices', description='Delete WinServices...', action= 'dialog_deleteWinServices', @@ -665,6 +747,7 @@ permissions=('Change Device',), ), dict( + ordering=0.0, id= 'lockWinServices', description='Lock WinServices...', action= 'dialog_lockWinServices', @@ -674,6 +757,7 @@ ], 'Event_list':[ dict( + ordering=0.0, id= 'acknowledgeEvents', description='Acknowledge Events', action= ('javascript:submitFormToMethod(' @@ -681,6 +765,7 @@ permissions=('Manage DMD',) ), dict( + ordering=0.0, id= 'historifyEvents', description='Move Events to History...', action= 'dialog_moveEventsToHistory', @@ -688,12 +773,14 @@ isdialog= True ), dict( + ordering=0.0, id= 'exportAllEvents', description='Download as CSV', action= 'javascript:goExport()', permissions=('View',) ), dict( + ordering=0.0, id= 'createEventMap', description='Map Events to Class...', action= 'dialog_createEventMap', @@ -703,6 +790,7 @@ ], 'HistoryEvent_list':[ dict( + ordering=0.0, id= 'createEventMap', description='Map Events to Class...', action= 'dialog_createEventMap', @@ -710,12 +798,14 @@ isdialog= True ), dict( + ordering=0.0, id= 'exportAllEvents', description='Download as CSV', action= 'javascript:goExport()', permissions=('View',) ), dict( + ordering=0.0, id= 'undeleteHistoryEvents', description='Undelete Events...', action= 'dialog_undeleteHistoryEvents', @@ -796,6 +886,7 @@ ], 'Subnetworks':[ dict( + ordering=0.0, id= 'deleteNetwork', description='Delete Networks...', action= 'dialog_deleteNetwork', @@ -805,6 +896,7 @@ ], 'IpAddresses':[ dict( + ordering=0.0, id= 'deleteIpAddress', description='Delete IpAddresses...', action= 'dialog_deleteIpAddress', @@ -814,6 +906,7 @@ ], 'Manage': [ dict( + ordering=0.0, id= 'changeClass', description='Change Class', action= 'dialog_changeClass', @@ -822,6 +915,7 @@ allowed_classes = ('Device','OperatingSystem'), ), dict( + ordering=0.0, id= 'modelDevice', description='Model Device', action= 'collectDevice', @@ -829,6 +923,7 @@ allowed_classes = ('Device','OperatingSystem'), ), dict( + ordering=0.0, id= 'resetIp', description='Reset IP', action= 'dialog_resetIp', @@ -837,6 +932,7 @@ allowed_classes = ('Device','OperatingSystem'), ), dict( + ordering=0.0, id= 'resetCommunity', description='Reset Community', action= 'manage_snmpCommunity', @@ -844,6 +940,7 @@ allowed_classes = ('Device','OperatingSystem'), ), dict( + ordering=0.0, id= 'renameDevice', description='Rename Device', action= 'dialog_renameDevice', @@ -852,6 +949,7 @@ allowed_classes = ('Device','OperatingSystem'), ), dict( + ordering=0.0, id= 'deleteDevice', description='Delete Device', action= 'dialog_deleteDevice', @@ -862,6 +960,7 @@ ], 'Add': [ dict( + ordering=0.0, id= 'addIpInterface', description='Add IpInterface...', action= 'dialog_addIpInterface', @@ -870,6 +969,7 @@ allowed_classes = ('OperatingSystem',), ), dict( + ordering=0.0, id= 'addOSProcess', description='Add OSProcess...', action= 'dialog_addOSProcess', @@ -878,6 +978,7 @@ allowed_classes = ('OperatingSystem',), ), dict( + ordering=0.0, id= 'addFileSystem', description='Add File System...', action= 'dialog_addFileSystem', @@ -886,6 +987,7 @@ allowed_classes = ('OperatingSystem',), ), dict( + ordering=0.0, id= 'addIpRouteEntry', description='Add Route...', action= 'dialog_addIpRouteEntry', @@ -894,6 +996,7 @@ allowed_classes = ('OperatingSystem',), ), dict( + ordering=0.0, id= 'addIpService', description='Add IpService...', action= 'dialog_addIpService', @@ -902,6 +1005,7 @@ allowed_classes = ('OperatingSystem',), ), dict( + ordering=0.0, id= 'addWinService', description='Add WinService...', action= 'dialog_addWinService', @@ -910,6 +1014,7 @@ allowed_classes = ('OperatingSystem',), ), dict( + ordering=0.0, id= 'addReportOrganizer', description='Add Report Organizer...', action= 'dialog_addReportClass', @@ -918,24 +1023,26 @@ allowed_classes = ('ReportClass',), ), dict( + ordering=0.0, id= 'addReport', description='Add Report...', action= 'dialog_addReport', isdialog=True, permissions=('Change Device',), allowed_classes = ('ReportClass',), - ), + ) ] }) dmd.Networks.buildMenus( {'Actions':[ dict( + ordering=0.0, id= 'discover', description= 'Discover Devices', action= 'discoverDevices', allowed_classes= ('IpNetwork',) - ), + ) ] }) Modified: trunk/Products/ZenRelations/RelationshipBase.py =================================================================== --- trunk/Products/ZenRelations/RelationshipBase.py 2007-04-16 17:20:13 UTC (rev 4699) +++ trunk/Products/ZenRelations/RelationshipBase.py 2007-04-16 19:06:55 UTC (rev 4700) @@ -68,7 +68,7 @@ def addRelation(self, obj): """Form a bi-directional relation between self and obj.""" - if obj == None: raise ZenRelationsError("Can not add None to relation") + if obj is None: raise ZenRelationsError("Can not add None to relation") if not isinstance(obj, self.remoteClass()): raise ZenSchemaError("%s restricted to class %s. %s is class %s" % (self.id, self.remoteClass().__name__, |
From: <sv...@ze...> - 2007-04-16 17:20:12
|
Author: ecn Date: 2007-04-16 13:20:13 -0400 (Mon, 16 Apr 2007) New Revision: 4699 Modified: trunk/Products/ZenModel/Software.py trunk/Products/ZenModel/skins/zenmodel/deviceStatus.pt Log: * fix speling errors Modified: trunk/Products/ZenModel/Software.py =================================================================== --- trunk/Products/ZenModel/Software.py 2007-04-16 17:12:46 UTC (rev 4698) +++ trunk/Products/ZenModel/Software.py 2007-04-16 17:20:13 UTC (rev 4699) @@ -93,7 +93,7 @@ def _setPropValue(self, id, value): - """override from PerpertyManager to handle checks and ip creation""" + """override from PropertyManager to handle checks and ip creation""" self._wrapperCheck(value) if id == 'installDate': self.setInstallDate(value) @@ -137,7 +137,7 @@ def version(self): - """Return the verion of this software (from its softwareClass) + """Return the version of this software (from its softwareClass) """ pclass = self.productClass() if pclass: return pclass.version Modified: trunk/Products/ZenModel/skins/zenmodel/deviceStatus.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/deviceStatus.pt 2007-04-16 17:12:46 UTC (rev 4698) +++ trunk/Products/ZenModel/skins/zenmodel/deviceStatus.pt 2007-04-16 17:20:13 UTC (rev 4699) @@ -102,7 +102,7 @@ tal:content="structure here/hw/productClass/getPrimaryLink"/> </tr> <tr> - <td class="tableheader">OS Manufactuer</td> + <td class="tableheader">OS Manufacturer</td> <td class="tablevalues" tal:content="structure here/os/getManufacturerLink"/> <td class="tableheader">OS Version</td> |
From: <sv...@ze...> - 2007-04-16 17:12:47
|
Author: jstevens Date: 2007-04-16 13:12:46 -0400 (Mon, 16 Apr 2007) New Revision: 4698 Added: trunk/Products/ZenRRD/ThresholdManager.py Modified: trunk/Products/ZenRRD/zencommand.py trunk/Products/ZenRRD/zenperfsnmp.py trunk/Products/ZenRRD/zenprocess.py trunk/Products/ZenStatus/zencommand.py Log: Moving Threshold and ThresholdManager out of RRDDaemon and into their own files. Added: trunk/Products/ZenRRD/ThresholdManager.py Modified: trunk/Products/ZenRRD/zencommand.py =================================================================== --- trunk/Products/ZenRRD/zencommand.py 2007-04-16 16:04:23 UTC (rev 4697) +++ trunk/Products/ZenRRD/zencommand.py 2007-04-16 17:12:46 UTC (rev 4698) @@ -24,7 +24,8 @@ from Products.ZenUtils.Driver import drive, driveLater from Products.ZenEvents import Event -from Products.ZenRRD.RRDDaemon import RRDDaemon, Threshold, ThresholdManager +from Products.ZenRRD.RRDDaemon import RRDDaemon +from Products.ZenRRD.ThresholdManager import Threshold, ThresholdManager from Products.ZenRRD.RRDUtil import RRDUtil from Products.DataCollector.SshClient import SshClient Modified: trunk/Products/ZenRRD/zenperfsnmp.py =================================================================== --- trunk/Products/ZenRRD/zenperfsnmp.py 2007-04-16 16:04:23 UTC (rev 4697) +++ trunk/Products/ZenRRD/zenperfsnmp.py 2007-04-16 17:12:46 UTC (rev 4698) @@ -43,7 +43,7 @@ from Products.ZenEvents.ZenEventClasses import Perf_Snmp, Status_Snmp from RRDUtil import RRDUtil -from RRDDaemon import Threshold, ThresholdManager +from Products.ZenRRD.ThresholdManager import Threshold, ThresholdManager from SnmpDaemon import SnmpDaemon from FileCleanup import FileCleanup Modified: trunk/Products/ZenRRD/zenprocess.py =================================================================== --- trunk/Products/ZenRRD/zenprocess.py 2007-04-16 16:04:23 UTC (rev 4697) +++ trunk/Products/ZenRRD/zenprocess.py 2007-04-16 17:12:46 UTC (rev 4698) @@ -41,7 +41,7 @@ from Products.ZenEvents.ZenEventClasses import Status_Snmp, Status_OSProcess from RRDUtil import RRDUtil -from RRDDaemon import Threshold, ThresholdManager +from Products.ZenRRD.ThresholdManager import Threshold, ThresholdManager from SnmpDaemon import SnmpDaemon HOSTROOT ='.1.3.6.1.2.1.25' Modified: trunk/Products/ZenStatus/zencommand.py =================================================================== --- trunk/Products/ZenStatus/zencommand.py 2007-04-16 16:04:23 UTC (rev 4697) +++ trunk/Products/ZenStatus/zencommand.py 2007-04-16 17:12:46 UTC (rev 4698) @@ -24,7 +24,8 @@ from Products.ZenUtils.Driver import drive, driveLater from Products.ZenEvents import Event -from Products.ZenRRD.RRDDaemon import RRDDaemon, Threshold, ThresholdManager +from Products.ZenRRD.RRDDaemon import RRDDaemon +from Products.ZenRRD.ThresholdManager import Threshold, ThresholdManager from Products.ZenRRD.RRDUtil import RRDUtil from Products.DataCollector.SshClient import SshClient |
From: <sv...@ze...> - 2007-04-16 16:04:22
|
Author: chris Date: 2007-04-16 12:04:23 -0400 (Mon, 16 Apr 2007) New Revision: 4697 Modified: tags/zenoss-1.1.2/inst/rpm/zenoss.spec Log: * synchronized with tagname by zenpkg Modified: tags/zenoss-1.1.2/inst/rpm/zenoss.spec =================================================================== --- tags/zenoss-1.1.2/inst/rpm/zenoss.spec 2007-04-16 16:01:57 UTC (rev 4696) +++ tags/zenoss-1.1.2/inst/rpm/zenoss.spec 2007-04-16 16:04:23 UTC (rev 4697) @@ -27,7 +27,7 @@ # set to 1 if the version of the software to be built is the trunk # if trunk is set to 0 the version will be extrapolated from the # rpm information contained in the %{version} and %{release} vars -%define trunk 1 +%define trunk 0 # the name of the ctl file for zenoss (in /etc/rc.d/rc#.d) %define S_zenoss S99zenoss @@ -41,8 +41,8 @@ # the RPM meta information Name: zenoss Summary: The Open Source Network Management System -Version: 1.1.0 -Release: 0 +Version: 1.1.2 +Release: 0 License: GPL Vendor: Zenoss, Inc. Packager: Christopher Blunck <ch...@ze...> |
From: <sv...@ze...> - 2007-04-16 16:01:57
|
Author: chris Date: 2007-04-16 12:01:57 -0400 (Mon, 16 Apr 2007) New Revision: 4696 Added: tags/zenoss-1.1.2/ Log: * auto-build of zenoss-1.1.2 by zenpkg Copied: tags/zenoss-1.1.2 (from rev 4695, branches/zenoss-1.1.x) |