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-19 19:24:18
|
Author: marc Date: 2007-04-19 15:24:17 -0400 (Thu, 19 Apr 2007) New Revision: 4770 Modified: trunk/Products/ZenModel/skins/zenmodel/viewManufacturerOverview.pt Log: #1244 * Added filter to Manufacturers Products List Modified: trunk/Products/ZenModel/skins/zenmodel/viewManufacturerOverview.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/viewManufacturerOverview.pt 2007-04-19 19:15:24 UTC (rev 4769) +++ trunk/Products/ZenModel/skins/zenmodel/viewManufacturerOverview.pt 2007-04-19 19:24:17 UTC (rev 4770) @@ -60,11 +60,10 @@ <span metal:use-macro="here/templates/macros/contentSeparator"/> - - <tal:block tal:define=" tableName string:manufacturerproducts; objects here/products/objectValuesAll; + showfilterbox python:True; batch python:here.ZenTableManager.getBatch(tableName,objects); tabletitle string:Products"> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> |
From: <sv...@ze...> - 2007-04-19 19:15:26
|
Author: marc Date: 2007-04-19 15:15:24 -0400 (Thu, 19 Apr 2007) New Revision: 4769 Modified: trunk/Products/ZenModel/migrate/menus.py Log: * Removed test top level menu item Modified: trunk/Products/ZenModel/migrate/menus.py =================================================================== --- trunk/Products/ZenModel/migrate/menus.py 2007-04-19 19:14:11 UTC (rev 4768) +++ trunk/Products/ZenModel/migrate/menus.py 2007-04-19 19:15:24 UTC (rev 4769) @@ -68,14 +68,7 @@ dmd.buildMenus( { - 'TopLevel':[ - dict(action='testTopLevel', - allowed_classes=['Device'], - description='Test Top Level', - ordering=100.0, - id='testTopLevel', - ), - ], + 'TopLevel':[], 'Edit':[ dict(action='viewHistory', allowed_classes=['Device', |
From: <sv...@ze...> - 2007-04-19 19:14:38
|
Author: marc Date: 2007-04-19 15:14:11 -0400 (Thu, 19 Apr 2007) New Revision: 4768 Added: trunk/Products/ZenModel/skins/zenmodel/dialog_addOIDMapping.pt trunk/Products/ZenModel/skins/zenmodel/dialog_addTrap.pt trunk/Products/ZenModel/skins/zenmodel/dialog_deleteOIDMapping.pt trunk/Products/ZenModel/skins/zenmodel/dialog_deleteTrap.pt Modified: trunk/Products/ZenModel/MibModule.py trunk/Products/ZenModel/migrate/menus.py trunk/Products/ZenModel/skins/zenmodel/viewMibModule.pt Log: #1256 * New dialogs for adding and deleting OID Mappings * New dialogs for adding and deleting Traps Modified: trunk/Products/ZenModel/MibModule.py =================================================================== --- trunk/Products/ZenModel/MibModule.py 2007-04-19 15:29:50 UTC (rev 4767) +++ trunk/Products/ZenModel/MibModule.py 2007-04-19 19:14:11 UTC (rev 4768) @@ -69,19 +69,57 @@ def notificationCount(self): return self.notifications.countObjects() - - def createMibNode(self, id, **kwargs): - """Create a MibNode + + def deleteMibNodes(self, ids=[], REQUEST=None): + """Delete MibNodes """ - from MibNode import MibNode + for node in self.nodes(): + id = getattr(node, 'id', None) + if id in ids: + self.nodes._delObject(id) + if REQUEST: + return self.callZenScreen(REQUEST) + + + def addMibNode(self, id, oid, nodetype, REQUEST=None): + """Add a MibNode + """ + self.createMibNode(id, oid=oid, nodetype=nodetype) + if REQUEST: + return self.callZenScreen(REQUEST) + + + def createMibNotification(self, id, **kwargs): + """Create a MibNotification + """ + from MibNotification import MibNotification if self.oid2name(kwargs['oid']): return None - node = MibNode(id, **kwargs) + node = MibNotification(id, **kwargs) self.nodes._setObject(node.id, node) node = self.nodes._getOb(node.id) return node + def deleteMibNotifications(self, ids=[], REQUEST=None): + """Delete MibNotifications + """ + for notification in self.notifications(): + id = getattr(notification, 'id', None) + if id in ids: + self.notifications._delObject(id) + if REQUEST: + return self.callZenScreen(REQUEST) + + + def addMibNotification(self, id, oid, nodetype, REQUEST=None): + """Add a MibNotification + """ + self.createMibNotification(id, oid=oid, nodetype=nodetype) + if REQUEST: + return self.callZenScreen(REQUEST) + + def createMibNotification(self, id, **kwargs): """Create a MibNotification """ Modified: trunk/Products/ZenModel/migrate/menus.py =================================================================== --- trunk/Products/ZenModel/migrate/menus.py 2007-04-19 15:29:50 UTC (rev 4767) +++ trunk/Products/ZenModel/migrate/menus.py 2007-04-19 19:14:11 UTC (rev 4768) @@ -1032,7 +1032,43 @@ permissions=('Change Device',), allowed_classes = ('ReportClass',), ) - ] + ], + 'OIDMappings':[ + dict( + ordering=1.0, + id= 'addOIDMapping', + description='Add OID Mapping...', + action= 'dialog_addOIDMapping', + isdialog=True, + permissions=('Change Device',), + ), + dict( + ordering=2.0, + id= 'deleteOIDMapping', + description='Delete OID Mapping...', + action= 'dialog_deleteOIDMapping', + isdialog=True, + permissions=('Change Device',), + ), + ], + 'Traps':[ + dict( + ordering=1.0, + id= 'addTrap', + description='Add Trap...', + action= 'dialog_addTrap', + isdialog=True, + permissions=('Change Device',), + ), + dict( + ordering=2.0, + id= 'deleteTrap', + description='Delete Trap...', + action= 'dialog_deleteTrap', + isdialog=True, + permissions=('Change Device',), + ), + ], }) dmd.Networks.buildMenus( Added: trunk/Products/ZenModel/skins/zenmodel/dialog_addOIDMapping.pt Added: trunk/Products/ZenModel/skins/zenmodel/dialog_addTrap.pt Added: trunk/Products/ZenModel/skins/zenmodel/dialog_deleteOIDMapping.pt Added: trunk/Products/ZenModel/skins/zenmodel/dialog_deleteTrap.pt Modified: trunk/Products/ZenModel/skins/zenmodel/viewMibModule.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/viewMibModule.pt 2007-04-19 15:29:50 UTC (rev 4767) +++ trunk/Products/ZenModel/skins/zenmodel/viewMibModule.pt 2007-04-19 19:14:11 UTC (rev 4768) @@ -52,13 +52,15 @@ <br/> -<form method="post" tal:attributes="action here/absolute_url_path"> +<form method="post" name="oidMappingsForm" tal:attributes="action here/absolute_url_path"> <input type="hidden" name="zenScreenName" tal:attributes="value template/id"/> <tal:block tal:define="tableName string:mibmodulenodeslist; objects here/nodes; - batch python:here.ZenTableManager.getBatch(tableName,objects); tabletitle string:OID Mappings"> + batch python:here.ZenTableManager.getBatch(tableName,objects); + tabletitle string:OID Mappings; + menu_id string:OIDMappings"> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> <!--====Optional titlebar slots============= @@ -86,6 +88,8 @@ </tr> <tr class="tablevalues" tal:repeat="ds batch"> <td> + <input type="checkbox" name="ids:list" + tal:attributes="value ds/getId"/> <a tal:attributes="href ds/getPrimaryUrlPath" tal:content="ds/getId">name</a> </td> @@ -107,13 +111,15 @@ </form> <br/> -<form method="post" tal:attributes="action here/absolute_url_path"> +<form method="post" name="trapsForm" tal:attributes="action here/absolute_url_path"> <input type="hidden" name="zenScreenName" tal:attributes="value template/id"/> <tal:block tal:define="tableName string:mibmodulenotificationslist; objects here/notifications; - batch python:here.ZenTableManager.getBatch(tableName,objects); tabletitle string:Traps"> + batch python:here.ZenTableManager.getBatch(tableName,objects); + tabletitle string:Traps; + menu_id string:Traps"> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> <!--====Optional titlebar slots============= @@ -141,6 +147,8 @@ </tr> <tr class="tablevalues" tal:repeat="ds batch"> <td> + <input type="checkbox" name="ids:list" + tal:attributes="value ds/getId"/> <a tal:attributes="href ds/getPrimaryUrlPath" tal:content="ds/getId">name</a> </td> |
From: <sv...@ze...> - 2007-04-19 15:29:50
|
Author: jstevens Date: 2007-04-19 11:29:50 -0400 (Thu, 19 Apr 2007) New Revision: 4767 Modified: trunk/Products/ZenHub/services/WebConfig.py Log: syntax error removed Modified: trunk/Products/ZenHub/services/WebConfig.py =================================================================== --- trunk/Products/ZenHub/services/WebConfig.py 2007-04-19 15:21:49 UTC (rev 4766) +++ trunk/Products/ZenHub/services/WebConfig.py 2007-04-19 15:29:50 UTC (rev 4767) @@ -33,7 +33,7 @@ result = [] log.debug('Getting pagechecks for %s' % dev.id) if not dev.monitorDevice(): - log.warn('Not monitoring %' % dev.id) + log.warn('Not monitoring %s' % dev.id) return result for templ in dev.getRRDTemplates(): dataSources = templ.getRRDDataSources('PAGECHECK') |
From: <sv...@ze...> - 2007-04-19 15:21:56
|
Author: jstevens Date: 2007-04-19 11:21:49 -0400 (Thu, 19 Apr 2007) New Revision: 4766 Modified: trunk/Products/ZenHub/PBDaemon.py trunk/Products/ZenHub/services/RRDService.py trunk/Products/ZenHub/services/WebConfig.py trunk/Products/ZenModel/RRDView.py Log: Fixes for zenweb Modified: trunk/Products/ZenHub/PBDaemon.py =================================================================== --- trunk/Products/ZenHub/PBDaemon.py 2007-04-19 14:58:11 UTC (rev 4765) +++ trunk/Products/ZenHub/PBDaemon.py 2007-04-19 15:21:49 UTC (rev 4766) @@ -103,7 +103,11 @@ def eventService(self): - return self.services.get('EventService', FakeRemote()) + return self.getServiceNow('EventService') + + + def getServiceNow(self, svcName): + return self.services.get(svcName, None) or FakeRemote() def getService(self, serviceName, serviceListeningInterface=None): Modified: trunk/Products/ZenHub/services/RRDService.py =================================================================== --- trunk/Products/ZenHub/services/RRDService.py 2007-04-19 14:58:11 UTC (rev 4765) +++ trunk/Products/ZenHub/services/RRDService.py 2007-04-19 15:21:49 UTC (rev 4766) @@ -9,9 +9,12 @@ Provides RRD services to zenhub clients. ''' +import os.path from HubService import HubService from Products.ZenRRD.RRDUtil import RRDUtil from Products.ZenRRD.ThresholdManager import ThresholdManager, Threshold +import logging +log = logging.getLogger("zenhub") class RRDService(HubService): @@ -30,46 +33,46 @@ ''' Write the given data to it's rrd file. Also check any thresholds and send events if value is out of bounds. ''' + log.debug('Writing %s %s' % (dpName, value)) dev = self.getDeviceOrComponent(devId, compType, compId) - dp = d.getDataPoint(dpName) + dp = dev.getRRDDataPoint(dpName) + if not dp: + log.warn('Did not find datapoint %s on device %s', dpName, devId) + return None rrdKey = (dev.getPrimaryPath(), dp.getPrimaryPath()) - if self.rrd.has_key(key): + rrdCreateCmd = dp.createCmd or self.getDefaultRRDCreateCommand(dev) + if self.rrd.has_key(rrdKey): rrd = self.rrd[rrdKey] else: - rrd = self.rrd.setdefault(rrdKey, - RRDUtil(dp.createCmd or self.getDefaultRRDCreateCommand(), - dp.datasource.cycletime)) - value = rrd.save(os.path.join(dev.rrdPath(), dp.name), + rrd = RRDUtil(rrdCreateCmd, dp.datasource.cycletime) + self.rrd[rrdKey] = rrd + value = rrd.save(os.path.join(dev.rrdPath(), dp.name()), value, - dp.rrdtype, - dp.createCmd or self.getDefaultRRDCreateCommand(), - dp.datasource.cycleTime, + dp.rrdtype, + rrdCreateCmd, + dp.datasource.cycletime, dp.rrdmin, dp.rrdmax) self.checkThresholds(dev, dp, value) return value - def getDefaultRRDCreateCommand(self): - ''' Return the rrd create command to be used if a datapoint doesn't - explicitly give one. - ''' - raise 'Not Implemented' + def getDefaultRRDCreateCommand(self, device): + return device.perfServer().getDefaultRRDCreateCommand() + - - def getDeviceOrComponent(deviceId, compId, compType): + def getDeviceOrComponent(self, devId, compId, compType): ''' If a compId is given then try to return that component. If unable to find it or if compId is not specified then try to return the given device. If unable to find then return None. ''' d = None - device = self.dmd.Devices.findDevice(deviceId) + device = self.dmd.Devices.findDevice(devId) if device: - if componentId: - for component in device.getDeviceComponents(): - if component.meta_type == componentType \ - and component.id == componentId: - d = component + if compId: + for comp in device.getDeviceComponents(): + if comp.meta_type == compType and comp.id == compId: + d = comp break else: d = device @@ -86,18 +89,22 @@ # Loop through the enabled thresholds on the template containing # this datapoint. for t in [t for t in dp.datasource.rrdTemplate.thresholds() - if t.enabled and dp.name() in t.dsnames()]: + if t.enabled and dp.name() in t.dsnames]: + log.debug('Checking %s value of %s against threshold %s: %s:%s' % + (dp.name(), value, t.id, t.getMinval(dev), t.getMaxval(dev))) countKey = (dev.getPrimaryPath(), dp.getPrimaryPath(), t.id) - count = self.status.setdefault(countKey, 0) + count = self.counts.setdefault(countKey, 0) limit = None how = None maxv = t.getMaxval(dev) if maxv is not None and value > maxv: + log.debug('threshold exceeded') limit = maxv how = 'exceeded' else: minv = t.getMinval(dev) if minv is not None and value < minv: + log.debug('threshold not met') limit = minv how = 'not met' # Only need to take action if threshold was exceeded or if it was @@ -123,13 +130,13 @@ summary = ('%s %s threshold restored' % (devId, dp.name()) + ' current value: %.2f' % float(value)) - self.zenm.sendEvent( + self.zem.sendEvent(dict( device=devId, summary=summary, eventClass=t.eventClass, eventKey=dp.name(), component=compId, - severity=severity) + severity=severity)) Modified: trunk/Products/ZenHub/services/WebConfig.py =================================================================== --- trunk/Products/ZenHub/services/WebConfig.py 2007-04-19 14:58:11 UTC (rev 4765) +++ trunk/Products/ZenHub/services/WebConfig.py 2007-04-19 15:21:49 UTC (rev 4766) @@ -68,10 +68,11 @@ def getDeviceConfig(self, device): "How to get the config for a device" - return self.getDevicePageChecks(device) + return (device.id, self.getDevicePageChecks(device)) def sendDeviceConfig(self, listener, config): "How to send the config to a device, probably via callRemote" - return listener.callRemote('updateDeviceConfig', config) + devId, testConfigs = config + return listener.callRemote('updateDeviceConfig', devId, testConfigs) Modified: trunk/Products/ZenModel/RRDView.py =================================================================== --- trunk/Products/ZenModel/RRDView.py 2007-04-19 14:58:11 UTC (rev 4765) +++ trunk/Products/ZenModel/RRDView.py 2007-04-19 15:21:49 UTC (rev 4766) @@ -90,6 +90,16 @@ return result + def getRRDDataPoint(self, dpName): + result = None + for t in self.getRRDTemplates(): + for dp in t.getRRDDataPoints(): + if dp.name() == dpName: + result = dp + break + return result + + def getRRDValues(self, dsnames, start=None, end=None, function="LAST"): """Return a dict of key value pairs where dsnames are the keys. """ |
From: <sv...@ze...> - 2007-04-19 14:58:17
|
Author: marc Date: 2007-04-19 10:58:11 -0400 (Thu, 19 Apr 2007) New Revision: 4765 Modified: trunk/Products/ZenModel/migrate/menus.py trunk/Products/ZenWidgets/skins/zenui/zenuimacros.pt Log: #1240 * Added ability for Top Level Menu Items * Also, If you have a submenu with only one menu item it will be moved up to the top level Modified: trunk/Products/ZenModel/migrate/menus.py =================================================================== --- trunk/Products/ZenModel/migrate/menus.py 2007-04-19 14:30:10 UTC (rev 4764) +++ trunk/Products/ZenModel/migrate/menus.py 2007-04-19 14:58:11 UTC (rev 4765) @@ -68,6 +68,14 @@ dmd.buildMenus( { + 'TopLevel':[ + dict(action='testTopLevel', + allowed_classes=['Device'], + description='Test Top Level', + ordering=100.0, + id='testTopLevel', + ), + ], 'Edit':[ dict(action='viewHistory', allowed_classes=['Device', Modified: trunk/Products/ZenWidgets/skins/zenui/zenuimacros.pt =================================================================== --- trunk/Products/ZenWidgets/skins/zenui/zenuimacros.pt 2007-04-19 14:30:10 UTC (rev 4764) +++ trunk/Products/ZenWidgets/skins/zenui/zenuimacros.pt 2007-04-19 14:58:11 UTC (rev 4765) @@ -14,15 +14,14 @@ <div class="menu_bottom"> </div> <ul class="zenMenu"> <tal:block tal:repeat="menu menu_ids"> -<li tal:condition="python:here.getMenus(menu, here)"> -<a href="javascript:void(0)" tal:attributes="id string:${menu}_parent"> -<tal:block tal:content="menu"> -Menu -</tal:block> -</a> +<tal:block tal:define="menus python:here.getMenus(menu, here)"> +<li tal:condition="python:menus and len(menus) > 1"> + <a href="javascript:void(0)" tal:attributes="id string:${menu}_parent"> + <tal:block tal:content="menu">Menu</tal:block> + </a> </li> <div class="submenu" - tal:define="items python:here.getMenus(menu, here)" + tal:define="items menus" tal:attributes="id string:${menu}_submenu"> <tal:block tal:condition="items"> <tal:block tal:define="dummy items/sort"/> @@ -44,12 +43,52 @@ </li> </ul> </div> -<script tal:condition="python:here.getMenus(menu, here)" +<script tal:condition="menus" tal:content="string: registerSubmenu('${menu}_parent','${menu}_submenu');">javascript madness </script> </tal:block> +</tal:block> + <tal:block metal:use-macro="here/userCommandsMacros/macros/runCommandMenu"/> + +<tal:block tal:repeat="menu menu_ids"> +<tal:block tal:define="menus python:here.getMenus(menu, here)"> +<li tal:condition="python:menus and len(menus) == 1"> +<tal:block tal:define="item python:menus[0]"> + <a tal:define="mypath python:test(item.action.startswith('javascript'), + item.action, + '%s/%s' % (basepath, item.action)); + actionpath python:test(item.isdialog, + 'javascript:$(\'dialog\').show(this.event, \'%s\')' % mypath, + mypath)" + tal:attributes="href actionpath" + tal:content="item/description">description</a> + <tal:block tal:condition="python:getattr(request, 'showMenuOrder', None)" + tal:content="item/ordering"/> +</tal:block> +</li> +</tal:block> +</tal:block> + +<tal:block tal:define="items python:here.getMenus('TopLevel', here)"> +<tal:block tal:condition="items"> + <tal:block tal:define="dummy items/sort"/> +</tal:block> +<li tal:repeat="item items"> + <a tal:define="mypath python:test(item.action.startswith('javascript'), + item.action, + '%s/%s' % (basepath, item.action)); + actionpath python:test(item.isdialog, + 'javascript:$(\'dialog\').show(this.event, \'%s\')' % mypath, + 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> +</tal:block> + </ul> </div> </div> |
From: <sv...@ze...> - 2007-04-19 14:30:14
|
Author: ian Date: 2007-04-19 10:30:10 -0400 (Thu, 19 Apr 2007) New Revision: 4764 Modified: trunk/Products/ZenModel/skins/zenmodel/templates.pt trunk/Products/ZenModel/skins/zenmodel/zenmodelfuncs.js Log: * Fixed a missint tal:condition in the message slot Modified: trunk/Products/ZenModel/skins/zenmodel/templates.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/templates.pt 2007-04-19 14:07:38 UTC (rev 4763) +++ trunk/Products/ZenModel/skins/zenmodel/templates.pt 2007-04-19 14:30:10 UTC (rev 4764) @@ -198,7 +198,7 @@ <div class="dbox_bl"><div class="dbox_br"><div class="dbox_bc"> </div></div></div> </div> -<script> +<script tal:condition="python:hasattr(here.REQUEST,'message')"> var pulseMessage = function() { showElement('messageSlot'); pulsate('messageSlot', {pulses:2, duration:5}); Modified: trunk/Products/ZenModel/skins/zenmodel/zenmodelfuncs.js =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/zenmodelfuncs.js 2007-04-19 14:07:38 UTC (rev 4763) +++ trunk/Products/ZenModel/skins/zenmodel/zenmodelfuncs.js 2007-04-19 14:30:10 UTC (rev 4764) @@ -8,7 +8,8 @@ // set the state of the leftPane // - this is a bit of a hack // - it does not change the state of an existing unless it finds - var as = document.getElementById("leftPane").getElementsByTagName("A"); + + var as = $$('#leftPane a'); for(var i=0; i< as.length; i++){ if( location.pathname.indexOf(as[i].pathname) != -1){ as[i].className = 'selected'; |
From: <sv...@ze...> - 2007-04-19 14:07:52
|
Author: marc Date: 2007-04-19 10:07:38 -0400 (Thu, 19 Apr 2007) New Revision: 4763 Modified: trunk/Products/ZenModel/IpInterface.py trunk/Products/ZenModel/OSComponent.py trunk/Products/ZenModel/OperatingSystem.py trunk/Products/ZenModel/skins/zenmodel/dialog_addIpInterface.pt trunk/Products/ZenModel/skins/zenmodel/ipServiceDetail.pt trunk/Products/ZenModel/skins/zenmodel/osProcessDetail.pt trunk/Products/ZenModel/skins/zenmodel/viewFileSystem.pt trunk/Products/ZenModel/skins/zenmodel/viewIpInterface.pt trunk/Products/ZenModel/skins/zenmodel/winServiceDetail.pt Log: #1233 * Edited the edit pages for each OS component * Fixed IpInterface userCreatedFlag error Modified: trunk/Products/ZenModel/IpInterface.py =================================================================== --- trunk/Products/ZenModel/IpInterface.py 2007-04-19 13:17:26 UTC (rev 4762) +++ trunk/Products/ZenModel/IpInterface.py 2007-04-19 14:07:38 UTC (rev 4763) @@ -36,13 +36,13 @@ from OSComponent import OSComponent from Products.ZenModel.Exceptions import * -def manage_addIpInterface(context, id, REQUEST = None): +def manage_addIpInterface(context, id, userCreated, REQUEST = None): """make a device""" d = IpInterface(id) context._setObject(id, d) d = context._getOb(id) d.interfaceName = id - + if userCreated: d.setUserCreateFlag() if REQUEST is not None: REQUEST['RESPONSE'].redirect(context.absolute_url() +'/manage_main') Modified: trunk/Products/ZenModel/OSComponent.py =================================================================== --- trunk/Products/ZenModel/OSComponent.py 2007-04-19 13:17:26 UTC (rev 4762) +++ trunk/Products/ZenModel/OSComponent.py 2007-04-19 14:07:38 UTC (rev 4763) @@ -15,10 +15,10 @@ isUserCreatedFlag = False def setUserCreateFlag(self): - isUserCreatedFlag = True + self.isUserCreatedFlag = True def isUserCreated(self): - return isUserCreatedFlag + return self.isUserCreatedFlag def device(self): """Return our device object for DeviceResultInt. Modified: trunk/Products/ZenModel/OperatingSystem.py =================================================================== --- trunk/Products/ZenModel/OperatingSystem.py 2007-04-19 13:17:26 UTC (rev 4762) +++ trunk/Products/ZenModel/OperatingSystem.py 2007-04-19 14:07:38 UTC (rev 4763) @@ -215,10 +215,10 @@ return self.callZenScreen(REQUEST) - def addIpInterface(self, id, REQUEST=None): + def addIpInterface(self, id, userCreated, REQUEST=None): """Add IpInterfaces. """ - manage_addIpInterface(self.interfaces, id) + manage_addIpInterface(self.interfaces, id, userCreated) if REQUEST is not None: REQUEST['RESPONSE'].redirect(self.interfaces._getOb(id).absolute_url()) Modified: trunk/Products/ZenModel/skins/zenmodel/dialog_addIpInterface.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/dialog_addIpInterface.pt 2007-04-19 13:17:26 UTC (rev 4762) +++ trunk/Products/ZenModel/skins/zenmodel/dialog_addIpInterface.pt 2007-04-19 14:07:38 UTC (rev 4763) @@ -3,6 +3,7 @@ <p> What would you like to name your IpInterface?<br/> </p> +<input type="hidden" name="userCreated" value="True"> <br/> <p style="text-align:center;"> <input type="text" name="id"> Modified: trunk/Products/ZenModel/skins/zenmodel/ipServiceDetail.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/ipServiceDetail.pt 2007-04-19 13:17:26 UTC (rev 4762) +++ trunk/Products/ZenModel/skins/zenmodel/ipServiceDetail.pt 2007-04-19 14:07:38 UTC (rev 4763) @@ -2,6 +2,8 @@ <tal:block metal:fill-slot="contentPane"> <form method=post + tal:define="manager here/isManager; + userCreated here/isUserCreated" tal:attributes="action string:${here/absolute_url_path}"> <input type="hidden" name="zenScreenName" tal:attributes="value template/id" /> @@ -9,7 +11,8 @@ <tal:block tal:define="message request/message | string:State at time:; tabletitle string:${message} ${here/getNowString}; - menu_id string:Lockable"> + menu_id string:Lockable; + editable python:manager and userCreated"> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> <!--====Optional titlebar slots============= @@ -27,16 +30,16 @@ <tr> <td class="tableheader">Status</td> - <td tal:condition="here/isManager"> + <td tal:condition="editable"> <select class="tablevalues" name="status:int" - tal:condition="here/isManager"> + tal:condition="editable"> <option tal:repeat="status here/getStatusConversions" tal:content="python:status[0]" tal:attributes="value python:status[1]; selected python:status==here.getStatus()" /> </select> </td> - <td tal:condition="not:here/isManager" + <td tal:condition="not:editable" tal:define="status here/getStatus" tal:attributes="class python:here.getStatusCssClass(status)" tal:content="python:here.convertStatus(status)"/> @@ -48,9 +51,9 @@ </tr> <tr> <td class="tableheader">Name</td> - <td class="tablevalues" tal:condition="not:here/isManager" + <td class="tablevalues" tal:condition="not:editable" tal:content="here/name"/> - <td class="tablevalues" tal:condition="here/isManager"> + <td class="tablevalues" tal:condition="editable"> <input tal:attributes="class string:tablevalues; size string:50; name string:name; @@ -59,9 +62,9 @@ </tr> <tr> <td class="tableheader">Protocol</td> - <td class="tablevalues" tal:condition="not:here/isManager" + <td class="tablevalues" tal:condition="not:editable" tal:content="here/protocol"/> - <td class="tablevalues" tal:condition="here/isManager"> + <td class="tablevalues" tal:condition="editable"> <select class="tablevalues" name="protocol"> <option tal:repeat="e python:('udp','tcp')" tal:content="e" tal:attributes="value e; selected python:e==here.protocol"/> @@ -70,9 +73,9 @@ </tr> <tr> <td class="tableheader">Port</td> - <td class="tablevalues" tal:condition="not:here/isManager" + <td class="tablevalues" tal:condition="not:editable" tal:content="here/port"/> - <td class="tablevalues" tal:condition="here/isManager"> + <td class="tablevalues" tal:condition="editable"> <input tal:attributes="class string:tablevalues; size string:10; name string:port; @@ -81,9 +84,9 @@ </tr> <tr> <td class="tableheader">Ip Addresses</td> - <td class="tablevalues" tal:condition="not:here/isManager" + <td class="tablevalues" tal:condition="not:editable" tal:content="python: ', '.join(here.ipaddresses)"/> - <td class="tablevalues" tal:condition="here/isManager"> + <td class="tablevalues" tal:condition="editable"> <textarea name="ipaddresses:lines" tal:attributes="class string:tablevalues; cols string:40; @@ -95,11 +98,11 @@ <td class="tableheader">Monitor</td> <td class="tablevalues" tal:condition="not: here/cantMonitor"> <select class="tablevalues" name="monitor:boolean" - tal:condition="here/isManager"> + tal:condition="editable"> <option tal:repeat="e python:(True,False)" tal:content="e" tal:attributes="value e; selected python:e==here.monitored()"/> </select> - <tal:block tal:condition="not:here/isManager" + <tal:block tal:condition="not:editable" tal:content="here/monitored"/> </td> <td class="tablevalues" tal:condition="here/cantMonitor" @@ -108,11 +111,11 @@ <tr> <td class="tableheader">Send String</td> <td class="tablevalues" tal:condition="not: here/cantMonitor"> - <input tal:condition="here/isManager" + <input tal:condition="editable" tal:attributes="class string:tablevalues; name string:sendString; value here/getSendString"/> - <tal:block tal:condition="not:here/isManager" + <tal:block tal:condition="not:editable" tal:content="here/getSendString"/> </td> <td class="tablevalues" tal:condition="here/cantMonitor" @@ -122,9 +125,9 @@ <td class="tableheader">Expect Regex</td> <td class="tablevalues" tal:condition="not: here/cantMonitor"> <input class="tablevalues" type="text" name="expectRegex" - tal:condition="here/isManager" + tal:condition="editable" tal:attributes="value here/getExpectRegex"/> - <tal:block tal:condition="not:here/isManager" + <tal:block tal:condition="not:editable" tal:content="here/getExpectRegex"/> </td> <td class="tablevalues" tal:condition="here/cantMonitor" @@ -134,13 +137,13 @@ <td class="tableheader">Fail Severity</td> <td class="tablevalues" tal:condition="not: here/cantMonitor"> <select class="tableheader" name="severity:int" - tal:condition="here/isManager"> + tal:condition="editable"> <option tal:repeat="sev here/getSeverities" tal:content="python:sev[0]" tal:attributes="value python:sev[1]; selected python:sev[1] == here.getFailSeverity()" /> </select> - <tal:block tal:condition="not:here/isManager" + <tal:block tal:condition="not:editable" tal:content="here/getFailSeverityString"/> </td> <td class="tablevalues" tal:condition="here/cantMonitor" @@ -148,10 +151,10 @@ </tr> <tr> <td class="tableheader">Description</td> - <td class="tablevalues" tal:condition="not:here/isManager" + <td class="tablevalues" tal:condition="not:editable" tal:content="here/description"/> - <td class="tablevalues" tal:condition="here/isManager"> - <input tal:condition="here/isManager" + <td class="tablevalues" tal:condition="editable"> + <input tal:condition="editable" tal:attributes="class string:tablevalues; size string:50; name string:description; Modified: trunk/Products/ZenModel/skins/zenmodel/osProcessDetail.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/osProcessDetail.pt 2007-04-19 13:17:26 UTC (rev 4762) +++ trunk/Products/ZenModel/skins/zenmodel/osProcessDetail.pt 2007-04-19 14:07:38 UTC (rev 4763) @@ -2,6 +2,8 @@ <tal:block metal:fill-slot="contentPane"> <form method=post + tal:define="manager here/isManager; + userCreated here/isUserCreated" tal:attributes="action string:${here/absolute_url_path}"> <input type="hidden" name="zenScreenName" tal:attributes="value template/id" /> @@ -9,9 +11,10 @@ <tal:block tal:define=" message request/message | string:State at time:; - editable here/isManager; + editable editable; tabletitle string:${message} ${here/getNowString}; - menu_id string:Lockable"> + menu_id string:Lockable; + editable python:manager and userCreated"> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> <!--====Optional titlebar slots============= @@ -29,16 +32,16 @@ <tr> <td class="tableheader">Status</td> - <td tal:condition="here/isManager"> + <td tal:condition="editable"> <select class="tablevalue" name="status:int" - tal:condition="here/isManager"> + tal:condition="editable"> <option tal:repeat="status here/getStatusConversions" tal:content="python:status[0]" tal:attributes="value python:status[1]; selected python:status == here.getStatus()" /> </select> </td> - <td tal:condition="not:here/isManager" + <td tal:condition="not:editable" tal:define="status here/getStatus" tal:attributes="class python:here.getStatusCssClass(status)" tal:content="python:here.convertStatus(status)"/> @@ -50,8 +53,8 @@ </tr> <tr> <td class="tableheader">Name</td> - <td class="tablevalues" tal:condition="here/isManager"> - <textarea tal:condition="here/isManager" + <td class="tablevalues" tal:condition="editable"> + <textarea tal:condition="editable" tal:attributes="class string:tablevalues; name string:name; rows string:3; @@ -59,7 +62,7 @@ tal:content="here/name">Process Name </textarea> </td> - <td class="tablevalues" tal:condition="not:here/isManager" + <td class="tablevalues" tal:condition="not:editable" tal:content="here/name"/> </tr> <tr> @@ -90,7 +93,7 @@ <td class="tableheader">Fail Severity</td> <td class="tablevalues" tal:condition="editable"> <select class="tablevalue" name="zFailSeverity:int" - tal:condition="here/isManager"> + tal:condition="editable"> <option tal:repeat="sev here/getSeverities" tal:content="python:sev[0]" tal:attributes="value python:sev[1]; Modified: trunk/Products/ZenModel/skins/zenmodel/viewFileSystem.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/viewFileSystem.pt 2007-04-19 13:17:26 UTC (rev 4762) +++ trunk/Products/ZenModel/skins/zenmodel/viewFileSystem.pt 2007-04-19 14:07:38 UTC (rev 4763) @@ -2,55 +2,58 @@ <tal:block metal:fill-slot="contentPane"> <form method=post + tal:define="manager here/isManager; + userCreated here/isUserCreated" tal:attributes="action string:${here/absolute_url_path}"> <input type="hidden" name="zenScreenName" tal:attributes="value template/id" /> <tal:block metal:define-macro="objectperf" tal:define=" tabletitle string:File System; - menu_id string:Lockable"> + menu_id string:Lockable; + editable python:manager and userCreated"> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> <tal:block metal:fill-slot="zentablecontents"> <tr> <td class="tableheader" align=left>Mount Point</td> - <td class="tablevalues" tal:condition="not:here/isManager" + <td class="tablevalues" tal:condition="not:editable" tal:content="here/mount">/usr</td> - <td class="tablevalues" tal:condition="here/isManager"> - <input tal:condition="here/isManager" + <td class="tablevalues" tal:condition="editable"> + <input tal:condition="editable" tal:attributes="class string:tablevalues; name string:mount; value here/mount"> </td> <td class="tableheader">Monitor</td> - <td class="tablevalues" tal:condition="here/isManager"> + <td class="tablevalues" tal:condition="editable"> <select class="tablevalues" name="monitor:boolean" - tal:condition="here/isManager"> + tal:condition="editable"> <option tal:repeat="e python:(True,False)" tal:content="e" tal:attributes="value e; selected python:e==here.monitored()"/> </select> - <tal:block tal:condition="not:here/isManager" + <tal:block tal:condition="not:editable" tal:content="here/monitored"/> </td> - <td class="tablevalues" tal:condition="not:here/isManager" + <td class="tablevalues" tal:condition="not:editable" tal:content="here/monitored"/> </tr> <tr> <td class="tableheader" align=left>Storage Device</td> - <td class="tablevalues" tal:condition="not:here/isManager" + <td class="tablevalues" tal:condition="not:editable" tal:content="here/storageDevice">1</td> - <td class="tablevalues" tal:condition="here/isManager"> - <input tal:condition="here/isManager" + <td class="tablevalues" tal:condition="editable"> + <input tal:condition="editable" tal:attributes="class string:tablevalues; name string:storageDevice; value here/storageDevice"> </td> <td class="tableheader" align=left>Type</td> - <td class="tablevalues" tal:condition="not:here/isManager" + <td class="tablevalues" tal:condition="not:editable" tal:content="here/type">/usr</td> - <td class="tablevalues" tal:condition="here/isManager"> - <input tal:condition="here/isManager" + <td class="tablevalues" tal:condition="editable"> + <input tal:condition="editable" tal:attributes="class string:tablevalues; name string:type; value here/type"> @@ -58,19 +61,19 @@ </tr> <tr> <td class="tableheader" align=left>Block Size</td> - <td class="tablevalues" tal:condition="not:here/isManager" + <td class="tablevalues" tal:condition="not:editable" tal:content="here/blockSize">1</td> - <td class="tablevalues" tal:condition="here/isManager"> - <input tal:condition="here/isManager" + <td class="tablevalues" tal:condition="editable"> + <input tal:condition="editable" tal:attributes="class string:tablevalues; name string:blockSize; value here/blockSize"> </td> <td class="tableheader" align=left>Total Bytes</td> - <td class="tablevalues" tal:condition="not:here/isManager" + <td class="tablevalues" tal:condition="not:editable" tal:content="here/totalBytesString">/usr</td> - <td class="tablevalues" tal:condition="here/isManager"> - <input tal:condition="here/isManager" + <td class="tablevalues" tal:condition="editable"> + <input tal:condition="editable" tal:attributes="class string:tablevalues; name string:totalBytesString; value here/totalBytesString"> @@ -78,19 +81,19 @@ </tr> <tr> <td class="tableheader" align=left>Used Bytes</td> - <td class="tablevalues" tal:condition="not:here/isManager" + <td class="tablevalues" tal:condition="not:editable" tal:content="here/usedBytesString">1</td> - <td class="tablevalues" tal:condition="here/isManager"> - <input tal:condition="here/isManager" + <td class="tablevalues" tal:condition="editable"> + <input tal:condition="editable" tal:attributes="class string:tablevalues; name string:usedBytesString; value here/usedBytesString"> </td> <td class="tableheader" align=left>Available Bytes</td> - <td class="tablevalues" colspan="3" tal:condition="not:here/isManager" + <td class="tablevalues" colspan="3" tal:condition="not:editable" tal:content="here/availBytesString"/> - <td class="tablevalues" tal:condition="here/isManager"> - <input tal:condition="here/isManager" + <td class="tablevalues" tal:condition="editable"> + <input tal:condition="editable" tal:attributes="class string:tablevalues; name string:availBytesString; value here/availBytesString"> @@ -98,19 +101,19 @@ </tr> <tr> <td class="tableheader" align=left>Total Files</td> - <td class="tablevalues" tal:condition="not:here/isManager" + <td class="tablevalues" tal:condition="not:editable" tal:content="here/totalFiles">1</td> - <td class="tablevalues" tal:condition="here/isManager"> - <input tal:condition="here/isManager" + <td class="tablevalues" tal:condition="editable"> + <input tal:condition="editable" tal:attributes="class string:tablevalues; name string:totalFiles; value here/totalFiles"> </td> <td class="tableheader" align=left>Available Files</td> - <td class="tablevalues" tal:condition="not:here/isManager" + <td class="tablevalues" tal:condition="not:editable" tal:content="here/availFiles">1</td> - <td class="tablevalues" tal:condition="here/isManager"> - <input tal:condition="here/isManager" + <td class="tablevalues" tal:condition="editable"> + <input tal:condition="editable" tal:attributes="class string:tablevalues; name string:availFiles; value here/availFiles"> @@ -118,19 +121,19 @@ </tr> <tr> <td class="tableheader" align=left>Capacity Bytes</td> - <td class="tablevalues" tal:condition="not:here/isManager" + <td class="tablevalues" tal:condition="not:editable" tal:content="string:${here/capacity}%">1</td> - <td class="tablevalues" tal:condition="here/isManager"> - <input tal:condition="here/isManager" + <td class="tablevalues" tal:condition="editable"> + <input tal:condition="editable" tal:attributes="class string:tablevalues; name string:capacity; value here/capacity"> </td> <td class="tableheader" align=left>Capacity Files</td> - <td class="tablevalues" tal:condition="not:here/isManager" + <td class="tablevalues" tal:condition="not:editable" tal:content="string:${here/inodeCapacity}%">1</td> - <td class="tablevalues" tal:condition="here/isManager"> - <input tal:condition="here/isManager" + <td class="tablevalues" tal:condition="editable"> + <input tal:condition="editable" tal:attributes="class string:tablevalues; name string:inodeCapacity; value here/inodeCapacity"> @@ -138,19 +141,19 @@ </tr> <tr> <td class="tableheader" align=left>Max Name Length</td> - <td class="tablevalues" tal:condition="not:here/isManager" + <td class="tablevalues" tal:condition="not:editable" tal:content="here/maxNameLen">1</td> - <td class="tablevalues" tal:condition="here/isManager"> - <input tal:condition="here/isManager" + <td class="tablevalues" tal:condition="editable"> + <input tal:condition="editable" tal:attributes="class string:tablevalues; name string:maxNameLen; value here/maxNameLen"> </td> <td class="tableheader" align=left>Snmp Index</td> - <td class="tablevalues" tal:condition="not:here/isManager" + <td class="tablevalues" tal:condition="not:editable" tal:content="here/snmpindex">1</td> - <td class="tablevalues" tal:condition="here/isManager"> - <input tal:condition="here/isManager" + <td class="tablevalues" tal:condition="editable"> + <input tal:condition="editable" tal:attributes="class string:tablevalues; name string:snmpindex; value here/snmpindex"> @@ -167,7 +170,7 @@ Send event when blocked </td> </tr> - <tr tal:condition="here/isManager"> + <tr tal:condition="editable"> <td align="left" class="tableheader" colspan="4"> <input class="tableheader" type="submit" value=" Save " name="zmanage_editProperties:method" /> Modified: trunk/Products/ZenModel/skins/zenmodel/viewIpInterface.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/viewIpInterface.pt 2007-04-19 13:17:26 UTC (rev 4762) +++ trunk/Products/ZenModel/skins/zenmodel/viewIpInterface.pt 2007-04-19 14:07:38 UTC (rev 4763) @@ -2,12 +2,15 @@ <tal:block metal:fill-slot="contentPane"> <form method=post + tal:define="manager here/isManager; + userCreated here/isUserCreated" tal:attributes="action string:${here/absolute_url_path}"> <input type="hidden" name="zenScreenName" tal:attributes="value template/id" /> -<tal:block metal:define-macro="objectperf" tal:define=" - tabletitle string:IpInterface;"> +<tal:block metal:define-macro="objectperf" + tal:define="tabletitle string:IpInterface; + editable python:manager and userCreated"> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> <tal:block metal:fill-slot="zentablecontents"> @@ -15,27 +18,25 @@ <!-- BEGIN TABLE CONTENTS --> <tr> <td class="tableheader" align=left>Name</td> - <td class="tablevalues" tal:condition="not:here/isManager" + <td class="tablevalues" tal:condition="not:editable" tal:content="here/viewName">eth0</td> - <td class="tablevalues" tal:condition="here/isManager"> + <td class="tablevalues" tal:condition="editable"> <input tal:attributes="class string:tablevalues; name string:interfaceName; value here/interfaceName"> </td> <td class="tableheader" align=left>MAC Address</td> - <td class="tablevalues" tal:condition="not:here/isManager" + <td class="tablevalues" tal:condition="not:editable" tal:content="here/macaddress">00:11:22:AA:BB:CC</td> - <td class="tablevalues" tal:condition="here/isManager"> + <td class="tablevalues" tal:condition="editable"> <input tal:attributes="class string:tablevalues; name string:macaddress; value here/macaddress"> </td> </tr> <tr> - <td class="tablevalues" tal:condition="not:here/isManager" - tal:content="here/monitored"/> <td class="tableheader" align=left>IP Addresses</td> - <td class="tablevalues" colspan="3" tal:condition="not:here/isManager"> + <td class="tablevalues" colspan="3" tal:condition="not:editable"> <span tal:repeat="ip here/getIpAddressObjs" omit-tag=""> <a class="tablevalues" tal:condition="python:hasattr(ip,'getIpAddress')" @@ -46,8 +47,8 @@ tal:replace="ip">1.1.1.1/24</span> </span> </td> - <td class="tablevalues" colspan="3" tal:condition="here/isManager"> - <textarea tal:condition="here/isManager" + <td class="tablevalues" colspan="3" tal:condition="editable"> + <textarea tal:condition="editable" name="ips:lines" tal:attributes="class string:tablevalues; cols string:40; @@ -57,25 +58,25 @@ </tr> <tr> <td class="tableheader" align=left>Operational Status</td> - <td class="tablevalues" tal:condition="not:here/isManager" + <td class="tablevalues" tal:condition="not:editable" tal:content="python:here.operStatus==1 and 'Up' or 'Down'"> Up </td> - <td class="tablevalues" tal:condition="here/isManager"> + <td class="tablevalues" tal:condition="editable"> <select class="tablevalues" name="operStatus" - tal:condition="here/isManager"> + tal:condition="editable"> <option tal:repeat="e python:(1,0)" tal:content="python:e==1 and 'Up' or 'Down'" tal:attributes="value e; selected python:e==here.operStatus"/> </select> </td> <td class="tableheader" align=left>Administrative Status</td> - <td class="tablevalues" tal:condition="not:here/isManager" + <td class="tablevalues" tal:condition="not:editable" tal:content="python:here.adminStatus==1 and 'Up' or 'Down'"> Up </td> - <td class="tablevalues" tal:condition="here/isManager"> + <td class="tablevalues" tal:condition="editable"> <select class="tablevalues" name="adminStatus" - tal:condition="here/isManager"> + tal:condition="editable"> <option tal:repeat="e python:(1,0)" tal:content="python:e==1 and 'Up' or 'Down'" tal:attributes="value e; selected python:e==here.adminStatus"/> </select> @@ -83,17 +84,17 @@ </tr> <tr> <td class="tableheader" align=left>Type</td> - <td class="tablevalues" tal:condition="not:here/isManager" + <td class="tablevalues" tal:condition="not:editable" tal:content="here/type">Ethernet</td> - <td class="tablevalues" tal:condition="here/isManager"> + <td class="tablevalues" tal:condition="editable"> <input tal:attributes="class string:tablevalues; name string:type; value here/type"> </td> <td class="tableheader" align=left>Speed</td> - <td class="tablevalues" tal:condition="not:here/isManager" + <td class="tablevalues" tal:condition="not:editable" tal:content="here/speed">100000000</td> - <td class="tablevalues" tal:condition="here/isManager"> + <td class="tablevalues" tal:condition="editable"> <input tal:attributes="class string:tablevalues; name string:speed; value here/speed"> @@ -101,17 +102,17 @@ </tr> <tr> <td class="tableheader" align=left>MTU</td> - <td class="tablevalues" tal:condition="not:here/isManager" + <td class="tablevalues" tal:condition="not:editable" tal:content="here/mtu">1500</td> - <td class="tablevalues" tal:condition="here/isManager"> + <td class="tablevalues" tal:condition="editable"> <input tal:attributes="class string:tablevalues; name string:mtu; value here/mtu"> </td> <td class="tableheader" align=left>SNMP Index</td> - <td class="tablevalues" tal:condition="not:here/isManager" + <td class="tablevalues" tal:condition="not:editable" tal:content="here/ifindex">100000000</td> - <td class="tablevalues" tal:condition="here/isManager"> + <td class="tablevalues" tal:condition="editable"> <input tal:attributes="class string:tablevalues; name string:ifindex; value here/ifindex"> @@ -119,21 +120,23 @@ </tr> <tr> <td class="tableheader" align=left>Description</td> - <td class="tablevalues" tal:condition="not:here/isManager" + <td class="tablevalues" tal:condition="not:editable" tal:content="here/description">A nice interface</td> - <td class="tablevalues" tal:condition="here/isManager"> + <td class="tablevalues" tal:condition="editable"> <input tal:attributes="class string:tablevalues; name string:description; value here/description"> </td> <td class="tableheader">Monitor</td> - <td class="tablevalues" tal:condition="here/isManager"> + <td class="tablevalues" tal:condition="not:editable" + tal:content="here/monitored"/> + <td class="tablevalues" tal:condition="editable"> <select class="tablevalues" name="monitor:boolean" - tal:condition="here/isManager"> + tal:condition="editable"> <option tal:repeat="e python:(True,False)" tal:content="e" tal:attributes="value e; selected python:e==here.monitored()"/> </select> - <tal:block tal:condition="not:here/isManager" + <tal:block tal:condition="not:editable" tal:content="here/monitored"/> </td> </tr> @@ -146,7 +149,7 @@ <td class="tableheader" align=left>Lock warnings</td> <td class="tablevalues" tal:content="here/lockWarning">Send event when blocked</td> </tr> - <tr tal:condition="here/isManager"> + <tr tal:condition="editable"> <td align="left" class="tableheader" colspan="4"> <input class="tableheader" type="submit" value=" Save " name="zmanage_editProperties:method" /> Modified: trunk/Products/ZenModel/skins/zenmodel/winServiceDetail.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/winServiceDetail.pt 2007-04-19 13:17:26 UTC (rev 4762) +++ trunk/Products/ZenModel/skins/zenmodel/winServiceDetail.pt 2007-04-19 14:07:38 UTC (rev 4763) @@ -2,6 +2,8 @@ <tal:block metal:fill-slot="contentPane"> <form method=post + tal:define="manager here/isManager; + userCreated here/isUserCreated" tal:attributes="action string:${here/absolute_url_path}"> <input type="hidden" name="zenScreenName" tal:attributes="value template/id" /> @@ -9,7 +11,8 @@ <tal:block tal:define="message request/message | string:State at time:; tabletitle string:${message} ${here/getNowString}; - menu_id string:Lockable"> + menu_id string:Lockable; + editable python:manager and userCreated"> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> <!--====Optional titlebar slots============= @@ -32,25 +35,25 @@ </tr> <tr> <td class="tableheader">Description</td> - <td class="tablevalues" tal:condition="not:here/isManager" + <td class="tablevalues" tal:condition="not:editable" tal:content="here/description"/> - <td class="tablevalues" tal:condition="here/isManager"> - <input tal:condition="here/isManager" + <td class="tablevalues" tal:condition="editable"> + <input tal:condition="editable" tal:attributes="class string:tablevalues; name string:description; value here/description"/> </td> <td class="tableheader">Status</td> - <td tal:condition="here/isManager"> + <td tal:condition="editable"> <select class="tablevalues" name="status:int" - tal:condition="here/isManager"> + tal:condition="editable"> <option tal:repeat="status here/getStatusConversions" tal:content="python:status[0]" tal:attributes="value python:status[1]; selected python:status==here.getStatus()" /> </select> </td> - <td tal:condition="not:here/isManager" + <td tal:condition="not:editable" tal:define="status here/getStatus" tal:attributes="class python:here.getStatusCssClass(status)" tal:content="python:here.convertStatus(status)"/> @@ -59,41 +62,41 @@ <td class="tableheader">Monitor</td> <td class="tablevalues"> <select class="tablevalues" name="monitor:boolean" - tal:condition="here/isManager"> + tal:condition="editable"> <option tal:repeat="e python:(True,False)" tal:content="e" tal:attributes="value e; selected python:e==here.monitored()"/> </select> - <tal:block tal:condition="not:here/isManager" + <tal:block tal:condition="not:editable" tal:content="here/monitored"/> </td> <td class="tableheader">Fail Severity</td> <td class="tablevalues"> <select class="tableheader" name="severity:int" - tal:condition="here/isManager"> + tal:condition="editable"> <option tal:repeat="sev here/getSeverities" tal:content="python:sev[0]" tal:attributes="value python:sev[1]; selected python:sev[1] == here.getFailSeverity()" /> </select> - <tal:block tal:condition="not:here/isManager" + <tal:block tal:condition="not:editable" tal:content="here/getFailSeverityString"/> </td> </tr> <tr> <td class="tableheader">Service Type</td> - <td class="tablevalues" tal:condition="not:here/isManager" + <td class="tablevalues" tal:condition="not:editable" tal:content="here/serviceType"/> - <td class="tablevalues" tal:condition="here/isManager"> - <input tal:condition="here/isManager" + <td class="tablevalues" tal:condition="editable"> + <input tal:condition="editable" tal:attributes="class string:tablevalues; name string:serviceType; value here/serviceType"> </td> <td class="tableheader">Cmd Name</td> - <td class="tablevalues" tal:condition="not:here/isManager" + <td class="tablevalues" tal:condition="not:editable" tal:content="here/name"/> - <td class="tablevalues" tal:condition="here/isManager"> - <input tal:condition="here/isManager" + <td class="tablevalues" tal:condition="editable"> + <input tal:condition="editable" tal:attributes="class string:tablevalues; name string:name; value here/name"> @@ -101,19 +104,19 @@ </tr> <tr> <td class="tableheader">Start Mode</td> - <td class="tablevalues" tal:condition="not:here/isManager" + <td class="tablevalues" tal:condition="not:editable" tal:content="here/startMode"/> - <td class="tablevalues" tal:condition="here/isManager"> - <input tal:condition="here/isManager" + <td class="tablevalues" tal:condition="editable"> + <input tal:condition="editable" tal:attributes="class string:tablevalues; name string:startMode; value here/startMode"> </td> <td class="tableheader">Start Name</td> - <td class="tablevalues" tal:condition="not:here/isManager" + <td class="tablevalues" tal:condition="not:editable" tal:content="here/startName"/> - <td class="tablevalues" tal:condition="here/isManager"> - <input tal:condition="here/isManager" + <td class="tablevalues" tal:condition="editable"> + <input tal:condition="editable" tal:attributes="class string:tablevalues; name string:startName; value here/startName"> @@ -123,23 +126,23 @@ <td class="tableheader">Accept Pause</td> <td class="tablevalues"> <select class="tablevalues" name="acceptPause:boolean" - tal:condition="here/isManager"> + tal:condition="editable"> <option tal:repeat="e python:(True,False)" tal:content="e" tal:attributes="value e; selected python:e==here.acceptPause"/> </select> - <tal:block tal:condition="not:here/isManager" + <tal:block tal:condition="not:editable" tal:content="here/acceptPause"/> </td> <td class="tableheader">Accept Stop</td> <td class="tablevalues"> <select class="tablevalues" name="acceptStop:boolean" - tal:condition="here/isManager"> + tal:condition="editable"> <option tal:repeat="e python:(True,False)" tal:content="e" tal:attributes="value e; selected python:e==here.acceptStop"/> </select> - <tal:block tal:condition="not:here/isManager" + <tal:block tal:condition="not:editable" tal:content="here/acceptStop"/> </td> </tr> @@ -147,10 +150,10 @@ <td class="tableheader">Path Name</td> <td class="tablevalues" colspan="3" tal:content="here/pathName" - tal:condition="not:here/isManager"/> + tal:condition="not:editable"/> <td class="tablevalues" colspan="3" - tal:condition="here/isManager"> - <input tal:condition="here/isManager" + tal:condition="editable"> + <input tal:condition="editable" tal:attributes="class string:tablevalues; name string:pathName; value here/pathName"/> |
From: <sv...@ze...> - 2007-04-19 13:17:27
|
Author: marc Date: 2007-04-19 09:17:26 -0400 (Thu, 19 Apr 2007) New Revision: 4762 Modified: trunk/Products/ZenModel/Device.py trunk/Products/ZenModel/DeviceOrganizer.py trunk/Products/ZenModel/skins/zenmodel/dialog_resetIp.pt Log: #1231 * Fixed Reset Community for Device Organizers * Fixed Reset IP for Device Organizers * Fixed Model Devices for Device Organizers Modified: trunk/Products/ZenModel/Device.py =================================================================== --- trunk/Products/ZenModel/Device.py 2007-04-18 20:31:06 UTC (rev 4761) +++ trunk/Products/ZenModel/Device.py 2007-04-19 13:17:26 UTC (rev 4762) @@ -740,7 +740,7 @@ try: zSnmpCommunity, zSnmpPort, zSnmpVer, snmpname = \ findCommunity(self, self.manageIp, self.getDeviceClassPath(), - port=self.zSnmpPort, version=zSnmpVer) + port=self.zSnmpPort, version=self.zSnmpVer) except NoSnmp: pass else: Modified: trunk/Products/ZenModel/DeviceOrganizer.py =================================================================== --- trunk/Products/ZenModel/DeviceOrganizer.py 2007-04-18 20:31:06 UTC (rev 4761) +++ trunk/Products/ZenModel/DeviceOrganizer.py 2007-04-19 13:17:26 UTC (rev 4762) @@ -157,7 +157,6 @@ status += group.snmpStatus() return status - def setProdState(self, state, REQUEST=None): """Set production state of all devices in this Organizer. """ @@ -171,7 +170,28 @@ [ d.setPriority(priority) for d in self.getSubDevices() ] if REQUEST: return self.callZenScreen(REQUEST) - + + def manage_snmpCommunity(self, REQUEST=None): + """reset Community on all devices in this Organizer. + """ + [ d.manage_snmpCommunity() for d in self.getSubDevices() ] + if REQUEST: + return self.callZenScreen(REQUEST) + + def setManageIp(self, REQUEST=None): + """reset ip on all devices in this Organizer. + """ + [ d.setManageIp() for d in self.getSubDevices() ] + if REQUEST: + return self.callZenScreen(REQUEST) + + def collectDevice(self, REQUEST=None): + """model all devices in this Organizer. + """ + [ d.collectDevice() for d in self.getSubDevices() ] + if REQUEST: + return self.callZenScreen(REQUEST) + def _status(self, type, devrel="devices"): """build status info for device in this device group""" status = 0 Modified: trunk/Products/ZenModel/skins/zenmodel/dialog_resetIp.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/dialog_resetIp.pt 2007-04-18 20:31:06 UTC (rev 4761) +++ trunk/Products/ZenModel/skins/zenmodel/dialog_resetIp.pt 2007-04-19 13:17:26 UTC (rev 4762) @@ -1,14 +1,14 @@ <h2>Reset the manage IP of this device</h2> -<form action="_" method="post" - tal:define="device python:here.device()" - tal:attributes="action here/REQUEST/URL1"> - +<form action="_" method="post" tal:attributes="action here/REQUEST/URL1"> + <p> What manage IP would you like to set on this device? Leave blank to use DNS.<br/> +<tal:block tal:condition="python:getattr(here, 'device', None)"> <br/> <input type="text" name="ip" size="15" - tal:attributes="value device/getManageIp"/> + tal:attributes="value python:here.device().getManageIp()"/> +</tal:block> </p> <br/> <div id="dialog_buttons"> @@ -16,4 +16,4 @@ <input id="dialog_cancel" type="button" value="Cancel" onclick="$('dialog').hide()"/> </div> -</form> \ No newline at end of file +</form> \ No newline at end of file |
From: <sv...@ze...> - 2007-04-18 20:31:05
|
Author: ian Date: 2007-04-18 16:31:06 -0400 (Wed, 18 Apr 2007) New Revision: 4761 Modified: trunk/Products/ZenWidgets/skins/zenui/javascript/dialog.js Log: * Ensured that menu button and message slot z-indexes are below the dialog overlay Modified: trunk/Products/ZenWidgets/skins/zenui/javascript/dialog.js =================================================================== --- trunk/Products/ZenWidgets/skins/zenui/javascript/dialog.js 2007-04-18 20:28:19 UTC (rev 4760) +++ trunk/Products/ZenWidgets/skins/zenui/javascript/dialog.js 2007-04-18 20:31:06 UTC (rev 4761) @@ -78,7 +78,7 @@ var bdims = getElementDimensions(this.framework); setStyle(this.framework, {'z-index':'10002','display':'none'}); map(function(menu) {setStyle(menu, {'z-index':'3000'})}, - concat($$('.menu'), $$('.devmovemenu'))); + concat($$('.menu'), $$('.littlemenu'), $$('#messageSlot'))); setElementDimensions(this.dimbg, getViewportDimensions()); setElementPosition(this.dimbg, getViewportPosition()); setStyle(this.box, {'position':'relative'}); |
From: <sv...@ze...> - 2007-04-18 20:28:20
|
Author: ian Date: 2007-04-18 16:28:19 -0400 (Wed, 18 Apr 2007) New Revision: 4760 Modified: trunk/Products/ZenModel/skins/zenmodel/templates.pt trunk/Products/ZenModel/skins/zenmodel/zenoss.css Log: * Reskinned the message box to match the dialogs and menus Modified: trunk/Products/ZenModel/skins/zenmodel/templates.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/templates.pt 2007-04-18 19:43:36 UTC (rev 4759) +++ trunk/Products/ZenModel/skins/zenmodel/templates.pt 2007-04-18 20:28:19 UTC (rev 4760) @@ -183,19 +183,30 @@ <div metal:define-slot="infoBar"> <div metal:use-macro="here/templates/macros/breadCrumbPane"></div> </div> + <div id="messageSlot" tal:condition="python:hasattr(here.REQUEST,'message')"> -<img src="img/close.gif" style="position:absolute;top:3px;right:3px;" +<div class="dbox_tl"><div class="dbox_tr"><div class="dbox_tc"> +</div></div></div> +<div class="dbox_ml"><div class="dbox_mr"><div class="dbox_mc" +style="position:relative;"> + +<img src="img/close.gif" style="position:absolute;top:2px;right:2px;cursor:pointer" onclick="fade('messageSlot', {'duration':0.3} )"/> <span tal:content="here/REQUEST/message">Message</span> + +</div></div></div> +<div class="dbox_bl"><div class="dbox_br"><div class="dbox_bc"> +</div></div></div> +</div> <script> var pulseMessage = function() { showElement('messageSlot'); - pulsate('messageSlot', {pulses:2}); + pulsate('messageSlot', {pulses:2, duration:5}); } addLoadEvent(pulseMessage); </script> + </div> -</div> <!-- ====================================================== leftPane - standard left side and nav Modified: trunk/Products/ZenModel/skins/zenmodel/zenoss.css =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/zenoss.css 2007-04-18 19:43:36 UTC (rev 4759) +++ trunk/Products/ZenModel/skins/zenmodel/zenoss.css 2007-04-18 20:28:19 UTC (rev 4760) @@ -41,22 +41,21 @@ } #messageSlot { - color: red; font-weight: bold; position: absolute; - top: 3px; + top: 10px; right: 3px; padding: 0px 10px; display:none; - height: 45px; - line-height: 45px; - font-size: 13pt; - border: 1px solid red; - background-color: lemonchiffon; z-index:5000; padding-right: 30px; } +#messageSlot .dbox_mc { + padding-right: 30px; + font-size: 14px; +} + #leftPaneToggle { height: 30px; line-height: 30px; |
From: <sv...@ze...> - 2007-04-18 19:43:36
|
Author: jstevens Date: 2007-04-18 15:43:36 -0400 (Wed, 18 Apr 2007) New Revision: 4758 Modified: trunk/Products/ZenModel/DeviceClass.py trunk/Products/ZenModel/DeviceGroup.py trunk/Products/ZenModel/DeviceOrganizer.py trunk/Products/ZenModel/Location.py trunk/Products/ZenModel/MibOrganizer.py trunk/Products/ZenModel/OSProcessOrganizer.py trunk/Products/ZenModel/Organizer.py trunk/Products/ZenModel/ReportClass.py trunk/Products/ZenModel/ServiceOrganizer.py trunk/Products/ZenModel/System.py Log: fixes #1243 * Refactoring of several container classes to make IPNetwork no longer packable. That means Organizer is no longer packable but a bunch of its subclasses are (all except for IPNetwork I think.) Modified: trunk/Products/ZenModel/DeviceClass.py =================================================================== --- trunk/Products/ZenModel/DeviceClass.py 2007-04-18 19:28:44 UTC (rev 4757) +++ trunk/Products/ZenModel/DeviceClass.py 2007-04-18 19:43:36 UTC (rev 4758) @@ -38,6 +38,7 @@ from RRDTemplate import RRDTemplate from DeviceOrganizer import DeviceOrganizer +from ZenPackable import ZenPackable _marker = "__MARKER___" @@ -52,7 +53,7 @@ addDeviceClass = DTMLFile('dtml/addDeviceClass',globals()) -class DeviceClass(DeviceOrganizer): +class DeviceClass(DeviceOrganizer, ZenPackable): """ DeviceClass is a device organizer that manages the primary classification of device objects within the zenoss system. It manages properties @@ -80,7 +81,7 @@ default_catalog = 'deviceSearch' - _relations = DeviceOrganizer._relations + ( + _relations = DeviceOrganizer._relations + ZenPackable._relations + ( ("devices", ToManyCont(ToOne,"Products.ZenModel.Device","deviceClass")), ("rrdTemplates", ToManyCont(ToOne,"Products.ZenModel.RRDTemplate","deviceClass")), ) Modified: trunk/Products/ZenModel/DeviceGroup.py =================================================================== --- trunk/Products/ZenModel/DeviceGroup.py 2007-04-18 19:28:44 UTC (rev 4757) +++ trunk/Products/ZenModel/DeviceGroup.py 2007-04-18 19:43:36 UTC (rev 4758) @@ -17,6 +17,7 @@ from Products.ZenRelations.RelSchema import * from DeviceOrganizer import DeviceOrganizer +from ZenPackable import ZenPackable def manage_addDeviceGroup(context, id, description = None, REQUEST = None): """make a DeviceGroup""" @@ -32,7 +33,7 @@ -class DeviceGroup(DeviceOrganizer): +class DeviceGroup(DeviceOrganizer, ZenPackable): """ DeviceGroup is a DeviceGroup Organizer that allows generic device groupings. """ @@ -42,7 +43,7 @@ portal_type = meta_type = event_key = 'DeviceGroup' - _relations = DeviceOrganizer._relations + ( + _relations = DeviceOrganizer._relations + ZenPackable._relations + ( ("devices", ToMany(ToMany,"Products.ZenModel.Device","groups")), ) Modified: trunk/Products/ZenModel/DeviceOrganizer.py =================================================================== --- trunk/Products/ZenModel/DeviceOrganizer.py 2007-04-18 19:28:44 UTC (rev 4757) +++ trunk/Products/ZenModel/DeviceOrganizer.py 2007-04-18 19:43:36 UTC (rev 4758) @@ -25,7 +25,8 @@ from Products.ZenRelations.RelSchema import * -class DeviceOrganizer(Organizer, DeviceManagerBase, Commandable, ZenMenuable, MaintenanceWindowable, AdministrativeRoleable): +class DeviceOrganizer(Organizer, DeviceManagerBase, Commandable, ZenMenuable, + MaintenanceWindowable, AdministrativeRoleable): """ DeviceOrganizer is the base class for device organizers. It has lots of methods for rolling up device statistics and information. Modified: trunk/Products/ZenModel/Location.py =================================================================== --- trunk/Products/ZenModel/Location.py 2007-04-18 19:28:44 UTC (rev 4757) +++ trunk/Products/ZenModel/Location.py 2007-04-18 19:43:36 UTC (rev 4758) @@ -20,6 +20,7 @@ from Products.ZenRelations.RelSchema import * from DeviceOrganizer import DeviceOrganizer +from ZenPackable import ZenPackable def manage_addLocation(context, id, description = "", REQUEST = None): @@ -36,7 +37,7 @@ -class Location(DeviceOrganizer): +class Location(DeviceOrganizer, ZenPackable): """ Location is a DeviceGroup Organizer that manages physical device Locations. """ @@ -46,7 +47,7 @@ portal_type = meta_type = event_key = 'Location' - _relations = DeviceOrganizer._relations + ( + _relations = DeviceOrganizer._relations + ZenPackable._relations + ( ("devices", ToMany(ToOne,"Products.ZenModel.Device","location")), ("networks", ToMany(ToOne,"Products.ZenModel.IpNetwork","location")), ) Modified: trunk/Products/ZenModel/MibOrganizer.py =================================================================== --- trunk/Products/ZenModel/MibOrganizer.py 2007-04-18 19:28:44 UTC (rev 4757) +++ trunk/Products/ZenModel/MibOrganizer.py 2007-04-18 19:43:36 UTC (rev 4758) @@ -17,6 +17,7 @@ from Organizer import Organizer from MibModule import MibModule +from ZenPackable import ZenPackable def manage_addMibOrganizer(context, id, REQUEST = None): """make a device class""" @@ -29,7 +30,7 @@ addMibOrganizer = DTMLFile('dtml/addMibOrganizer',globals()) -class MibOrganizer(Organizer): +class MibOrganizer(Organizer, ZenPackable): """ DeviceOrganizer is the base class for device organizers. It has lots of methods for rolling up device statistics and information. @@ -40,7 +41,7 @@ security = ClassSecurityInfo() - _relations = Organizer._relations + ( + _relations = Organizer._relations + ZenPackable._relations + ( ("mibs", ToManyCont(ToOne,"Products.ZenModel.MibModule","miborganizer")), ) Modified: trunk/Products/ZenModel/OSProcessOrganizer.py =================================================================== --- trunk/Products/ZenModel/OSProcessOrganizer.py 2007-04-18 19:28:44 UTC (rev 4757) +++ trunk/Products/ZenModel/OSProcessOrganizer.py 2007-04-18 19:43:36 UTC (rev 4758) @@ -16,6 +16,7 @@ from Acquisition import aq_base from Commandable import Commandable from Products.ZenRelations.RelSchema import * +from ZenPackable import ZenPackable from Organizer import Organizer from OSProcessClass import OSProcessClass @@ -30,7 +31,7 @@ addOSProcessOrganizer = DTMLFile('dtml/addOSProcessOrganizer',globals()) -class OSProcessOrganizer(Organizer, Commandable): +class OSProcessOrganizer(Organizer, Commandable, ZenPackable): meta_type = "OSProcessOrganizer" dmdRootName = "Processes" #default_catalog = "osprocessSearch" @@ -41,7 +42,7 @@ {'id':'description', 'type':'text', 'mode':'w'}, ) - _relations = Organizer._relations + ( + _relations = Organizer._relations + ZenPackable._relations + ( ("osProcessClasses", ToManyCont( ToOne,"Products.ZenModel.OSProcessClass","osProcessOrganizer")), ('userCommands', ToManyCont(ToOne, 'Products.ZenModel.UserCommand', 'commandable')), Modified: trunk/Products/ZenModel/Organizer.py =================================================================== --- trunk/Products/ZenModel/Organizer.py 2007-04-18 19:28:44 UTC (rev 4757) +++ trunk/Products/ZenModel/Organizer.py 2007-04-18 19:43:36 UTC (rev 4758) @@ -23,7 +23,7 @@ from ZenModelRM import ZenModelRM from ZenPackable import ZenPackable -class Organizer(ZenModelRM, EventView, ZenPackable): +class Organizer(ZenModelRM, EventView): """ OrganizerBase class is base for all hierarchical organization classes. It allows Organizers to be addressed and created with file system like @@ -37,7 +37,7 @@ {'id':'description', 'type':'string', 'mode':'w'}, ) - _relations = ZenModelRM._relations + ZenPackable._relations + _relations = ZenModelRM._relations security = ClassSecurityInfo() security.declareObjectProtected("View") Modified: trunk/Products/ZenModel/ReportClass.py =================================================================== --- trunk/Products/ZenModel/ReportClass.py 2007-04-18 19:28:44 UTC (rev 4757) +++ trunk/Products/ZenModel/ReportClass.py 2007-04-18 19:43:36 UTC (rev 4758) @@ -23,6 +23,7 @@ from Organizer import Organizer from Report import Report +from ZenPackable import ZenPackable def manage_addReportClass(context, id, title = None, REQUEST = None): """make a device class""" @@ -34,12 +35,14 @@ addReportClass = DTMLFile('dtml/addReportClass',globals()) -class ReportClass(Organizer): +class ReportClass(Organizer, ZenPackable): dmdRootName = "Reports" portal_type = meta_type = "ReportClass" sub_meta_types = ("ReportClass", "Report", 'DeviceReport') + _relations = Organizer._relations + ZenPackable._relations + # Screen action bindings (and tab definitions) factory_type_information = ( { Modified: trunk/Products/ZenModel/ServiceOrganizer.py =================================================================== --- trunk/Products/ZenModel/ServiceOrganizer.py 2007-04-18 19:28:44 UTC (rev 4757) +++ trunk/Products/ZenModel/ServiceOrganizer.py 2007-04-18 19:43:36 UTC (rev 4758) @@ -15,6 +15,7 @@ from Acquisition import aq_base from Commandable import Commandable from ZenMenuable import ZenMenuable +from ZenPackable import ZenPackable from Products.ZenRelations.RelSchema import * @@ -31,7 +32,7 @@ addServiceOrganizer = DTMLFile('dtml/addServiceOrganizer',globals()) -class ServiceOrganizer(Organizer, Commandable): +class ServiceOrganizer(Organizer, Commandable, ZenPackable): meta_type = "ServiceOrganizer" dmdRootName = "Services" default_catalog = "serviceSearch" @@ -42,7 +43,7 @@ {'id':'description', 'type':'text', 'mode':'w'}, ) - _relations = Organizer._relations + ( + _relations = Organizer._relations + ZenPackable._relations + ( ("serviceclasses", ToManyCont(ToOne,"Products.ZenModel.ServiceClass","serviceorganizer")), ('userCommands', ToManyCont(ToOne, 'Products.ZenModel.UserCommand', 'commandable')), ) Modified: trunk/Products/ZenModel/System.py =================================================================== --- trunk/Products/ZenModel/System.py 2007-04-18 19:28:44 UTC (rev 4757) +++ trunk/Products/ZenModel/System.py 2007-04-18 19:43:36 UTC (rev 4758) @@ -22,6 +22,7 @@ from Products.ZenUtils.Utils import travAndColl from DeviceOrganizer import DeviceOrganizer +from ZenPackable import ZenPackable def manage_addSystem(context, id, description = None, REQUEST = None): @@ -38,7 +39,7 @@ -class System(DeviceOrganizer): +class System(DeviceOrganizer, ZenPackable): """ System class is a device organizer that represents a business system. May need to manage "services" as well so that more sophisticated @@ -58,7 +59,7 @@ {'id':'systemClass', 'type':'string', 'mode':'w'}, {'id':'description', 'type':'text', 'mode':'w'}, ) - _relations = DeviceOrganizer._relations + ( + _relations = DeviceOrganizer._relations + ZenPackable._relations + ( ("devices", ToMany(ToMany, "Products.ZenModel.Device", "systems")), ) |
From: <sv...@ze...> - 2007-04-18 19:43:36
|
Author: ecn Date: 2007-04-18 15:43:36 -0400 (Wed, 18 Apr 2007) New Revision: 4759 Added: trunk/Products/OFolder/README2.txt Log: * add a readme to point to the original author Added: trunk/Products/OFolder/README2.txt |
From: <sv...@ze...> - 2007-04-18 19:28:44
|
Author: ecn Date: 2007-04-18 15:28:44 -0400 (Wed, 18 Apr 2007) New Revision: 4757 Added: trunk/Products/GenericSetup/LICENSE.txt Log: add license to be compliant with copyright Added: trunk/Products/GenericSetup/LICENSE.txt |
From: <sv...@ze...> - 2007-04-18 19:25:59
|
Author: ecn Date: 2007-04-18 15:25:58 -0400 (Wed, 18 Apr 2007) New Revision: 4756 Added: trunk/Products/CMFCore/LICENSE.txt Log: add license to be compliant with copyright Added: trunk/Products/CMFCore/LICENSE.txt |
From: <sv...@ze...> - 2007-04-18 19:25:07
|
Author: jstevens Date: 2007-04-18 15:25:03 -0400 (Wed, 18 Apr 2007) New Revision: 4755 Modified: trunk/Products/ZenModel/skins/zenmodel/dialog_resetIp.pt Log: fixes #1230 Modified: trunk/Products/ZenModel/skins/zenmodel/dialog_resetIp.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/dialog_resetIp.pt 2007-04-18 19:22:43 UTC (rev 4754) +++ trunk/Products/ZenModel/skins/zenmodel/dialog_resetIp.pt 2007-04-18 19:25:03 UTC (rev 4755) @@ -5,7 +5,7 @@ tal:attributes="action here/REQUEST/URL1"> <p> -What manage IP would you like to set on this device?<br/> +What manage IP would you like to set on this device? Leave blank to use DNS.<br/> <br/> <input type="text" name="ip" size="15" tal:attributes="value device/getManageIp"/> |
From: <sv...@ze...> - 2007-04-18 19:22:49
|
Author: jstevens Date: 2007-04-18 15:22:43 -0400 (Wed, 18 Apr 2007) New Revision: 4754 Modified: trunk/Products/ZenHub/services/RRDService.py trunk/Products/ZenHub/services/WebConfig.py trunk/Products/ZenModel/RRDDataSource.py Log: Cleaning up/improvements in zenweb and pagecheckdatasource Modified: trunk/Products/ZenHub/services/RRDService.py =================================================================== --- trunk/Products/ZenHub/services/RRDService.py 2007-04-18 19:19:31 UTC (rev 4753) +++ trunk/Products/ZenHub/services/RRDService.py 2007-04-18 19:22:43 UTC (rev 4754) @@ -11,21 +11,126 @@ from HubService import HubService from Products.ZenRRD.RRDUtil import RRDUtil +from Products.ZenRRD.ThresholdManager import ThresholdManager, Threshold + class RRDService(HubService): def __init__(self, dmd, instance): HubService.__init__(self, dmd, instance) + # rrd is a dictionary of RRDUtil instances self.rrd = {} + # counts is a dictionary of integers tracking how many times + # each threshold has been exceeded sequentially. + self.counts = {} + + + def remote_writeRRD(self, devId, compType, compId, dpName, value): + ''' Write the given data to it's rrd file. + Also check any thresholds and send events if value is out of bounds. + ''' + dev = self.getDeviceOrComponent(devId, compType, compId) + dp = d.getDataPoint(dpName) + rrdKey = (dev.getPrimaryPath(), dp.getPrimaryPath()) + if self.rrd.has_key(key): + rrd = self.rrd[rrdKey] + else: + rrd = self.rrd.setdefault(rrdKey, + RRDUtil(dp.createCmd or self.getDefaultRRDCreateCommand(), + dp.datasource.cycletime)) + value = rrd.save(os.path.join(dev.rrdPath(), dp.name), + value, + dp.rrdtype, + dp.createCmd or self.getDefaultRRDCreateCommand(), + dp.datasource.cycleTime, + dp.rrdmin, + dp.rrdmax) + self.checkThresholds(dev, dp, value) + return value - def remote_writeRRD(self, path, value, rrdType, rrdCmd, cycleTime=None, - minv='U', maxv='U'): - if self.rrd.has_key(path): - rrd = self.rrd[path] - else: - rrd = RRDUtil(rrdCmd, cycleTime) - self.rrd[path] = rrd - value = rrd.save(path, value, rrdType, rrdCmd, cycleTime, minv, maxv) - return value + def getDefaultRRDCreateCommand(self): + ''' Return the rrd create command to be used if a datapoint doesn't + explicitly give one. + ''' + raise 'Not Implemented' + + + def getDeviceOrComponent(deviceId, compId, compType): + ''' If a compId is given then try to return that component. If unable + to find it or if compId is not specified then try to return the + given device. If unable to find then return None. + ''' + d = None + device = self.dmd.Devices.findDevice(deviceId) + if device: + if componentId: + for component in device.getDeviceComponents(): + if component.meta_type == componentType \ + and component.id == componentId: + d = component + break + else: + d = device + return d + + + def checkThresholds(self, dev, dp, value): + ''' Check the given value against any thresholds. Count the number of + times a dp has exceeded a given threshold in self.counts. Send events + as appropriate. + ''' + if value is None: + return + # Loop through the enabled thresholds on the template containing + # this datapoint. + for t in [t for t in dp.datasource.rrdTemplate.thresholds() + if t.enabled and dp.name() in t.dsnames()]: + countKey = (dev.getPrimaryPath(), dp.getPrimaryPath(), t.id) + count = self.status.setdefault(countKey, 0) + limit = None + how = None + maxv = t.getMaxval(dev) + if maxv is not None and value > maxv: + limit = maxv + how = 'exceeded' + else: + minv = t.getMinval(dev) + if minv is not None and value < minv: + limit = minv + how = 'not met' + # Only need to take action if threshold was exceeded or if it was + # previously exceeded. + if how or count: + if dev.meta_type == 'Device': + devId = dev.id + compId = '' + else: + devId = dev.device().id + compId = dev.id + if how: + self.counts[countKey] += 1 + severity = t.severity + if t.escalateCount and count >= t.escalateCount: + severity += 1 + summary = ('%s %s threshold of %s %s:' % + (devId, dp.name(), limit, how) + + ' current value %.2f' % float(value)) + else: + self.counts[countKey] = 0 + severity = 0 + summary = ('%s %s threshold restored' % + (devId, dp.name()) + + ' current value: %.2f' % float(value)) + self.zenm.sendEvent( + device=devId, + summary=summary, + eventClass=t.eventClass, + eventKey=dp.name(), + component=compId, + severity=severity) + + + + Modified: trunk/Products/ZenHub/services/WebConfig.py =================================================================== --- trunk/Products/ZenHub/services/WebConfig.py 2007-04-18 19:19:31 UTC (rev 4753) +++ trunk/Products/ZenHub/services/WebConfig.py 2007-04-18 19:22:43 UTC (rev 4754) @@ -9,70 +9,69 @@ ZenHub service for handling zenweb configuration ''' -from HubService import HubService +from PerformanceConfig import PerformanceConfig +import transaction +import logging +log = logging.getLogger("zenhub") -class WebConfig(HubService): +class WebConfig(PerformanceConfig): def __init__(self, dmd, instance): - HubService.__init__(self, dmd, instance) - self.monitor = self.dmd.Monitors.Performance._getOb(self.instance) + PerformanceConfig.__init__(self, dmd, instance) def remote_getPageChecks(self): pageChecks = [] - for dev in self.monitor.devices(): + for dev in self.config.devices(): dev = dev.primaryAq() pageChecks += self.getDevicePageChecks(dev) return pageChecks - - - def remote_getPageCheckUpdates(self): - return self.remote_getPageChecks() - def remote_getDefaultRRDCreateCommand(self): - return self.monitor.getDefaultRRDCreateCommand() - - def getDevicePageChecks(self, dev): result = [] + log.debug('Getting pagechecks for %s' % dev.id) if not dev.monitorDevice(): + log.warn('Not monitoring %' % dev.id) return result for templ in dev.getRRDTemplates(): - threshs = dev.getThresholds(templ) dataSources = templ.getRRDDataSources('PAGECHECK') - for ds in dataSources: - if not ds.enabled: continue + for ds in [d for d in dataSources if d.enabled]: points = [{'id': dp.id, - 'path': '/'.join((dev.rrdPath(), dp.name())), - 'rrdType': dp.rrdtype, - 'rrdCmd': dp.createCmd, - 'minv': dp.rrdmin, - 'maxv': dp.rrdmax, - 'thesholds': threshs.get(dp.name(), []), + #'path': '/'.join((dev.rrdPath(), dp.name())), + #'rrdType': dp.rrdtype, + #'rrdCmd': dp.createCmd, + #'minv': dp.rrdmin, + #'maxv': dp.rrdmax, + #'thesholds': threshs.get(dp.name(), []), } for dp in ds.getRRDDataPoints()] - key = ds.eventKey or ds.id result.append({ - 'device': dev.id, + 'devId': dev.id, 'manageIp': dev.manageIp, - 'timeout': dev.zCommandCommandTimeout, - 'datasource': ds.id or '', - 'datapoints': points or (), - 'defaultRrdCmd': - self.monitor.getDefaultRRDCreateCommand(), + 'timeout': dp.pagecheckTimeout, + 'datasource': ds.id, + 'datapoints': points, 'cycletime': ds.cycletime or '', - 'component': ds.component or '', + 'compId': ds.component or '', 'eventClass': ds.eventClass or '', - 'eventKey': key or '', - 'severity': ds.severity or '', + 'eventKey': ds.eventKey or ds.id, + 'severity': ds.severity or 0, 'userAgent': ds.userAgent or '', - 'recording': ds.recording or '', 'initialUrl': ds.initialURL or '', 'command': ds.getCommand(dev) or '', - 'commandHash': ds.commandHash or '', }) + log.debug('%s pagechecks for %s', len(result), dev.id) return result + def getDeviceConfig(self, device): + "How to get the config for a device" + return self.getDevicePageChecks(device) + + + def sendDeviceConfig(self, listener, config): + "How to send the config to a device, probably via callRemote" + return listener.callRemote('updateDeviceConfig', config) + Modified: trunk/Products/ZenModel/RRDDataSource.py =================================================================== --- trunk/Products/ZenModel/RRDDataSource.py 2007-04-18 19:19:31 UTC (rev 4753) +++ trunk/Products/ZenModel/RRDDataSource.py 2007-04-18 19:22:43 UTC (rev 4754) @@ -168,11 +168,13 @@ return self.callZenScreen(REQUEST) - def getCommand(self, context): + def getCommand(self, context, cmd=None): """Return localized command target. """ # Perform a TALES eval on the expression using self - exp = "string:"+ self.commandTemplate + if cmd is None: + cmd = self.commandTemplate + exp = "string:"+ cmd compiled = talesCompile(exp) d = context.device() environ = {'dev' : d, |
From: <sv...@ze...> - 2007-04-18 19:19:34
|
Author: jstevens Date: 2007-04-18 15:19:31 -0400 (Wed, 18 Apr 2007) New Revision: 4753 Modified: trunk/Products/ZenWidgets/skins/zenui/dialog_addNetwork.pt Log: refs #1241 Modified: trunk/Products/ZenWidgets/skins/zenui/dialog_addNetwork.pt =================================================================== --- trunk/Products/ZenWidgets/skins/zenui/dialog_addNetwork.pt 2007-04-18 19:09:08 UTC (rev 4752) +++ trunk/Products/ZenWidgets/skins/zenui/dialog_addNetwork.pt 2007-04-18 19:19:31 UTC (rev 4753) @@ -1,10 +1,10 @@ <h2>Add Network</h2> <table> -<tr><td>Name: </td><td><input name="id"/></td></tr> +<tr><td>Name: </td><td><input name="newPath"/></td></tr> </table> <div id="dialog_buttons"> <input type="submit" name="manage_addOrganizer:method" - value="Add Organizer" + value="Add Network" tal:attributes="onclick string:return $$('dialog').submit_form( '${here/getPrimaryUrlPath}')" /> <input id="dialog_cancel" type="button" value="Cancel" |
From: <sv...@ze...> - 2007-04-18 19:09:10
|
Author: jstevens Date: 2007-04-18 15:09:08 -0400 (Wed, 18 Apr 2007) New Revision: 4752 Added: trunk/Products/ZenWidgets/skins/zenui/dialog_addNetwork.pt Log: fixes #1241 * dialog for the add network menu item Added: trunk/Products/ZenWidgets/skins/zenui/dialog_addNetwork.pt |
From: <sv...@ze...> - 2007-04-18 18:50:34
|
Author: marc Date: 2007-04-18 14:50:35 -0400 (Wed, 18 Apr 2007) New Revision: 4751 Modified: trunk/Products/ZenEvents/ActionRule.py trunk/Products/ZenEvents/Availability.py trunk/Products/ZenEvents/EventCommand.py trunk/Products/ZenEvents/MySqlEventManager.py trunk/Products/ZenEvents/MySqlSendEvent.py trunk/Products/ZenEvents/tests/testMySqlEventManager.py trunk/Products/ZenEvents/tests/testMySqlSendEvent.py trunk/Products/ZenEvents/zenactions.py trunk/Products/ZenModel/migrate/command.py trunk/Products/ZenModel/migrate/devicepriority.py trunk/Products/ZenModel/migrate/eventclassmapping.py trunk/Products/ZenModel/migrate/innodb.py trunk/Products/ZenModel/migrate/reindex_history.py trunk/Products/ZenReports/plugins/threshold.py Log: * Moved connect calls out of try, finally blocks to expose connection errors Modified: trunk/Products/ZenEvents/ActionRule.py =================================================================== --- trunk/Products/ZenEvents/ActionRule.py 2007-04-18 18:45:06 UTC (rev 4750) +++ trunk/Products/ZenEvents/ActionRule.py 2007-04-18 18:50:35 UTC (rev 4751) @@ -193,9 +193,9 @@ def _clearAlertState(self): """Clear state in alert_state before we are deleted. """ + zem = self.dmd.ZenEventManager + conn = zem.connect() try: - zem = self.dmd.ZenEventManager - conn = zem.connect() delcmd = "delete from alert_state where %s" % self.sqlwhere() log.debug("clear alert state '%s'", delcmd) curs = conn.cursor() Modified: trunk/Products/ZenEvents/Availability.py =================================================================== --- trunk/Products/ZenEvents/Availability.py 2007-04-18 18:45:06 UTC (rev 4750) +++ trunk/Products/ZenEvents/Availability.py 2007-04-18 18:50:35 UTC (rev 4751) @@ -119,8 +119,8 @@ ') AS U ' % env) devices = {} + conn = zem.connect() try: - conn = zem.connect() curs = conn.cursor() curs.execute(s) while 1: Modified: trunk/Products/ZenEvents/EventCommand.py =================================================================== --- trunk/Products/ZenEvents/EventCommand.py 2007-04-18 18:45:06 UTC (rev 4750) +++ trunk/Products/ZenEvents/EventCommand.py 2007-04-18 18:50:35 UTC (rev 4751) @@ -75,9 +75,9 @@ def _clearAlertState(self): """Clear state in alert_state before we are deleted. """ + zem = self.dmd.ZenEventManager + conn = zem.connect() try: - zem = self.dmd.ZenEventManager - conn = zem.connect() delcmd = "delete from alert_state where %s" % self.sqlwhere() curs = self.dmd.ZenEventManager.cursor() curs.execute(delcmd) Modified: trunk/Products/ZenEvents/MySqlEventManager.py =================================================================== --- trunk/Products/ZenEvents/MySqlEventManager.py 2007-04-18 18:45:06 UTC (rev 4750) +++ trunk/Products/ZenEvents/MySqlEventManager.py 2007-04-18 18:50:35 UTC (rev 4751) @@ -100,8 +100,8 @@ ''' count = 0 zem = self.dmd.ZenEventManager + conn = zem.connect() try: - conn = zem.connect() curs = conn.cursor() for table in ('status', 'history'): sql = 'select count(*) from status ' \ Modified: trunk/Products/ZenEvents/MySqlSendEvent.py =================================================================== --- trunk/Products/ZenEvents/MySqlSendEvent.py 2007-04-18 18:45:06 UTC (rev 4750) +++ trunk/Products/ZenEvents/MySqlSendEvent.py 2007-04-18 18:50:35 UTC (rev 4751) @@ -203,8 +203,8 @@ insert += " on duplicate key update lastTime=Null" insert += ", timeout=%s" % evdict['timeout'] try: + conn = self.connect() try: - conn = self.connect() curs = conn.cursor() execute(curs, insert) finally: self.close(conn) Modified: trunk/Products/ZenEvents/tests/testMySqlEventManager.py =================================================================== --- trunk/Products/ZenEvents/tests/testMySqlEventManager.py 2007-04-18 18:45:06 UTC (rev 4750) +++ trunk/Products/ZenEvents/tests/testMySqlEventManager.py 2007-04-18 18:50:35 UTC (rev 4751) @@ -29,9 +29,9 @@ def tearDown(self): transaction.abort() + zem = self.dmd.ZenEventManager + conn = zem.connect() try: - zem = self.dmd.ZenEventManager - conn = zem.connect() curs = conn.cursor() curs.execute("truncate status") curs.execute("truncate detail") Modified: trunk/Products/ZenEvents/tests/testMySqlSendEvent.py =================================================================== --- trunk/Products/ZenEvents/tests/testMySqlSendEvent.py 2007-04-18 18:45:06 UTC (rev 4750) +++ trunk/Products/ZenEvents/tests/testMySqlSendEvent.py 2007-04-18 18:50:35 UTC (rev 4751) @@ -20,9 +20,9 @@ def tearDown(self): transaction.abort() + zem = self.dmd.ZenEventManager + conn = zem.connect() try: - zem = self.dmd.ZenEventManager - conn = zem.connect() curs = conn.cursor() zem.curs.execute("truncate status") finally: zem.close(conn) Modified: trunk/Products/ZenEvents/zenactions.py =================================================================== --- trunk/Products/ZenEvents/zenactions.py 2007-04-18 18:45:06 UTC (rev 4750) +++ trunk/Products/ZenEvents/zenactions.py 2007-04-18 18:50:35 UTC (rev 4751) @@ -153,8 +153,8 @@ self.lastCommand = stmt self.log.debug(stmt) zem = self.dmd.ZenEventManager + conn = zem.connect() try: - conn = zem.connect() curs = conn.cursor() result = curs.execute(stmt) finally: zem.close(conn) @@ -166,8 +166,8 @@ self.lastCommand = stmt self.log.debug(stmt) zem = self.dmd.ZenEventManager + conn = zem.connect() try: - conn = zem.connect() curs = conn.cursor() curs.execute(stmt) result = curs.fetchall() Modified: trunk/Products/ZenModel/migrate/command.py =================================================================== --- trunk/Products/ZenModel/migrate/command.py 2007-04-18 18:45:06 UTC (rev 4750) +++ trunk/Products/ZenModel/migrate/command.py 2007-04-18 18:50:35 UTC (rev 4751) @@ -22,9 +22,9 @@ os.path.join(os.environ['ZENHOME'], 'libexec')) if dmd.Devices.hasProperty("zNagiosCycleTime"): dmd.Devices._delProperty("zNagiosCycleTime") + zem = self.dmd.ZenEventManager + conn = zem.connect() try: - zem = self.dmd.ZenEventManager - conn = zem.connect() curs = conn.cursor() for name in 'zenagios', 'zencacti': curs.execute('DELETE FROM heartbeat where component = "%s"' % name) Modified: trunk/Products/ZenModel/migrate/devicepriority.py =================================================================== --- trunk/Products/ZenModel/migrate/devicepriority.py 2007-04-18 18:45:06 UTC (rev 4750) +++ trunk/Products/ZenModel/migrate/devicepriority.py 2007-04-18 18:50:35 UTC (rev 4751) @@ -61,9 +61,9 @@ version = Migrate.Version(1, 1, 0) def cutover(self, dmd): + zem = self.dmd.ZenEventManager + conn = zem.connect() try: - zem = self.dmd.ZenEventManager - conn = zem.connect() curs = conn.cursor() cmd = 'ALTER TABLE %s ADD COLUMN ' + \ '(DevicePriority smallint(6) default 3)' Modified: trunk/Products/ZenModel/migrate/eventclassmapping.py =================================================================== --- trunk/Products/ZenModel/migrate/eventclassmapping.py 2007-04-18 18:45:06 UTC (rev 4750) +++ trunk/Products/ZenModel/migrate/eventclassmapping.py 2007-04-18 18:50:35 UTC (rev 4751) @@ -60,9 +60,9 @@ version = Migrate.Version(1, 2, 0) def cutover(self, dmd): + zem = dmd.ZenEventManager + conn = zem.connect() try: - zem = dmd.ZenEventManager - conn = zem.connect() curs = conn.cursor() for table in ('status', 'history'): try: Modified: trunk/Products/ZenModel/migrate/innodb.py =================================================================== --- trunk/Products/ZenModel/migrate/innodb.py 2007-04-18 18:45:06 UTC (rev 4750) +++ trunk/Products/ZenModel/migrate/innodb.py 2007-04-18 18:50:35 UTC (rev 4751) @@ -14,9 +14,9 @@ version = Migrate.Version(1, 0, 0) def cutover(self, dmd): + zem = self.dmd.ZenEventManager + conn = zem.connect() try: - zem = self.dmd.ZenEventManager - conn = zem.connect() curs = conn.cursor() curs.execute('SHOW TABLE STATUS') for row in curs.fetchall(): Modified: trunk/Products/ZenModel/migrate/reindex_history.py =================================================================== --- trunk/Products/ZenModel/migrate/reindex_history.py 2007-04-18 18:45:06 UTC (rev 4750) +++ trunk/Products/ZenModel/migrate/reindex_history.py 2007-04-18 18:50:35 UTC (rev 4751) @@ -25,9 +25,9 @@ pass def cutover(self, dmd): + zem = dmd.ZenEventManager + conn = zem.connect() try: - zem = dmd.ZenEventManager - conn = zem.connect() curs = conn.cursor() self.execute(curs, 'ALTER TABLE history DROP INDEX DateRange') self.execute(curs, 'ALTER TABLE history ADD INDEX firstTime (firstTime)') Modified: trunk/Products/ZenReports/plugins/threshold.py =================================================================== --- trunk/Products/ZenReports/plugins/threshold.py 2007-04-18 18:45:06 UTC (rev 4750) +++ trunk/Products/ZenReports/plugins/threshold.py 2007-04-18 18:50:35 UTC (rev 4751) @@ -43,9 +43,9 @@ sum = {} counts = {} + zem = dmd.ZenEventManager + conn = zem.connect() try: - zem = dmd.ZenEventManager - conn = zem.connect() curs = conn.cursor() curs.execute(query) startDate = args['startDate'] |
From: <sv...@ze...> - 2007-04-18 18:45:30
|
Author: marc Date: 2007-04-18 14:45:06 -0400 (Wed, 18 Apr 2007) New Revision: 4750 Added: trunk/Products/ZenModel/skins/zenmodel/dialog_setPriority.pt trunk/Products/ZenModel/skins/zenmodel/dialog_setProductionState.pt Modified: trunk/Products/ZenEvents/EventClass.py trunk/Products/ZenEvents/EventClassInst.py trunk/Products/ZenModel/Device.py trunk/Products/ZenModel/DeviceClass.py trunk/Products/ZenModel/DeviceOrganizer.py trunk/Products/ZenModel/IpNetwork.py trunk/Products/ZenModel/IpService.py trunk/Products/ZenModel/IpServiceClass.py trunk/Products/ZenModel/Manufacturer.py trunk/Products/ZenModel/OSProcess.py trunk/Products/ZenModel/OSProcessClass.py trunk/Products/ZenModel/OSProcessOrganizer.py trunk/Products/ZenModel/OperatingSystem.py trunk/Products/ZenModel/ProductClass.py trunk/Products/ZenModel/ServiceClass.py trunk/Products/ZenModel/ServiceOrganizer.py trunk/Products/ZenModel/System.py trunk/Products/ZenModel/migrate/menus.py trunk/Products/ZenModel/skins/zenmodel/deviceOrganizerManage.pt Log: #1229 * See ticket for fixes Modified: trunk/Products/ZenEvents/EventClass.py =================================================================== --- trunk/Products/ZenEvents/EventClass.py 2007-04-18 18:36:40 UTC (rev 4749) +++ trunk/Products/ZenEvents/EventClass.py 2007-04-18 18:45:06 UTC (rev 4750) @@ -92,17 +92,17 @@ , 'permissions' : ( Permissions.view, ) }, - #{ 'id' : 'config' - #, 'name' : 'zProperties' - #, 'action' : 'zPropertyEdit' - #, 'permissions' : ("Change Device",) - #}, - { 'id' : 'viewHistory' - , 'name' : 'Changes' - , 'action' : 'viewHistory' - , 'permissions' : ( - Permissions.view, ) + { 'id' : 'config' + , 'name' : 'zProperties' + , 'action' : 'zPropertyEdit' + , 'permissions' : ("Change Device",) }, +# { 'id' : 'viewHistory' +# , 'name' : 'Changes' +# , 'action' : 'viewHistory' +# , 'permissions' : ( +# Permissions.view, ) +# }, ) }, ) Modified: trunk/Products/ZenEvents/EventClassInst.py =================================================================== --- trunk/Products/ZenEvents/EventClassInst.py 2007-04-18 18:36:40 UTC (rev 4749) +++ trunk/Products/ZenEvents/EventClassInst.py 2007-04-18 18:45:06 UTC (rev 4750) @@ -94,21 +94,21 @@ , 'action' : 'eventClassInstStatus' , 'permissions' : (Permissions.view, ) }, - #{ 'id' : 'edit' - #, 'name' : 'Edit' - #, 'action' : 'eventClassInstEdit' - #, 'permissions' : ("Manage DMD", ) - #}, + { 'id' : 'edit' + , 'name' : 'Edit' + , 'action' : 'eventClassInstEdit' + , 'permissions' : ("Manage DMD", ) + }, #{ 'id' : 'sequence' #, 'name' : 'Sequence' #, 'action' : 'eventClassInstSequence' #, 'permissions' : (Permissions.view,) #}, - #{ 'id' : 'config' - #, 'name' : 'zProperties' - #, 'action' : 'zPropertyEdit' - #, 'permissions' : ("Manage DMD",) - #}, + { 'id' : 'config' + , 'name' : 'zProperties' + , 'action' : 'zPropertyEdit' + , 'permissions' : ("Manage DMD",) + }, { 'id' : 'events' , 'name' : 'Events' , 'action' : 'viewEvents' @@ -119,11 +119,11 @@ , 'action' : 'viewHistoryEvents' , 'permissions' : (Permissions.view, ) }, - { 'id' : 'viewHistory' - , 'name' : 'Changes' - , 'action' : 'viewHistory' - , 'permissions' : (Permissions.view, ) - }, + #{ 'id' : 'viewHistory' + #, 'name' : 'Changes' + #, 'action' : 'viewHistory' + #, 'permissions' : (Permissions.view, ) + #}, ) }, ) Modified: trunk/Products/ZenModel/Device.py =================================================================== --- trunk/Products/ZenModel/Device.py 2007-04-18 18:36:40 UTC (rev 4749) +++ trunk/Products/ZenModel/Device.py 2007-04-18 18:45:06 UTC (rev 4750) @@ -292,11 +292,11 @@ # , 'action' : 'objRRDTemplate' # , 'permissions' : ("Change Device", ) # }, -# { 'id' : 'edit' -# , 'name' : 'Edit' -# , 'action' : 'editDevice' -# , 'permissions' : ("Change Device",) -# }, + { 'id' : 'edit' + , 'name' : 'Edit' + , 'action' : 'editDevice' + , 'permissions' : ("Change Device",) + }, # { 'id' : 'management' # , 'name' : 'Manage' # , 'action' : 'deviceManagement' @@ -312,11 +312,16 @@ # , 'action' : 'zPropertyEdit' # , 'permissions' : (permissions.view,) # }, - { 'id' : 'viewHistory' - , 'name' : 'Changes' - , 'action' : 'viewHistory' - , 'permissions' : (permissions.view, ) - }, +# { 'id' : 'viewHistory' +# , 'name' : 'Changes' +# , 'action' : 'viewHistory' +# , 'permissions' : (permissions.view, ) +# }, +# { 'id' : 'zProperties' +# , 'name' : 'zProperties' +# , 'action' : 'zPropertyEdit' +# , 'permissions' : ( permissions.view, ) +# }, ) }, ) @@ -845,36 +850,40 @@ return self.convertStatus(self.getSnmpStatus()) security.declareProtected('Change Device', 'setProdState') - def setProdState(self, state): + def setProdState(self, state, REQUEST=None): """Set a device's production state as an integer. """ self.productionState = int(state) try: zem = self.dmd.ZenEventManager + conn = zem.connect() try: - conn = zem.connect() curs = conn.cursor() curs.execute("update status set prodState=%d where device='%s'" % ( self.productionState, self.id)) finally: zem.close(conn) except OperationalError: log.exception("failed to update events with new prodState") - + if REQUEST: + return self.callZenScreen(REQUEST) + security.declareProtected('Change Device', 'setPriority') - def setPriority(self, priority): + def setPriority(self, priority, REQUEST=None): """ Set a device's priority as an integer. """ self.priority = int(priority) try: zem = self.dmd.ZenEventManager + conn = zem.connect() try: - conn = zem.connect() curs = conn.cursor() curs.execute("update status set DevicePriority=%d where device='%s'" % ( self.priority, self.id)) finally: zem.close(conn) except OperationalError: log.exception("failed to update events with new priority") + if REQUEST: + return self.callZenScreen(REQUEST) security.declareProtected('Change Device', 'setLastChange') def setLastChange(self, value=None): Modified: trunk/Products/ZenModel/DeviceClass.py =================================================================== --- trunk/Products/ZenModel/DeviceClass.py 2007-04-18 18:36:40 UTC (rev 4749) +++ trunk/Products/ZenModel/DeviceClass.py 2007-04-18 18:45:06 UTC (rev 4750) @@ -112,11 +112,11 @@ , 'action' : 'viewEvents' , 'permissions' : ( permissions.view, ) }, - { 'id' : 'historyEvents' - , 'name' : 'History' - , 'action' : 'viewHistoryEvents' - , 'permissions' : ( permissions.view, ) - }, +# { 'id' : 'historyEvents' +# , 'name' : 'History' +# , 'action' : 'viewHistoryEvents' +# , 'permissions' : ( permissions.view, ) +# }, ) }, ) Modified: trunk/Products/ZenModel/DeviceOrganizer.py =================================================================== --- trunk/Products/ZenModel/DeviceOrganizer.py 2007-04-18 18:36:40 UTC (rev 4749) +++ trunk/Products/ZenModel/DeviceOrganizer.py 2007-04-18 18:45:06 UTC (rev 4750) @@ -157,12 +157,20 @@ return status - def setProdState(self, state): + def setProdState(self, state, REQUEST=None): """Set production state of all devices in this Organizer. """ [ d.setProdState(state) for d in self.getSubDevices() ] - - + if REQUEST: + return self.callZenScreen(REQUEST) + + def setPriority(self, priority, REQUEST=None): + """Set production state of all devices in this Organizer. + """ + [ d.setPriority(priority) for d in self.getSubDevices() ] + if REQUEST: + return self.callZenScreen(REQUEST) + def _status(self, type, devrel="devices"): """build status info for device in this device group""" status = 0 Modified: trunk/Products/ZenModel/IpNetwork.py =================================================================== --- trunk/Products/ZenModel/IpNetwork.py 2007-04-18 18:36:40 UTC (rev 4749) +++ trunk/Products/ZenModel/IpNetwork.py 2007-04-18 18:45:06 UTC (rev 4750) @@ -100,17 +100,17 @@ , 'permissions' : ( permissions.view, ) }, -# { 'id' : 'config' -# , 'name' : 'zProperties' -# , 'action' : 'zPropertyEdit' -# , 'permissions' : ("Manage DMD",) + { 'id' : 'zProperties' + , 'name' : 'zProperties' + , 'action' : 'zPropertyEdit' + , 'permissions' : ("Manage DMD",) + }, +# { 'id' : 'viewHistory' +# , 'name' : 'Changes' +# , 'action' : 'viewHistory' +# , 'permissions' : ( +# permissions.view, ) # }, - { 'id' : 'viewHistory' - , 'name' : 'Changes' - , 'action' : 'viewHistory' - , 'permissions' : ( - permissions.view, ) - }, ) }, ) Modified: trunk/Products/ZenModel/IpService.py =================================================================== --- trunk/Products/ZenModel/IpService.py 2007-04-18 18:36:40 UTC (rev 4749) +++ trunk/Products/ZenModel/IpService.py 2007-04-18 18:45:06 UTC (rev 4750) @@ -84,12 +84,12 @@ # , 'action' : 'ipServiceManage' # , 'permissions' : ("Manage DMD",) # }, - { 'id' : 'viewHistory' - , 'name' : 'Changes' - , 'action' : 'viewHistory' - , 'permissions' : ( - Permissions.view, ) - }, +# { 'id' : 'viewHistory' +# , 'name' : 'Changes' +# , 'action' : 'viewHistory' +# , 'permissions' : ( +# Permissions.view, ) +# }, ) }, ) Modified: trunk/Products/ZenModel/IpServiceClass.py =================================================================== --- trunk/Products/ZenModel/IpServiceClass.py 2007-04-18 18:36:40 UTC (rev 4749) +++ trunk/Products/ZenModel/IpServiceClass.py 2007-04-18 18:45:06 UTC (rev 4750) @@ -57,27 +57,27 @@ , 'permissions' : ( Permissions.view, ) }, -# { 'id' : 'edit' -# , 'name' : 'Edit' -# , 'action' : 'ipServiceClassEdit' -# , 'permissions' : ("Manage DMD", ) -# }, + { 'id' : 'edit' + , 'name' : 'Edit' + , 'action' : 'ipServiceClassEdit' + , 'permissions' : ("Manage DMD", ) + }, # { 'id' : 'manage' # , 'name' : 'Manage' # , 'action' : 'ipServiceClassManage' # , 'permissions' : ("Manage DMD",) # }, -# { 'id' : 'zproperties' -# , 'name' : 'zProperties' -# , 'action' : 'zPropertyEdit' -# , 'permissions' : ("Change Device",) + { 'id' : 'zproperties' + , 'name' : 'zProperties' + , 'action' : 'zPropertyEdit' + , 'permissions' : ("Change Device",) + }, +# { 'id' : 'viewHistory' +# , 'name' : 'Changes' +# , 'action' : 'viewHistory' +# , 'permissions' : ( +# Permissions.view, ) # }, - { 'id' : 'viewHistory' - , 'name' : 'Changes' - , 'action' : 'viewHistory' - , 'permissions' : ( - Permissions.view, ) - }, ) }, ) Modified: trunk/Products/ZenModel/Manufacturer.py =================================================================== --- trunk/Products/ZenModel/Manufacturer.py 2007-04-18 18:36:40 UTC (rev 4749) +++ trunk/Products/ZenModel/Manufacturer.py 2007-04-18 18:45:06 UTC (rev 4750) @@ -84,16 +84,16 @@ #, 'action' : 'editManufacturer' #, 'permissions' : ("Manage DMD", ) #}, -# { 'id' : 'config' -# , 'name' : 'zProperties' -# , 'action' : 'zPropertyEdit' -# , 'permissions' : ("Manage DMD",) + { 'id' : 'config' + , 'name' : 'zProperties' + , 'action' : 'zPropertyEdit' + , 'permissions' : ("Manage DMD",) + }, +# { 'id' : 'viewHistory' +# , 'name' : 'Changes' +# , 'action' : 'viewHistory' +# , 'permissions' : (permissions.view, ) # }, - { 'id' : 'viewHistory' - , 'name' : 'Changes' - , 'action' : 'viewHistory' - , 'permissions' : (permissions.view, ) - }, ) }, ) Modified: trunk/Products/ZenModel/OSProcess.py =================================================================== --- trunk/Products/ZenModel/OSProcess.py 2007-04-18 18:36:40 UTC (rev 4749) +++ trunk/Products/ZenModel/OSProcess.py 2007-04-18 18:45:06 UTC (rev 4750) @@ -74,11 +74,11 @@ # , 'action' : 'osProcessManage' # , 'permissions' : ("Manage DMD",) # }, - { 'id' : 'viewHistory' - , 'name' : 'Changes' - , 'action' : 'viewHistory' - , 'permissions' : ( Permissions.view, ) - }, +# { 'id' : 'viewHistory' +# , 'name' : 'Changes' +# , 'action' : 'viewHistory' +# , 'permissions' : ( Permissions.view, ) +# }, ) }, ) Modified: trunk/Products/ZenModel/OSProcessClass.py =================================================================== --- trunk/Products/ZenModel/OSProcessClass.py 2007-04-18 18:36:40 UTC (rev 4749) +++ trunk/Products/ZenModel/OSProcessClass.py 2007-04-18 18:45:06 UTC (rev 4750) @@ -67,27 +67,27 @@ , 'permissions' : ( Permissions.view, ) }, - #{ 'id' : 'edit' - #, 'name' : 'Edit' - #, 'action' : 'osProcessClassEdit' - #, 'permissions' : ("Manage DMD", ) - #}, + { 'id' : 'edit' + , 'name' : 'Edit' + , 'action' : 'osProcessClassEdit' + , 'permissions' : ("Manage DMD", ) + }, #{ 'id' : 'manage' #, 'name' : 'Manage' #, 'action' : 'osProcessClassManage' #, 'permissions' : ("Manage DMD",) #}, - #{ 'id' : 'zproperties' - #, 'name' : 'zProperties' - #, 'action' : 'zPropertyEdit' - #, 'permissions' : ("Change Device",) - #}, - { 'id' : 'viewHistory' - , 'name' : 'Changes' - , 'action' : 'viewHistory' - , 'permissions' : ( - Permissions.view, ) + { 'id' : 'zproperties' + , 'name' : 'zProperties' + , 'action' : 'zPropertyEdit' + , 'permissions' : ("Change Device",) }, +# { 'id' : 'viewHistory' +# , 'name' : 'Changes' +# , 'action' : 'viewHistory' +# , 'permissions' : ( +# Permissions.view, ) +# }, ) }, ) Modified: trunk/Products/ZenModel/OSProcessOrganizer.py =================================================================== --- trunk/Products/ZenModel/OSProcessOrganizer.py 2007-04-18 18:36:40 UTC (rev 4749) +++ trunk/Products/ZenModel/OSProcessOrganizer.py 2007-04-18 18:45:06 UTC (rev 4750) @@ -63,17 +63,17 @@ # , 'action' : 'osProcessOrganizerManage' # , 'permissions' : ("Manage DMD",) # }, -# { 'id' : 'zproperties' -# , 'name' : 'zProperties' -# , 'action' : 'zPropertyEdit' -# , 'permissions' : ("Change Device",) + { 'id' : 'zproperties' + , 'name' : 'zProperties' + , 'action' : 'zPropertyEdit' + , 'permissions' : ("Change Device",) + }, +# { 'id' : 'viewHistory' +# , 'name' : 'Changes' +# , 'action' : 'viewHistory' +# , 'permissions' : ( +# Permissions.view, ) # }, - { 'id' : 'viewHistory' - , 'name' : 'Changes' - , 'action' : 'viewHistory' - , 'permissions' : ( - Permissions.view, ) - }, ) }, ) Modified: trunk/Products/ZenModel/OperatingSystem.py =================================================================== --- trunk/Products/ZenModel/OperatingSystem.py 2007-04-18 18:36:40 UTC (rev 4749) +++ trunk/Products/ZenModel/OperatingSystem.py 2007-04-18 18:45:06 UTC (rev 4750) @@ -112,6 +112,11 @@ , 'action' : '../viewHistory' , 'permissions' : (permissions.view, ) }, + { 'id' : 'edit' + , 'name' : 'Edit' + , 'action' : '../editDevice' + , 'permissions' : ("Change Device",) + }, ) }, ) Modified: trunk/Products/ZenModel/ProductClass.py =================================================================== --- trunk/Products/ZenModel/ProductClass.py 2007-04-18 18:36:40 UTC (rev 4749) +++ trunk/Products/ZenModel/ProductClass.py 2007-04-18 18:45:06 UTC (rev 4750) @@ -62,22 +62,22 @@ , 'permissions' : ( permissions.view, ) }, - #{ 'id' : 'edit' - #, 'name' : 'Edit' - #, 'action' : 'editProductClass' - #, 'permissions' : ("Manage DMD", ) + { 'id' : 'edit' + , 'name' : 'Edit' + , 'action' : 'editProductClass' + , 'permissions' : ("Manage DMD", ) + }, + { 'id' : 'config' + , 'name' : 'zProperties' + , 'action' : 'zPropertyEdit' + , 'permissions' : ("Manage DMD",) + }, + #{ 'id' : 'viewHistory' + #, 'name' : 'Changes' + #, 'action' : 'viewHistory' + #, 'permissions' : ( + # permissions.view, ) #}, - #{ 'id' : 'config' - #, 'name' : 'zProperties' - #, 'action' : 'zPropertyEdit' - #, 'permissions' : ("Manage DMD",) - #}, - { 'id' : 'viewHistory' - , 'name' : 'Changes' - , 'action' : 'viewHistory' - , 'permissions' : ( - permissions.view, ) - }, ) }, ) Modified: trunk/Products/ZenModel/ServiceClass.py =================================================================== --- trunk/Products/ZenModel/ServiceClass.py 2007-04-18 18:36:40 UTC (rev 4749) +++ trunk/Products/ZenModel/ServiceClass.py 2007-04-18 18:45:06 UTC (rev 4750) @@ -80,27 +80,27 @@ , 'permissions' : ( Permissions.view, ) }, -# { 'id' : 'edit' -# , 'name' : 'Edit' -# , 'action' : 'serviceClassEdit' -# , 'permissions' : ("Manage DMD", ) -# }, + { 'id' : 'edit' + , 'name' : 'Edit' + , 'action' : 'serviceClassEdit' + , 'permissions' : ("Manage DMD", ) + }, # { 'id' : 'manage' # , 'name' : 'Manage' # , 'action' : 'serviceClassManage' # , 'permissions' : ("Manage DMD",) # }, -# { 'id' : 'zproperties' -# , 'name' : 'zProperties' -# , 'action' : 'zPropertyEdit' -# , 'permissions' : ("Change Device",) + { 'id' : 'zproperties' + , 'name' : 'zProperties' + , 'action' : 'zPropertyEdit' + , 'permissions' : ("Change Device",) + }, +# { 'id' : 'viewHistory' +# , 'name' : 'Changes' +# , 'action' : 'viewHistory' +# , 'permissions' : ( +# Permissions.view, ) # }, - { 'id' : 'viewHistory' - , 'name' : 'Changes' - , 'action' : 'viewHistory' - , 'permissions' : ( - Permissions.view, ) - }, ) }, ) Modified: trunk/Products/ZenModel/ServiceOrganizer.py =================================================================== --- trunk/Products/ZenModel/ServiceOrganizer.py 2007-04-18 18:36:40 UTC (rev 4749) +++ trunk/Products/ZenModel/ServiceOrganizer.py 2007-04-18 18:45:06 UTC (rev 4750) @@ -68,17 +68,17 @@ # , 'action' : 'serviceOrganizerManage' # , 'permissions' : ("Manage DMD",) # }, -# { 'id' : 'zproperties' -# , 'name' : 'zProperties' -# , 'action' : 'zPropertyEdit' -# , 'permissions' : ("Change Device",) + { 'id' : 'zproperties' + , 'name' : 'zProperties' + , 'action' : 'zPropertyEdit' + , 'permissions' : ("Change Device",) + }, +# { 'id' : 'viewHistory' +# , 'name' : 'Changes' +# , 'action' : 'viewHistory' +# , 'permissions' : ( +# Permissions.view, ) # }, - { 'id' : 'viewHistory' - , 'name' : 'Changes' - , 'action' : 'viewHistory' - , 'permissions' : ( - Permissions.view, ) - }, ) }, ) Modified: trunk/Products/ZenModel/System.py =================================================================== --- trunk/Products/ZenModel/System.py 2007-04-18 18:36:40 UTC (rev 4749) +++ trunk/Products/ZenModel/System.py 2007-04-18 18:45:06 UTC (rev 4750) @@ -103,12 +103,12 @@ #, 'action' : 'deviceOrganizerManage' #, 'permissions' : ('Manage DMD',) #}, - { 'id' : 'viewHistory' - , 'name' : 'Changes' - , 'action' : 'viewHistory' - , 'permissions' : ( - permissions.view, ) - }, + #{ 'id' : 'viewHistory' + #, 'name' : 'Changes' + #, 'action' : 'viewHistory' + #, 'permissions' : ( + # permissions.view, ) + #}, ) }, ) Modified: trunk/Products/ZenModel/migrate/menus.py =================================================================== --- trunk/Products/ZenModel/migrate/menus.py 2007-04-18 18:36:40 UTC (rev 4749) +++ trunk/Products/ZenModel/migrate/menus.py 2007-04-18 18:45:06 UTC (rev 4750) @@ -69,6 +69,17 @@ dmd.buildMenus( { 'Edit':[ + dict(action='viewHistory', + allowed_classes=['Device', + 'DeviceClass', + 'EventClass', + 'EventClassInst', + 'DeviceOrganizer',], + description='Changes', + ordering=0.0, + id='viewHistory', + permissions=('Change Device',) + ), dict(action='objRRDTemplate', allowed_classes=['Device', 'FileSystem', @@ -126,24 +137,17 @@ isdialog=True, permissions=('Change Device',) ), - dict(action='editStatusMonitorConf', - allowed_classes=['StatusMonitorConf'], - description='Edit', - ordering=5.0, - id='editStatusMonitorConf', - permissions=('Manage DMD',) - ), dict(action='pushConfig', allowed_classes=['DeviceClass', 'Device'], - description='Push Changes to Collectors', + description='Push Changes', ordering=6.0, id='pushConfig', permissions=('Change Device',) ), dict(action='../pushConfig', allowed_classes=['OperatingSystem'], - description='Push Changes to Collectors', + description='Push Changes', ordering=7.0, id='pushConfig_os', permissions=('Change Device',) @@ -162,20 +166,6 @@ id='deviceCustomEdit_os', permissions=('View',) ), - dict(action='eventClassInstEdit', - allowed_classes=['EventClassInst'], - description='Edit', - ordering=10.0, - id='eventClassInstEdit', - permissions=('Manage DMD',) - ), - dict(action='ipServiceClassEdit', - allowed_classes=['IpServiceClass'], - description='Edit', - ordering=11.0, - id='ipServiceClassEdit', - permissions=('Manage DMD',) - ), dict(action='deviceManagement', allowed_classes=['Device'], description='Manage', @@ -190,10 +180,6 @@ id='deviceManagement_os', permissions=('Change Device',) ), - - - - dict(action='serviceOrganizerManage', allowed_classes=['ServiceOrganizer'], description='Manage', @@ -215,13 +201,6 @@ id='ipServiceClassManage', permissions=('Manage DMD',) ), - dict(action='editManufacturer', - allowed_classes=['Manufacturer'], - description='Edit', - ordering=17.0, - id='editManufacturer', - permissions=('Manage DMD',) - ), dict(action='osProcessManage', allowed_classes=['OSProcess'], description='Manage', @@ -236,13 +215,6 @@ id='serviceClassManage', permissions=('Manage DMD',) ), - dict(action='editPerformanceConf', - allowed_classes=['PerformanceConf'], - description='Edit', - ordering=20.0, - id='editPerformanceConf', - permissions=('Manage DMD',) - ), dict(action='ipServiceManage', allowed_classes=['IpService'], description='Manage', @@ -250,13 +222,6 @@ id='ipServiceManage', permissions=('Manage DMD',) ), - dict(action='editProductClass', - allowed_classes=['ProductClass'], - description='Edit', - ordering=22.0, - id='editProductClass', - permissions=('Manage DMD',) - ), dict(action='osProcessClassManage', allowed_classes=['OSProcessClass'], description='Manage', @@ -274,21 +239,7 @@ ordering=24.0, id='deviceOrganizerManage', permissions=('Manage DMD',) - ), - dict(action='editDevice', - allowed_classes=['Device'], - description='Edit', - ordering=25.0, - id='editDevice', - permissions=('Change Device',) - ), - dict(action='../editDevice', - allowed_classes=['OperatingSystem'], - description='Edit', - ordering=26.0, - id='editDevice_os', - permissions=('Change Device',) - ), + ), dict(action='winServiceManage', allowed_classes=['WinService'], description='Manage', @@ -296,6 +247,34 @@ id='winServiceManage', permissions=('Manage DMD',) ), + dict(action='editStatusMonitorConf', + allowed_classes=['StatusMonitorConf'], + description='Edit', + ordering=5.0, + id='editStatusMonitorConf', + permissions=('Manage DMD',) + ), + dict(action='editManufacturer', + allowed_classes=['Manufacturer'], + description='Edit', + ordering=17.0, + id='editManufacturer', + permissions=('Manage DMD',) + ), + dict(action='editPerformanceConf', + allowed_classes=['PerformanceConf'], + description='Edit', + ordering=20.0, + id='editPerformanceConf', + permissions=('Manage DMD',) + ), + dict(action='editProductClass', + allowed_classes=['ProductClass'], + description='Edit', + ordering=22.0, + id='editProductClass', + permissions=('Manage DMD',) + ), dict(action='eventClassInstSequence', allowed_classes=['EventClassInst'], description='Sequence', @@ -303,40 +282,25 @@ id='eventClassInstSequence', permissions=('View',) ), - dict(action='osProcessClassEdit', - allowed_classes=['OSProcessClass'], - description='Edit', - ordering=29.0, - id='osProcessClassEdit', - permissions=('Manage DMD',) - ), dict(action='performanceTemplates', allowed_classes=['DeviceClass'], - description='All Performance Templates', + description='All Templates', ordering=30.0, id='performanceTemplates', permissions=('View Device',) ), dict(action='perfConfig', allowed_classes=['DeviceClass'], - description='Perf Config', + description='Available Templates', ordering=31.0, id='perfConfig', permissions=('Change Device',) ), dict(action='zPropertyEdit', allowed_classes=['Device', - 'DeviceClass', - 'IpNetwork', - 'IpServiceClass', 'Manufacturer', - 'OSProcessClass', - 'OSProcessOrganizer', 'ProductClass', - 'ServiceClass', - 'ServiceOrganizer', - 'EventClassInst', - 'EventClass'], + ], description='zProperties', ordering=32.0, id='zPropertyEdit', @@ -349,13 +313,6 @@ id='zPropertyEdit_os', permissions=('View',) ), - dict(action='serviceClassEdit', - allowed_classes=['ServiceClass'], - description='Edit', - ordering=34.0, - id='serviceClassEdit', - permissions=('Manage DMD',) - ), ], 'Organizer_list': [ ZenPackItems, @@ -934,11 +891,29 @@ ), dict( ordering=2.0, + id= 'setProductionState', + description='Set Production State', + action= 'dialog_setProductionState', + permissions=('Change Device',), + isdialog=True, + allowed_classes = ('Device','OperatingSystem','DeviceClass','DeviceGroup','Location','System'), + ), + dict( + ordering=2.0, + id= 'setPriority', + description='Set Priority', + action= 'dialog_setPriority', + isdialog=True, + permissions=('Change Device',), + allowed_classes = ('Device','OperatingSystem','DeviceClass','DeviceGroup','Location','System'), + ), + dict( + ordering=2.0, id= 'modelDevice', description='Model Device', action= 'collectDevice', permissions=('Change Device',), - allowed_classes = ('Device','OperatingSystem'), + allowed_classes = ('Device','OperatingSystem','DeviceClass','DeviceGroup','Location','System'), ), dict( ordering=3.0, @@ -947,7 +922,7 @@ action= 'dialog_resetIp', isdialog=True, permissions=('Change Device',), - allowed_classes = ('Device','OperatingSystem'), + allowed_classes = ('Device','OperatingSystem','DeviceClass','DeviceGroup','Location','System'), ), dict( ordering=4.0, @@ -955,7 +930,7 @@ description='Reset Community', action= 'manage_snmpCommunity', permissions=('Change Device',), - allowed_classes = ('Device','OperatingSystem'), + allowed_classes = ('Device','OperatingSystem','DeviceClass','DeviceGroup','Location','System'), ), dict( ordering=5.0, @@ -1042,8 +1017,8 @@ ), dict( ordering=8.0, - id= 'addReport', - description='Add Report...', + id= 'addDeviceReport', + description='Add Device Report...', action= 'dialog_addReport', isdialog=True, permissions=('Change Device',), Modified: trunk/Products/ZenModel/skins/zenmodel/deviceOrganizerManage.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/deviceOrganizerManage.pt 2007-04-18 18:36:40 UTC (rev 4749) +++ trunk/Products/ZenModel/skins/zenmodel/deviceOrganizerManage.pt 2007-04-18 18:45:06 UTC (rev 4750) @@ -1,63 +1,6 @@ <tal:block metal:use-macro="here/templates/macros/page2"> <tal:block metal:fill-slot="contentPane"> - -<form action="_" method="post" tal:attributes="action here/REQUEST/URL1"> -<input type="hidden" name="zenScreenName" - tal:attributes="value template/id" /> - - -<tal:block tal:define=" -tabletitle string:Device Management; - "> -<tal:block metal:use-macro="here/zenuimacros/macros/zentable"> - -<!--==================== -Optional titlebar stuff - -<tal:block metal:fill-slot="menuslot"> -</tal:block> -<tal:block metal:fill-slot="filterslot"> -</tal:block> - - ====================--> - -<tal:block metal:fill-slot="zentablecontents"> - -<!-- BEGIN TABLE CONTENTS --> - - <span metal:use-macro="here/userCommandsMacros/macros/runCommand" /> - - <tr> - <td class="tableheader"> - Set the Production State of all Devices within this Organizer - </td> - <td class="tableheader"> - <select class="tableheader" name="state:int" - tal:define=" - pstates here/getProdStateConversions; - curstate device/productionState | - request/productionState | python:1000" - > - <option tal:repeat="pstate pstates" - tal:attributes="value python:pstate[1]; - selected python:curstate == pstate[1]" - tal:content="python:pstate[0]">localhost</option> - </select> - <input class="tableheader" type="submit" name="setProdState:method" - value="Change" /> - </td> - </tr> -<!-- END TABLE CONTENTS --> - -</tal:block> -</tal:block> -</tal:block> - -</form> - -<br/> - <span metal:use-macro="here/userCommandsMacros/macros/userCommandsTable" /> <span metal:use-macro="here/templates/macros/contentSeparator"/> Added: trunk/Products/ZenModel/skins/zenmodel/dialog_setPriority.pt Added: trunk/Products/ZenModel/skins/zenmodel/dialog_setProductionState.pt |
From: <sv...@ze...> - 2007-04-18 18:36:45
|
Author: ian Date: 2007-04-18 14:36:40 -0400 (Wed, 18 Apr 2007) New Revision: 4749 Added: trunk/Products/ZenWidgets/skins/zenui/img/dbox/ trunk/Products/ZenWidgets/skins/zenui/img/dbox/corners.gif trunk/Products/ZenWidgets/skins/zenui/img/dbox/l.gif trunk/Products/ZenWidgets/skins/zenui/img/dbox/r.gif trunk/Products/ZenWidgets/skins/zenui/img/dbox/tb.gif Modified: trunk/Products/ZenWidgets/skins/zenui/css/dialog.css trunk/Products/ZenWidgets/skins/zenui/dialogmacros.pt trunk/Products/ZenWidgets/skins/zenui/javascript/dialog.js Log: * fixes #1022: Reskinned the dialogs. Modified: trunk/Products/ZenWidgets/skins/zenui/css/dialog.css =================================================================== --- trunk/Products/ZenWidgets/skins/zenui/css/dialog.css 2007-04-18 17:31:49 UTC (rev 4748) +++ trunk/Products/ZenWidgets/skins/zenui/css/dialog.css 2007-04-18 18:36:40 UTC (rev 4749) @@ -1,13 +1,18 @@ -.dialog { +#dialog { + margin: 0; + padding: 0; + position: relative; + top: -5px; +} + +.dialog_container { min-height: 200px; min-width: 300px; - background-color: lightyellow; - border: 2px solid darkgrey; - position: absolute; - padding: 2em; display:none; + padding: 0; } + .dialog input, .dialog select{ border: 1px solid darkgrey; @@ -19,17 +24,16 @@ color: grey; line-height: 1.2em; position: absolute; - top: 2px; - right: 2px; + top: 0px; + right: -2px; cursor: pointer; } #dialog_buttons { - position:absolute; - bottom: 0px; - right:0px; padding: 1em; - text-align:center; + text-align:right; + position: relative; + top: 10px; } #dialog_buttons input { @@ -41,6 +45,73 @@ background-color: lightgrey; } +#dialog_content { + position:relative; +} + +#dialog_innercontent { + position:relative; + padding-top: 23px; +} +.dbox_tl { + background: transparent url(img/dbox/corners.gif) no-repeat scroll left 0pt; +} +.dbox_tc { + background: transparent url(img/dbox/tb.gif) repeat-x scroll 0pt; + height: 8px; + overflow:hidden; +} +.dbox_tr { + background: transparent url(img/dbox/corners.gif) no-repeat scroll right -8px; +} +.dbox_ml { + background: transparent url(img/dbox/l.gif) repeat-y scroll 0pt 50%; + overflow: hidden; + padding-left:4px; +} +.dbox_mc { + background: #666 url(img/dbox/tb.gif) repeat-x scroll 0pt -16px; + color: white; + opacity: 0.95; + font-family: "Tahoma","Helvetica","Arial",sans-serif; + font-size: 12px; + padding: 4px 10px; +} +.dbox_mc h3 { + display:inline; + font-size: 14px; + font-weight: bold; +} +.dbox_mr { + background: transparent url(img/dbox/r.gif) repeat-y scroll right center; + overflow: hidden; + padding-right:4px; +} +.dbox_bl { + background:transparent url(img/dbox/corners.gif) no-repeat scroll 0pt -16px; +} +.dbox_bc { + background: transparent url(img/dbox/tb.gif) repeat-x scroll 0pt -8px; + height: 8px; + overflow: hidden; +} +.dbox_br { + background: transparent url(img/dbox/corners.gif) no-repeat scroll right -24px; +} +.dbox_tl, .dbox_bl { + overflow: hidden; + padding-left: 8px; +} +.dbox_tr, .dbox_br { + overflow: hidden; + padding-right: 8px; +} + + + + + + /* IE HACKS */ * html .dialog { Modified: trunk/Products/ZenWidgets/skins/zenui/dialogmacros.pt =================================================================== --- trunk/Products/ZenWidgets/skins/zenui/dialogmacros.pt 2007-04-18 17:31:49 UTC (rev 4748) +++ trunk/Products/ZenWidgets/skins/zenui/dialogmacros.pt 2007-04-18 18:36:40 UTC (rev 4749) @@ -3,16 +3,16 @@ <script src="javascript/dialog.js"></script> <link href="css/dialog.css" rel="stylesheet" type="text/css" /> <div id="dialog" class="dialog"> -<img id="dialog_close" src="img/close.gif" class="dialog_close"/> -<div id="dialog_content"> +<div id="dialog_innercontent"> <tal:block metal:define-slot="dialog_content"> This is a dialog box. </tal:block> </div> +<img id="dialog_close" src="img/close.gif" class="dialog_close"/> </div> <script> -new Dialog.Box($('dialog')); -connect('dialog_close','onclick',function(){$('dialog').hide()}); +var mydialog = new Dialog.Box($('dialog')); +connect('dialog_close','onclick', mydialog.box.hide); </script> </tal:block> Added: trunk/Products/ZenWidgets/skins/zenui/img/dbox/corners.gif Property changes on: trunk/Products/ZenWidgets/skins/zenui/img/dbox/corners.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Products/ZenWidgets/skins/zenui/img/dbox/l.gif Property changes on: trunk/Products/ZenWidgets/skins/zenui/img/dbox/l.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Products/ZenWidgets/skins/zenui/img/dbox/r.gif Property changes on: trunk/Products/ZenWidgets/skins/zenui/img/dbox/r.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Products/ZenWidgets/skins/zenui/img/dbox/tb.gif Property changes on: trunk/Products/ZenWidgets/skins/zenui/img/dbox/tb.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/Products/ZenWidgets/skins/zenui/javascript/dialog.js =================================================================== --- trunk/Products/ZenWidgets/skins/zenui/javascript/dialog.js 2007-04-18 17:31:49 UTC (rev 4748) +++ trunk/Products/ZenWidgets/skins/zenui/javascript/dialog.js 2007-04-18 18:36:40 UTC (rev 4749) @@ -12,6 +12,27 @@ __init__: function(id) { this.makeDimBg(); this.box = $(id); + this.framework = DIV( + {'class':'dialog_container'}, + [ + //top row + DIV({'class':'dbox_tl'}, + [ DIV({'class':'dbox_tr'}, + [ DIV({'class':'dbox_tc'}, null)])]), + //middle row + DIV({'class':'dbox_ml'}, + [ DIV({'class':'dbox_mr'}, + [ DIV({'class':'dbox_mc', + 'id':'dialog_content'}, null)])]), + //bottom row + DIV({'class':'dbox_bl'}, + [ DIV({'class':'dbox_br'}, + [ DIV({'class':'dbox_bc'}, null)])]) + ]); + insertSiblingNodesBefore(this.box, this.framework); + setStyle(this.framework, {'position':'absolute'}); + removeElement(this.box); + appendChildNodes($('dialog_content'), this.box); this.box.show = bind(this.show, this); this.box.hide = bind(this.hide, this); this.box.submit_form = bind(this.submit_form, this); @@ -40,11 +61,12 @@ } }, moveBox: function(dir) { - this.box = removeElement(this.box); + this.framework = removeElement(this.framework); if(dir=='back') { - this.box = this.dimbg.parentNode.appendChild(this.box); + this.framework = this.dimbg.parentNode.appendChild(this.framework); } else { - this.box = this.dimbg.parentNode.insertBefore(this.box, this.dimbg); + this.framework = this.dimbg.parentNode.insertBefore( + this.framework, this.dimbg); } }, show: function(form, url) { @@ -52,27 +74,28 @@ this.form = form; var dims = getViewportDimensions(); var vPos = getViewportPosition(); - setStyle(this.box, {'z-index':'1','display':'block'}); - var bdims = getElementDimensions(this.box); - setStyle(this.box, {'z-index':'10002','display':'none'}); + setStyle(this.framework, {'z-index':'1','display':'block'}); + var bdims = getElementDimensions(this.framework); + setStyle(this.framework, {'z-index':'10002','display':'none'}); map(function(menu) {setStyle(menu, {'z-index':'3000'})}, concat($$('.menu'), $$('.devmovemenu'))); setElementDimensions(this.dimbg, getViewportDimensions()); setElementPosition(this.dimbg, getViewportPosition()); - setElementPosition(this.box, { + setStyle(this.box, {'position':'relative'}); + setElementPosition(this.framework, { x:((dims.w+vPos.x)/2)-(bdims.w/2), y:((dims.h+vPos.y)/2)-(bdims.h/2) }); this.moveBox('front'); - //connect(this.dimbg, 'onclick', bind(this.hide, this)); connect('dialog_close','onclick',function(){$('dialog').hide()}); - appear(this.dimbg, {duration:0.1, from:0.0, to:0.5}); + appear(this.dimbg, {duration:0.1, from:0.0, to:0.7}); showElement(this.box); + showElement(this.framework); }, hide: function() { fade(this.dimbg, {duration:0.1}); this.box.innerHTML = this.defaultContent; - hideElement(this.box); + hideElement(this.framework); this.moveBox('back'); }, fetch: function(url) { @@ -80,7 +103,7 @@ d.addCallback(this.fill); }, fill: function(request) { - $('dialog_content').innerHTML = request.responseText; + $('dialog_innercontent').innerHTML = request.responseText; }, submit_form: function(action, formname) { var f = formname?document.forms[formname]:this.form |
From: <sv...@ze...> - 2007-04-18 17:31:50
|
Author: ecn Date: 2007-04-18 13:31:49 -0400 (Wed, 18 Apr 2007) New Revision: 4748 Modified: trunk/inst/docs/HelloWorldZenPack/hello.py Log: * slightly less simple, lots more functional Modified: trunk/inst/docs/HelloWorldZenPack/hello.py =================================================================== --- trunk/inst/docs/HelloWorldZenPack/hello.py 2007-04-18 17:29:24 UTC (rev 4747) +++ trunk/inst/docs/HelloWorldZenPack/hello.py 2007-04-18 17:31:49 UTC (rev 4748) @@ -7,15 +7,25 @@ import Globals from Products.ZenUtils.ZCmdBase import ZCmdBase +from Products.ZenEvents.Event import Event from Products.ZenEvents.ZenEventClasses import App_Start, App_Stop from socket import getfqdn +from twisted.internet import reactor + fqdn = getfqdn() class Hello(ZCmdBase): + def wakeup(self): + reactor.callLater(1, self.wakeup) + + def sigTerm(self, *unused): + reactor.stop() + def start(self): import time + self.zem = self.dmd.ZenEventManager self.zem.sendEvent(Event(device=fqdn, eventClass=App_Start, summary="hello started", @@ -23,9 +33,8 @@ component="hello")) self.log.info("started") try: - time.sleep(1) - while self.options.cycle: - time.sleep(1) + self.wakeup() + reactor.run() finally: self.zem.sendEvent(Event(device=fqdn, eventClass=App_Stop, |
From: <sv...@ze...> - 2007-04-18 17:29:22
|
Author: ecn Date: 2007-04-18 13:29:24 -0400 (Wed, 18 Apr 2007) New Revision: 4747 Modified: trunk/Products/ZenModel/ZenossInfo.py Log: * get the list of daemons from the zenoss script Modified: trunk/Products/ZenModel/ZenossInfo.py =================================================================== --- trunk/Products/ZenModel/ZenossInfo.py 2007-04-18 17:28:58 UTC (rev 4746) +++ trunk/Products/ZenModel/ZenossInfo.py 2007-04-18 17:29:24 UTC (rev 4747) @@ -320,10 +320,8 @@ """ masterScript = os.path.join(os.getenv('ZENHOME'), 'bin', 'zenoss') daemons = [] - for line in open(masterScript).readlines(): - match = re.match('C="\$C (.*)"$', line) - if match: - daemons.append(match.groups()[0]) + for line in os.popen("%s list" % masterScript).readlines(): + daemons.append(line.strip()) return daemons |
From: <sv...@ze...> - 2007-04-18 17:28:59
|
Author: ecn Date: 2007-04-18 13:28:58 -0400 (Wed, 18 Apr 2007) New Revision: 4746 Modified: trunk/Products/ZenModel/ZenPackLoader.py Log: * make daemon symlinks Modified: trunk/Products/ZenModel/ZenPackLoader.py =================================================================== --- trunk/Products/ZenModel/ZenPackLoader.py 2007-04-18 17:08:05 UTC (rev 4745) +++ trunk/Products/ZenModel/ZenPackLoader.py 2007-04-18 17:28:58 UTC (rev 4746) @@ -134,10 +134,23 @@ name = "Daemons" + def binPath(self, daemon): + return os.path.join(os.environ['ZENHOME'], + 'bin', + os.path.basename(daemon)) + def load(self, pack, app): for fs in findFiles(pack, 'daemons'): os.chmod(fs, 0755) + os.symlink(fs, self.binPath(fs)) + def unload(self, pack, app): + for fs in findFiles(pack, 'daemons'): + try: + os.remove(self.binPath(fs)) + except OSError: + pass + def list(self, pack, app): return [branchAfter(d, 'daemons') for d in findFiles(pack, 'daemons')] |