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-07 18:54:47
|
Author: ecn Date: 2007-04-07 14:54:48 -0400 (Sat, 07 Apr 2007) New Revision: 4570 Modified: trunk/pynetsnmp/twistedsnmp.py Log: need to check timeouts after each operation Modified: trunk/pynetsnmp/twistedsnmp.py =================================================================== --- trunk/pynetsnmp/twistedsnmp.py 2007-04-07 18:50:50 UTC (rev 4569) +++ trunk/pynetsnmp/twistedsnmp.py 2007-04-07 18:54:48 UTC (rev 4570) @@ -171,11 +171,13 @@ def get(self, oids, timeout=None, retryCount=None): d = defer.Deferred() self.defers[self.session.get(translateOids(oids))] = d + updateReactor() return d def walk(self, oid, timeout=None, retryCount=None): d = defer.Deferred() self.defers[self.session.walk(translateOid(oid))] = d + updateReactor() return d def getbulk(self, nonrepeaters, maxrepititions, oids): @@ -183,11 +185,13 @@ self.defers[self.session.getbulk(nonrepeaters, maxrepititions, translateOids(oids))] = d + updateReactor() return d def getTable(self, oids, timeout, retryCount, maxRepetitions): from tableretriever import TableRetriever t = TableRetriever(self, oids, timeout, retryCount, maxRepetitions) + updateReactor() return t() class _FakeProtocol: |
From: <sv...@ze...> - 2007-04-07 18:50:50
|
Author: ecn Date: 2007-04-07 14:50:50 -0400 (Sat, 07 Apr 2007) New Revision: 4569 Added: tags/pynetsnmp-0.1/ Log: initial import of pynetsnmp from private repository Copied: tags/pynetsnmp-0.1 (from rev 4568, trunk/pynetsnmp) |
From: <sv...@ze...> - 2007-04-07 18:48:39
|
Author: ecn Date: 2007-04-07 14:48:28 -0400 (Sat, 07 Apr 2007) New Revision: 4568 Added: trunk/pynetsnmp/ trunk/pynetsnmp/CONSTANTS.py trunk/pynetsnmp/SnmpSession.py trunk/pynetsnmp/__init__.py trunk/pynetsnmp/genconstants.py trunk/pynetsnmp/netsnmp.py trunk/pynetsnmp/setup.py trunk/pynetsnmp/tableget.py trunk/pynetsnmp/tableretriever.py trunk/pynetsnmp/test/ trunk/pynetsnmp/test/get.py trunk/pynetsnmp/test/getbulk.py trunk/pynetsnmp/test/twistget.py trunk/pynetsnmp/test/walk.py trunk/pynetsnmp/twistedsnmp.py Log: moved from private repository Added: trunk/pynetsnmp/CONSTANTS.py Added: trunk/pynetsnmp/SnmpSession.py Added: trunk/pynetsnmp/__init__.py Added: trunk/pynetsnmp/genconstants.py Added: trunk/pynetsnmp/netsnmp.py Added: trunk/pynetsnmp/setup.py Added: trunk/pynetsnmp/tableget.py Added: trunk/pynetsnmp/tableretriever.py Added: trunk/pynetsnmp/test/get.py Added: trunk/pynetsnmp/test/getbulk.py Added: trunk/pynetsnmp/test/twistget.py Added: trunk/pynetsnmp/test/walk.py Added: trunk/pynetsnmp/twistedsnmp.py |
From: <sv...@ze...> - 2007-04-07 15:25:58
|
Author: ecn Date: 2007-04-07 11:25:32 -0400 (Sat, 07 Apr 2007) New Revision: 4567 Modified: trunk/Products/ZenHub/pbclient2.py Log: removing stray pdb Modified: trunk/Products/ZenHub/pbclient2.py =================================================================== --- trunk/Products/ZenHub/pbclient2.py 2007-04-07 15:25:04 UTC (rev 4566) +++ trunk/Products/ZenHub/pbclient2.py 2007-04-07 15:25:32 UTC (rev 4567) @@ -25,7 +25,6 @@ def connected(self, perspective): print "got perspective ref:", perspective - import pdb; pdb.set_trace() d = perspective.getService("EventService", self) d.addCallback(self.sendEvent) d.addErrback(self.bad) |
From: <sv...@ze...> - 2007-04-07 15:25:04
|
Author: ecn Date: 2007-04-07 11:25:04 -0400 (Sat, 07 Apr 2007) New Revision: 4566 Modified: trunk/Products/ZenModel/migrate/datapoints.py Log: removing stray pdb Modified: trunk/Products/ZenModel/migrate/datapoints.py =================================================================== --- trunk/Products/ZenModel/migrate/datapoints.py 2007-04-07 15:23:14 UTC (rev 4565) +++ trunk/Products/ZenModel/migrate/datapoints.py 2007-04-07 15:25:04 UTC (rev 4566) @@ -37,8 +37,6 @@ try: d = getattr(dest, name) except AttributeError: - import pdb - pdb.set_trace() pass if s != d: |
From: <sv...@ze...> - 2007-04-07 15:23:15
|
Author: ecn Date: 2007-04-07 11:23:14 -0400 (Sat, 07 Apr 2007) New Revision: 4565 Modified: trunk/Products/ZenHub/HubService.py trunk/Products/ZenHub/services/PerformanceConfig.py trunk/Products/ZenHub/zenhub.py trunk/Products/ZenRRD/zencommand.py trunk/Products/ZenRRD/zenperfsnmp.py trunk/Products/ZenRRD/zenperfxmlrpc.py trunk/Products/ZenRRD/zenprocess.py trunk/Products/ZenRelations/PrimaryPathObjectManager.py trunk/Products/ZenRelations/RelationshipBase.py Log: #1175 notice objects as they are deleted Modified: trunk/Products/ZenHub/HubService.py =================================================================== --- trunk/Products/ZenHub/HubService.py 2007-04-07 03:58:33 UTC (rev 4564) +++ trunk/Products/ZenHub/HubService.py 2007-04-07 15:23:14 UTC (rev 4565) @@ -15,6 +15,9 @@ def update(self, object): pass + def deleted(self, path): + pass + def addListener(self, remote): remote.notifyOnDisconnect(self.removeListener) log.info("adding listener") Modified: trunk/Products/ZenHub/services/PerformanceConfig.py =================================================================== --- trunk/Products/ZenHub/services/PerformanceConfig.py 2007-04-07 03:58:33 UTC (rev 4564) +++ trunk/Products/ZenHub/services/PerformanceConfig.py 2007-04-07 15:23:14 UTC (rev 4565) @@ -57,3 +57,8 @@ break object = aq_parent(object) + + def deleted(self, path): + for listener in self.listeners: + if 'Devices' in path: + listener.callRemote('deleteDevice', path[-1]) Modified: trunk/Products/ZenHub/zenhub.py =================================================================== --- trunk/Products/ZenHub/zenhub.py 2007-04-07 03:58:33 UTC (rev 4564) +++ trunk/Products/ZenHub/zenhub.py 2007-04-07 15:23:14 UTC (rev 4565) @@ -32,6 +32,7 @@ from Products.ZenEvents.Event import Event, EventHeartbeat from Products.ZenEvents.ZenEventClasses import App_Start, App_Stop import transaction +from zExceptions import NotFound from XmlRpcService import XmlRpcService @@ -138,12 +139,18 @@ def doProcessQueue(self, q): while self.dmd.hubQueue: - object = q.pull() - self.log.debug("Object %s changed", "/".join(object)) + path = q.pull() from Products.ZenUtils.Utils import getObjByPath - object = getObjByPath(self.dmd, object) - for s in self.services.values(): - s.update(object) + try: + object = getObjByPath(self.dmd, path) + except NotFound: + self.log.debug("Object %s deleted", "/".join(path)) + for s in self.services.values(): + s.deleted(path) + else: + self.log.debug("Object %s changed", "/".join(path)) + for s in self.services.values(): + s.update(object) def sendEvent(self, **kw): if not 'device' in kw: Modified: trunk/Products/ZenRRD/zencommand.py =================================================================== --- trunk/Products/ZenRRD/zencommand.py 2007-04-07 03:58:33 UTC (rev 4564) +++ trunk/Products/ZenRRD/zencommand.py 2007-04-07 15:23:14 UTC (rev 4565) @@ -368,7 +368,10 @@ self.deviceIssues = Set() self.pool = SshPool() - + def remote_deleteDevice(self, doomed): + self.log.debug("Async delete device %s" % doomed) + self.schedule = [c for c in self.schedule if c.device == doomed] + def remote_updateConfig(self, config): self.log.debug("Async configuration update") self.updateConfig([config]) Modified: trunk/Products/ZenRRD/zenperfsnmp.py =================================================================== --- trunk/Products/ZenRRD/zenperfsnmp.py 2007-04-07 03:58:33 UTC (rev 4564) +++ trunk/Products/ZenRRD/zenperfsnmp.py 2007-04-07 15:23:14 UTC (rev 4565) @@ -359,6 +359,13 @@ for name, proxy in self.proxies.items(): proxy.snmpStatus.count = countMap.get(name, 0) + + def remote_deleteDevice(self, doomed): + self.log.debug("Async delete device %s" % doomed) + if doomed in self.proxies: + del self.proxies[doomed] + + def remote_updateDeviceConfig(self, snmpTargets): self.log.debug("Async device update") self.updateDeviceConfig(snmpTargets) @@ -433,7 +440,13 @@ d.addCallback(self.reportRate) for unused in range(MAX_SNMP_REQUESTS): if not self.queryWorkList: break - self.startReadDevice(self.queryWorkList.pop()) + d = self.startReadDevice(self.queryWorkList.pop()) + def printError(reason): + from StringIO import StringIO + out = StringIO() + reason.printTraceback(out) + self.log.error(reason) + d.setErrback(d) def reportRate(self, *unused): Modified: trunk/Products/ZenRRD/zenperfxmlrpc.py =================================================================== --- trunk/Products/ZenRRD/zenperfxmlrpc.py 2007-04-07 03:58:33 UTC (rev 4564) +++ trunk/Products/ZenRRD/zenperfxmlrpc.py 2007-04-07 15:23:14 UTC (rev 4565) @@ -286,6 +286,10 @@ p.methodMap = {} return p, url_key + def remote_deleteDevice(self, doomed): + self.log.debug("Async delete device %s" % doomed) + if doomed in self.devices: + del self.devices[doomed] def remote_updateDeviceConfig(self, cfg): self.log.debug("Asynch update of config") Modified: trunk/Products/ZenRRD/zenprocess.py =================================================================== --- trunk/Products/ZenRRD/zenprocess.py 2007-04-07 03:58:33 UTC (rev 4564) +++ trunk/Products/ZenRRD/zenprocess.py 2007-04-07 15:23:14 UTC (rev 4565) @@ -263,6 +263,10 @@ return drive(doFetchConfig) + def remote_deleteDevice(self, doomed): + self.log.debug("Async delete device %s" % doomed) + if doomed in self._devices: + del self._devices[doomed] def remote_updateDevice(self, cfg): name = self.updateDevice(cfg) Modified: trunk/Products/ZenRelations/PrimaryPathObjectManager.py =================================================================== --- trunk/Products/ZenRelations/PrimaryPathObjectManager.py 2007-04-07 03:58:33 UTC (rev 4564) +++ trunk/Products/ZenRelations/PrimaryPathObjectManager.py 2007-04-07 15:23:14 UTC (rev 4565) @@ -76,7 +76,17 @@ return self.__primary_parent__.primaryAq() + def _noticeChange(self, obj=None): + # the object may not be hooked in to have acquisition yet + try: + if obj is not None: + self.notifyObjectChange(obj) + else: + self.notifyObjectChange(self) + except AttributeError: + pass + class PrimaryPathObjectManager( RelCopyContainer, ObjectManager, @@ -90,13 +100,6 @@ RoleManager.manage_options + ZItem.manage_options) - def _noticeChange(self): - # the object may not be hooked in to have acquisition yet - try: - self.notifyObjectChange(self) - except AttributeError: - pass - def _setObject(self, id, obj, roles=None, user=None, set_owner=1): """Track __primary_parent__ when we are set into an object""" self._noticeChange() @@ -108,6 +111,7 @@ """When deleted clear __primary_parent__.""" self._noticeChange() obj = self._getOb(id) + self._noticeChange(obj) ObjectManager._delObject(self, id, dp) obj.__primary_parent__ = None @@ -127,5 +131,6 @@ """When deleted clear __primary_parent__.""" self._noticeChange() obj = self._getOb(id) + self._noticeChange(obj) ObjectManager._delObject(self, id, dp) obj.__primary_parent__ = None Modified: trunk/Products/ZenRelations/RelationshipBase.py =================================================================== --- trunk/Products/ZenRelations/RelationshipBase.py 2007-04-07 03:58:33 UTC (rev 4564) +++ trunk/Products/ZenRelations/RelationshipBase.py 2007-04-07 15:23:14 UTC (rev 4565) @@ -87,6 +87,8 @@ def removeRelation(self, obj=None): """remove an object from a relationship""" + self._noticeChange() + self._noticeChange(obj) self._remoteRemove(obj) self._remove(obj) |
From: <sv...@ze...> - 2007-04-07 03:58:33
|
Author: chris Date: 2007-04-06 23:58:33 -0400 (Fri, 06 Apr 2007) New Revision: 4564 Modified: trunk/inst/rpm/zenoss.spec Log: remove the perl based nagios plugins in /usr/local/zenoss/libexec. this eliminates the dep on perl(Net::SNMP) Modified: trunk/inst/rpm/zenoss.spec =================================================================== --- trunk/inst/rpm/zenoss.spec 2007-04-07 02:26:22 UTC (rev 4563) +++ trunk/inst/rpm/zenoss.spec 2007-04-07 03:58:33 UTC (rev 4564) @@ -116,6 +116,17 @@ # compile external libs and pull down zenoss compile +# remove the nagios-plugins perl scripts that force ugly deps +DIR=${RPM_BUILD_ROOT}/${ZENHOME}/libexec +DIRNAME=${RPM_BUILD_ROOT}/${ZENHOME}/libexec + +for file in \ + `ls $DIRNAME | awk '{print $1}' | cut -d: -f1 | sort -u` +do + rm $DIRNAME/$file +done + + # remove the CM artifacts ZEN_INST_DIR=${RPM_BUILD_ROOT}/${ZENHOME} find ${ZEN_INST_DIR} -name .svn | xargs rm -rf |
From: <sv...@ze...> - 2007-04-07 02:26:21
|
Author: edahl Date: 2007-04-06 22:26:22 -0400 (Fri, 06 Apr 2007) New Revision: 4563 Modified: trunk/Products/ZenModel/IpInterface.py Log: * fix problem with name vs. name() in interface Modified: trunk/Products/ZenModel/IpInterface.py =================================================================== --- trunk/Products/ZenModel/IpInterface.py 2007-04-07 02:25:21 UTC (rev 4562) +++ trunk/Products/ZenModel/IpInterface.py 2007-04-07 02:26:22 UTC (rev 4563) @@ -41,7 +41,7 @@ d = IpInterface(id) context._setObject(id, d) d = context._getOb(id) - setattr(d, 'name', id) + d.interfaceName = id if REQUEST is not None: REQUEST['RESPONSE'].redirect(context.absolute_url() |
From: <sv...@ze...> - 2007-04-07 02:25:19
|
Author: edahl Date: 2007-04-06 22:25:21 -0400 (Fri, 06 Apr 2007) New Revision: 4562 Modified: trunk/Products/ZenEvents/EventManagerBase.py Log: * refactor system getting code for other types of dashboards Modified: trunk/Products/ZenEvents/EventManagerBase.py =================================================================== --- trunk/Products/ZenEvents/EventManagerBase.py 2007-04-07 02:23:38 UTC (rev 4561) +++ trunk/Products/ZenEvents/EventManagerBase.py 2007-04-07 02:25:21 UTC (rev 4562) @@ -775,7 +775,8 @@ data = self.checkCache("dashboardinfo%s" % simple) if data: return data data = {} - data['systemevents'] = self.getSystemsDashboard(simple) + data['systemevents'] = self.getOrganizerSummary( + 'Systems','viewEvents', simple) data['heartbeat'] = self.getHeartbeat() data['deviceevents'] = self.getDeviceDashboard(simple) self.addToCache("dashboardinfo", data) @@ -819,25 +820,31 @@ return devdata - def getSystemsDashboard(self, simple=False): + def getOrganizerSummary(self, rootname='Systems',template='',simple=False): """Return systems info for dashboard.""" - sysroot = self.getDmdRoot("Systems") - sysdata = [] - for sys in sysroot.children(): + root = self.getDmdRoot(rootname) + data = [] + for sys in root.children(): if simple: alink = sys.getOrganizerName() else: - alink = "<a href='%s'>%s</a>" % ( - sys.getPrimaryUrlPath()+"/viewEvents", + alink = "<a href='%s/%s'>%s</a>" % ( + sys.getPrimaryUrlPath(),template, sys.getOrganizerName()) evts = [ alink ] evts.extend(map(evtprep, sys.getEventSummary(prodState=1000))) - sysdata.append(evts) - sysdata.sort() - return sysdata + data.append(evts) + data.sort() + return data + def getOrganizerDashboard(self): + return { + 'systemevents': self.getOrganizerSummary(), + 'locationevents': self.getOrganizerSummary('Locations') + } + def getSummaryDashboard(self, REQUEST=None): '''Build summary of serveral zope servers''' import urllib, re |
From: <sv...@ze...> - 2007-04-07 02:23:38
|
Author: edahl Date: 2007-04-06 22:23:38 -0400 (Fri, 06 Apr 2007) New Revision: 4561 Modified: trunk/Products/ZenEvents/__init__.py Log: * add productNames so that we can check the rels Modified: trunk/Products/ZenEvents/__init__.py =================================================================== --- trunk/Products/ZenEvents/__init__.py 2007-04-06 22:24:13 UTC (rev 4560) +++ trunk/Products/ZenEvents/__init__.py 2007-04-07 02:23:38 UTC (rev 4561) @@ -30,6 +30,15 @@ zeneventpopulator = None zeneventmaintenance = None +productNames = ( + "ActionRule", + "ActionRuleWindow", + "EventClass", + "EventClassInst", + "EventCommand", + "EventManagerBase", +) + def initialize(registrar): registrar.registerClass( MySqlEventManager, |
From: <sv...@ze...> - 2007-04-06 22:24:13
|
Author: edahl Date: 2007-04-06 18:24:13 -0400 (Fri, 06 Apr 2007) New Revision: 4560 Modified: trunk/Products/ZenModel/IpAddress.py trunk/Products/ZenModel/IpRouteEntry.py Log: * put call to name back in Modified: trunk/Products/ZenModel/IpAddress.py =================================================================== --- trunk/Products/ZenModel/IpAddress.py 2007-04-06 22:24:00 UTC (rev 4559) +++ trunk/Products/ZenModel/IpAddress.py 2007-04-06 22:24:13 UTC (rev 4560) @@ -175,7 +175,7 @@ security.declareProtected('View', 'getInterfaceName') def getInterfaceName(self): if self.interface(): - return self.interface().name + return self.interface().name() return "No Interface" Modified: trunk/Products/ZenModel/IpRouteEntry.py =================================================================== --- trunk/Products/ZenModel/IpRouteEntry.py 2007-04-06 22:24:00 UTC (rev 4559) +++ trunk/Products/ZenModel/IpRouteEntry.py 2007-04-06 22:24:13 UTC (rev 4560) @@ -144,7 +144,7 @@ If no interface is found return 'No Interface'. """ if self.interface(): - return self.interface().name + return self.interface().name() return "No Interface" |
From: <sv...@ze...> - 2007-04-06 22:24:00
|
Author: edahl Date: 2007-04-06 18:24:00 -0400 (Fri, 06 Apr 2007) New Revision: 4559 Modified: trunk/Products/ZenModel/migrate/zCollectorPlugins.py Log: * check for property before adding it Modified: trunk/Products/ZenModel/migrate/zCollectorPlugins.py =================================================================== --- trunk/Products/ZenModel/migrate/zCollectorPlugins.py 2007-04-06 21:52:01 UTC (rev 4558) +++ trunk/Products/ZenModel/migrate/zCollectorPlugins.py 2007-04-06 22:24:00 UTC (rev 4559) @@ -1,10 +1,12 @@ import Migrate +from Acquisition import aq_base class zCollectorPlugins(Migrate.Step): version = Migrate.Version(1, 2, 0) def cutover(self, dmd): - dmd.Devices._setProperty("zCollectorPlugins", [], type='lines') + if not hasattr(aq_base(dmd.Devices), 'zCollectorPlugins'): + dmd.Devices._setProperty("zCollectorPlugins", [], type='lines') zCollectorPlugins() |
From: <sv...@ze...> - 2007-04-06 21:52:02
|
Author: marc Date: 2007-04-06 17:52:01 -0400 (Fri, 06 Apr 2007) New Revision: 4558 Modified: trunk/Products/ZenModel/migrate/zCollectorPlugins.py Log: reverting my comment Modified: trunk/Products/ZenModel/migrate/zCollectorPlugins.py =================================================================== --- trunk/Products/ZenModel/migrate/zCollectorPlugins.py 2007-04-06 21:48:55 UTC (rev 4557) +++ trunk/Products/ZenModel/migrate/zCollectorPlugins.py 2007-04-06 21:52:01 UTC (rev 4558) @@ -4,7 +4,7 @@ version = Migrate.Version(1, 2, 0) def cutover(self, dmd): - pass#dmd.Devices._setProperty("zCollectorPlugins", [], type='lines') + dmd.Devices._setProperty("zCollectorPlugins", [], type='lines') zCollectorPlugins() |
From: <sv...@ze...> - 2007-04-06 21:48:59
|
Author: marc Date: 2007-04-06 17:48:55 -0400 (Fri, 06 Apr 2007) New Revision: 4557 Added: trunk/Products/ZenWidgets/skins/zenui/dialog_deleteFileSystems.pt trunk/Products/ZenWidgets/skins/zenui/dialog_deleteIpInterfaces.pt trunk/Products/ZenWidgets/skins/zenui/dialog_deleteIpRouteEntries.pt trunk/Products/ZenWidgets/skins/zenui/dialog_deleteIpServices.pt trunk/Products/ZenWidgets/skins/zenui/dialog_deleteOSProcesses.pt trunk/Products/ZenWidgets/skins/zenui/dialog_deleteWinServices.pt trunk/Products/ZenWidgets/skins/zenui/dialog_lockFileSystems.pt trunk/Products/ZenWidgets/skins/zenui/dialog_lockIpInterfaces.pt trunk/Products/ZenWidgets/skins/zenui/dialog_lockIpRouteEntries.pt trunk/Products/ZenWidgets/skins/zenui/dialog_lockIpServices.pt trunk/Products/ZenWidgets/skins/zenui/dialog_lockOSProcesses.pt trunk/Products/ZenWidgets/skins/zenui/dialog_lockWinServices.pt Modified: trunk/Products/ZenModel/FileSystem.py trunk/Products/ZenModel/IpRouteEntry.py trunk/Products/ZenModel/Lockable.py trunk/Products/ZenModel/OSProcess.py trunk/Products/ZenModel/OperatingSystem.py trunk/Products/ZenModel/migrate/menus.py trunk/Products/ZenModel/migrate/zCollectorPlugins.py trunk/Products/ZenModel/skins/zenmodel/deviceOsDetail.pt trunk/Products/ZenModel/skins/zenmodel/dialog_addIpRouteEntry.pt Log: #748 * Various fixes, delete and lock dialogs for devcomp Modified: trunk/Products/ZenModel/FileSystem.py =================================================================== --- trunk/Products/ZenModel/FileSystem.py 2007-04-06 21:30:32 UTC (rev 4556) +++ trunk/Products/ZenModel/FileSystem.py 2007-04-06 21:48:55 UTC (rev 4557) @@ -21,12 +21,15 @@ from Products.ZenRelations.RelSchema import * from OSComponent import OSComponent +from Products.ZenUtils.Utils import prepId def manage_addFileSystem(context, id, userCreated, REQUEST=None): """make a filesystem""" - fs = FileSystem(id) - context._setObject(id, fs) - fs = context._getOb(id) + fsid = prepId(id) + fs = FileSystem(fsid) + context._setObject(fsid, fs) + fs = context._getOb(fsid) + setattr(fs, 'mount', id) if userCreated: fs.setUserCreateFlag() if REQUEST is not None: REQUEST['RESPONSE'].redirect(context.absolute_url()+'/manage_main') Modified: trunk/Products/ZenModel/IpRouteEntry.py =================================================================== --- trunk/Products/ZenModel/IpRouteEntry.py 2007-04-06 21:30:32 UTC (rev 4556) +++ trunk/Products/ZenModel/IpRouteEntry.py 2007-04-06 21:48:55 UTC (rev 4557) @@ -144,7 +144,7 @@ If no interface is found return 'No Interface'. """ if self.interface(): - return self.interface().name() + return self.interface().name return "No Interface" Modified: trunk/Products/ZenModel/Lockable.py =================================================================== --- trunk/Products/ZenModel/Lockable.py 2007-04-06 21:30:32 UTC (rev 4556) +++ trunk/Products/ZenModel/Lockable.py 2007-04-06 21:48:55 UTC (rev 4557) @@ -1,5 +1,3 @@ -from Products.ZenRelations import RelationshipBase - UNLOCKED = 0 DELETE_LOCKED = 1 UPDATE_LOCKED = 2 @@ -21,33 +19,47 @@ def sendEventWhenBlocked(self): if self.sendEventWhenBlockedFlag: return True + return False + ''' else: lockableParent = self.getNextLockableParent() if lockableParent: return lockableParent.sendEventWhenBlocked() else: return False - + ''' + + def isUnlocked(self): + if self.modelerLock == UNLOCKED: + return True + return False + def isLockedFromDeletion(self): if self.modelerLock == DELETE_LOCKED or self.modelerLock == UPDATE_LOCKED: return True + return False + ''' else: lockableParent = self.getNextLockableParent() if lockableParent: return lockableParent.isLockedFromDeletion() else: return False - + ''' + def isLockedFromUpdates(self): if self.modelerLock == UPDATE_LOCKED: return True + return False + ''' else: lockableParent = self.getNextLockableParent() if lockableParent: return lockableParent.isLockedFromUpdates() else: return False - + ''' + def setSendEventWhenBlockedFlag(self): self.sendEventWhenBlockedFlag = True @@ -61,6 +73,11 @@ self.setSendEventWhenBlockedFlag() else: self.unsetSendEventWhenBlockedFlag() + + if self.meta_type == 'Device': + for dc in self.getDeviceComponents(): + dc.unlock(sendEventWhenBlocked) + if REQUEST: return self.callZenScreen(REQUEST) @@ -71,6 +88,11 @@ self.setSendEventWhenBlockedFlag() else: self.unsetSendEventWhenBlockedFlag() + + if self.meta_type == 'Device': + for dc in self.getDeviceComponents(): + dc.lockFromDeletion(sendEventWhenBlocked) + if REQUEST: return self.callZenScreen(REQUEST) @@ -81,6 +103,11 @@ self.setSendEventWhenBlockedFlag() else: self.unsetSendEventWhenBlockedFlag() + + if self.meta_type == 'Device': + for dc in self.getDeviceComponents(): + dc.lockFromUpdates(sendEventWhenBlocked) + if REQUEST: return self.callZenScreen(REQUEST) Modified: trunk/Products/ZenModel/OSProcess.py =================================================================== --- trunk/Products/ZenModel/OSProcess.py 2007-04-06 21:30:32 UTC (rev 4556) +++ trunk/Products/ZenModel/OSProcess.py 2007-04-06 21:48:55 UTC (rev 4557) @@ -15,8 +15,8 @@ from OSComponent import OSComponent from ZenPackable import ZenPackable -def manage_addOSProcess(context, id, className, userCreated, REQUEST = None): - """make a device""" +def manage_addOSProcess(context, id, className, userCreated, REQUEST=None): + """make an os process""" context._setObject(id, OSProcess(id)) osp = context._getOb(id) if className == '/': className = '' @@ -24,7 +24,7 @@ classPath = "%s/osProcessClasses/%s" % (orgPath, id) try: osp.getDmdObj(classPath) - except KeyError, NotFound: + except (KeyError, NotFound): organizer = osp.getDmdObj(orgPath) organizer.manage_addOSProcessClass(id) osp.setOSProcessClass(classPath) Modified: trunk/Products/ZenModel/OperatingSystem.py =================================================================== --- trunk/Products/ZenModel/OperatingSystem.py 2007-04-06 21:30:32 UTC (rev 4556) +++ trunk/Products/ZenModel/OperatingSystem.py 2007-04-06 21:48:55 UTC (rev 4557) @@ -7,6 +7,8 @@ import logging log = logging.getLogger("zen.OS") +import types + from Software import Software from AccessControl import ClassSecurityInfo @@ -30,6 +32,7 @@ from IpRouteEntry import manage_addIpRouteEntry from FileSystem import manage_addFileSystem +from Products.ZenUtils.Utils import prepId class OperatingSystem(Software): @@ -52,7 +55,12 @@ ) security = ClassSecurityInfo() - + + routeTypeMap = ('other', 'invalid', 'direct', 'indirect') + routeProtoMap = ('other', 'local', 'netmgmt', 'icmp', + 'egp', 'ggp', 'hello', 'rip', 'is-is', 'es-is', + 'ciscoIgrp', 'bbnSpfIgrp', 'ospf', 'bgp') + def __init__(self): id = "os" Software.__init__(self, id) @@ -111,13 +119,71 @@ """ return self.getPrimaryParent() + def deleteDeviceComponents(self, context, componentNames=[], REQUEST=None): + """Delete device components""" + if not componentNames: return self() + if type(componentNames) in types.StringTypes: componentNames = (componentNames,) + for componentName in componentNames: + dc = context._getOb(componentName) + dc.manage_deleteComponent() + if REQUEST: + return self.callZenScreen(REQUEST) + + def unlockDeviceComponents(self, context, componentNames=[], sendEventWhenBlocked=None, REQUEST=None): + """Unlock device components""" + if not componentNames: return self() + if type(componentNames) in types.StringTypes: componentNames = (componentNames,) + for componentName in componentNames: + dc = context._getOb(componentName) + dc.unlock(sendEventWhenBlocked) + if REQUEST: + return self.callZenScreen(REQUEST) + + def lockDeviceComponentsFromDeletion(self, context, componentNames=[], sendEventWhenBlocked=None, REQUEST=None): + """Lock device components from deletion""" + if not componentNames: return self() + if type(componentNames) in types.StringTypes: componentNames = (componentNames,) + for componentName in componentNames: + dc = context._getOb(componentName) + dc.lockFromDeletion(sendEventWhenBlocked) + if REQUEST: + return self.callZenScreen(REQUEST) + + def lockDeviceComponentsFromUpdates(self, context, componentNames=[], sendEventWhenBlocked=None, REQUEST=None): + """Lock device components from updates""" + if not componentNames: return self() + if type(componentNames) in types.StringTypes: componentNames = (componentNames,) + for componentName in componentNames: + dc = context._getOb(componentName) + dc.lockFromUpdates(sendEventWhenBlocked) + if REQUEST: + return self.callZenScreen(REQUEST) + + def addIpInterface(self, id, REQUEST=None): - """Add an IpInterface. + """Add IpInterfaces. """ manage_addIpInterface(self.interfaces, id) if REQUEST is not None: REQUEST['RESPONSE'].redirect(self.interfaces._getOb(id).absolute_url()) + + def deleteIpInterfaces(self, componentNames=[], REQUEST=None): + """Delete IpInterfaces""" + return self.deleteDeviceComponents(self.interfaces, componentNames, REQUEST) + def unlockIpInterfaces(self, componentNames=[], sendEventWhenBlocked=None, REQUEST=None): + """Unlock IpInterfaces""" + return self.unlockDeviceComponents(self.interfaces, componentNames, sendEventWhenBlocked, REQUEST) + + def lockIpInterfacesFromDeletion(self, componentNames=[], sendEventWhenBlocked=None, REQUEST=None): + """Lock IpInterfaces from deletion""" + return self.lockDeviceComponentsFromDeletion(self.interfaces, componentNames, sendEventWhenBlocked, REQUEST) + + def lockIpInterfacesFromUpdates(self, componentNames=[], sendEventWhenBlocked=None, REQUEST=None): + """Lock IpInterfaces from updates""" + return self.lockDeviceComponentsFromUpdates(self.interfaces, componentNames, sendEventWhenBlocked, REQUEST) + + def addWinService(self, id, description, @@ -132,6 +198,23 @@ if REQUEST is not None: REQUEST['RESPONSE'].redirect(self.winservices._getOb(id).absolute_url()) + def deleteWinServices(self, componentNames=[], REQUEST=None): + """Delete WinServices""" + return self.deleteDeviceComponents(self.winservices, componentNames, REQUEST) + + def unlockWinServices(self, componentNames=[], sendEventWhenBlocked=None, REQUEST=None): + """Unlock WinServices""" + return self.unlockDeviceComponents(self.winservices, componentNames, sendEventWhenBlocked, REQUEST) + + def lockWinServicesFromDeletion(self, componentNames=[], sendEventWhenBlocked=None, REQUEST=None): + """Lock WinServices from deletion""" + return self.lockDeviceComponentsFromDeletion(self.winservices, componentNames, sendEventWhenBlocked, REQUEST) + + def lockWinServicesFromUpdates(self, componentNames=[], sendEventWhenBlocked=None, REQUEST=None): + """Lock WinServices from updates""" + return self.lockDeviceComponentsFromUpdates(self.winservices, componentNames, sendEventWhenBlocked, REQUEST) + + def addOSProcess(self, id, className, @@ -145,14 +228,31 @@ userCreated) if REQUEST is not None: REQUEST['RESPONSE'].redirect(self.processes._getOb(id).absolute_url()) - + + def deleteOSProcesses(self, componentNames=[], REQUEST=None): + """Delete OSProcesses""" + return self.deleteDeviceComponents(self.processes, componentNames, REQUEST) + + def unlockOSProcesses(self, componentNames=[], sendEventWhenBlocked=None, REQUEST=None): + """Unlock OSProcesses""" + return self.unlockDeviceComponents(self.processes, componentNames, sendEventWhenBlocked, REQUEST) + + def lockOSProcessesFromDeletion(self, componentNames=[], sendEventWhenBlocked=None, REQUEST=None): + """Lock OSProcesses from deletion""" + return self.lockDeviceComponentsFromDeletion(self.processes, componentNames, sendEventWhenBlocked, REQUEST) + + def lockOSProcessesFromUpdates(self, componentNames=[], sendEventWhenBlocked=None, REQUEST=None): + """Lock OSProcesses from updates""" + return self.lockDeviceComponentsFromUpdates(self.processes, componentNames, sendEventWhenBlocked, REQUEST) + + def addIpService(self, id, protocol, port, userCreated, REQUEST=None): - """Add an IpInterface. + """Add IpServices. """ manage_addIpService(self.ipservices, id, @@ -162,13 +262,48 @@ if REQUEST is not None: REQUEST['RESPONSE'].redirect(self.ipservices._getOb(id).absolute_url()) + def deleteIpServices(self, componentNames=[], REQUEST=None): + """Delete IpServices""" + return self.deleteDeviceComponents(self.ipservices, componentNames, REQUEST) + + def unlockIpServices(self, componentNames=[], sendEventWhenBlocked=None, REQUEST=None): + """Unlock IpServices""" + return self.unlockDeviceComponents(self.ipservices, componentNames, sendEventWhenBlocked, REQUEST) + + def lockIpServicesFromDeletion(self, componentNames=[], sendEventWhenBlocked=None, REQUEST=None): + """Lock IpServices from deletion""" + return self.lockDeviceComponentsFromDeletion(self.ipservices, componentNames, sendEventWhenBlocked, REQUEST) + + def lockIpServicesFromUpdates(self, componentNames=[], sendEventWhenBlocked=None, REQUEST=None): + """Lock IpServices from updates""" + return self.lockDeviceComponentsFromUpdates(self.ipservices, componentNames, sendEventWhenBlocked, REQUEST) + + def addFileSystem(self, id, userCreated, REQUEST=None): - """Add an FileSystem. + """Add a FileSystem. """ + fsid = prepId(id) manage_addFileSystem(self.filesystems, id, userCreated) if REQUEST is not None: - REQUEST['RESPONSE'].redirect(self.filesystems._getOb(id).absolute_url()) - + REQUEST['RESPONSE'].redirect(self.filesystems._getOb(fsid).absolute_url()) + + def deleteFileSystems(self, componentNames=[], REQUEST=None): + """Delete FileSystems""" + return self.deleteDeviceComponents(self.filesystems, componentNames, REQUEST) + + def unlockFileSystems(self, componentNames=[], sendEventWhenBlocked=None, REQUEST=None): + """Unlock FileSystems""" + return self.unlockDeviceComponents(self.filesystems, componentNames, sendEventWhenBlocked, REQUEST) + + def lockFileSystemsFromDeletion(self, componentNames=[], sendEventWhenBlocked=None, REQUEST=None): + """Lock FileSystems from deletion""" + return self.lockDeviceComponentsFromDeletion(self.filesystems, componentNames, sendEventWhenBlocked, REQUEST) + + def lockFileSystemsFromUpdates(self, componentNames=[], sendEventWhenBlocked=None, REQUEST=None): + """Lock FileSystems from updates""" + return self.lockDeviceComponentsFromUpdates(self.filesystems, componentNames, sendEventWhenBlocked, REQUEST) + + def addIpRouteEntry(self, dest, nexthopid, @@ -188,5 +323,21 @@ userCreated=userCreated) if REQUEST is not None: REQUEST['RESPONSE'].redirect(self.absolute_url()) - + + def deleteIpRouteEntries(self, componentNames=[], REQUEST=None): + """Delete IpRouteEntries""" + return self.deleteDeviceComponents(self.routes, componentNames, REQUEST) + + def unlockIpRouteEntries(self, componentNames=[], sendEventWhenBlocked=None, REQUEST=None): + """Unlock IpRouteEntries""" + return self.unlockDeviceComponents(self.routes, componentNames, sendEventWhenBlocked, REQUEST) + + def lockIpRouteEntriesFromDeletion(self, componentNames=[], sendEventWhenBlocked=None, REQUEST=None): + """Lock IpRouteEntries from deletion""" + return self.lockDeviceComponentsFromDeletion(self.routes, componentNames, sendEventWhenBlocked, REQUEST) + + def lockIpRouteEntriesFromUpdates(self, componentNames=[], sendEventWhenBlocked=None, REQUEST=None): + """Lock IpRouteEntries from updates""" + return self.lockDeviceComponentsFromUpdates(self.routes, componentNames, sendEventWhenBlocked, REQUEST) + InitializeClass(OperatingSystem) Modified: trunk/Products/ZenModel/migrate/menus.py =================================================================== --- trunk/Products/ZenModel/migrate/menus.py 2007-04-06 21:30:32 UTC (rev 4556) +++ trunk/Products/ZenModel/migrate/menus.py 2007-04-06 21:48:55 UTC (rev 4557) @@ -461,6 +461,20 @@ action= 'dialog_addIpInterface', isdialog = True, permissions=('Change Device',), + ), + dict( + id= 'deleteIpInterfaces', + description='Delete IpInterfaces...', + action= 'dialog_deleteIpInterfaces', + isdialog = True, + permissions=('Change Device',), + ), + dict( + id= 'lockIpInterfaces', + description='Lock IpInterfaces...', + action= 'dialog_lockIpInterfaces', + isdialog = True, + permissions=('Change Device',), ) ], 'OSProcess':[ @@ -470,6 +484,20 @@ action= 'dialog_addOSProcess', isdialog = True, permissions=('Change Device',), + ), + dict( + id= 'deleteOSProcesses', + description='Delete OSProcesses...', + action= 'dialog_deleteOSProcesses', + isdialog = True, + permissions=('Change Device',), + ), + dict( + id= 'lockOSProcesses', + description='Lock OSProcesses...', + action= 'dialog_lockOSProcesses', + isdialog = True, + permissions=('Change Device',), ) ], 'FileSystem':[ @@ -479,6 +507,20 @@ action= 'dialog_addFileSystem', isdialog = True, permissions=('Change Device',), + ), + dict( + id= 'deleteFileSystems', + description='Delete FileSystems...', + action= 'dialog_deleteFileSystems', + isdialog = True, + permissions=('Change Device',), + ), + dict( + id= 'lockFileSystems', + description='Lock FileSystems...', + action= 'dialog_lockFileSystems', + isdialog = True, + permissions=('Change Device',), ) ], 'IpRouteEntry':[ @@ -488,6 +530,20 @@ action= 'dialog_addIpRouteEntry', isdialog = True, permissions=('Change Device',), + ), + dict( + id= 'deleteIpRouteEntries', + description='Delete IpRouteEntries...', + action= 'dialog_deleteIpRouteEntries', + isdialog = True, + permissions=('Change Device',), + ), + dict( + id= 'lockIpRouteEntries', + description='Lock IpRouteEntries...', + action= 'dialog_lockIpRouteEntries', + isdialog = True, + permissions=('Change Device',), ) ], 'IpService':[ @@ -497,6 +553,20 @@ action= 'dialog_addIpService', isdialog = True, permissions=('Change Device',), + ), + dict( + id= 'deleteIpServices', + description='Delete IpServices...', + action= 'dialog_deleteIpServices', + isdialog = True, + permissions=('Change Device',), + ), + dict( + id= 'lockIpServices', + description='Lock IpServices...', + action= 'dialog_lockIpServices', + isdialog = True, + permissions=('Change Device',), ) ], 'WinService':[ @@ -506,6 +576,20 @@ action= 'dialog_addWinService', isdialog = True, permissions=('Change Device',), + ), + dict( + id= 'deleteWinServices', + description='Delete WinServices...', + action= 'dialog_deleteWinServices', + isdialog = True, + permissions=('Change Device',), + ), + dict( + id= 'lockWinServices', + description='Lock WinServices...', + action= 'dialog_lockWinServices', + isdialog = True, + permissions=('Change Device',), ) ], 'Event_list':[ Modified: trunk/Products/ZenModel/migrate/zCollectorPlugins.py =================================================================== --- trunk/Products/ZenModel/migrate/zCollectorPlugins.py 2007-04-06 21:30:32 UTC (rev 4556) +++ trunk/Products/ZenModel/migrate/zCollectorPlugins.py 2007-04-06 21:48:55 UTC (rev 4557) @@ -4,7 +4,7 @@ version = Migrate.Version(1, 2, 0) def cutover(self, dmd): - dmd.Devices._setProperty("zCollectorPlugins", [], type='lines') + pass#dmd.Devices._setProperty("zCollectorPlugins", [], type='lines') zCollectorPlugins() Modified: trunk/Products/ZenModel/skins/zenmodel/deviceOsDetail.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/deviceOsDetail.pt 2007-04-06 21:30:32 UTC (rev 4556) +++ trunk/Products/ZenModel/skins/zenmodel/deviceOsDetail.pt 2007-04-06 21:48:55 UTC (rev 4557) @@ -3,7 +3,10 @@ <form method="post" tal:attributes="action here/absolute_url" name="addComponent"/> - + +<form method="post" tal:attributes="action here/absolute_url" + name="ipInterfaceListForm"> + <tal:block tal:define="unused here/cacheComponents; tableName string:interfacelist; objects here/os/interfaces/objectValuesAll; @@ -18,6 +21,7 @@ <!-- BEGIN TABLE CONTENTS --> <tr tal:condition="batch"> + <th class="tableheader"></th> <th class="tableheader" align="center">O</th> <th class="tableheader" align="center">A</th> <th tal:replace="structure python:here.ZenTableManager.getTableHeader( @@ -41,6 +45,10 @@ <tr tal:define="odd repeat/intf/odd" tal:attributes="class python:test(odd, 'odd', 'even')"> <td class="tablevalues" align="center"> + <input type="checkbox" name="componentNames:list" + tal:attributes="value intf/getRelationshipManagerId"/> + </td> + <td class="tablevalues" align="center"> <img border="0" tal:attributes="src python:test(intf.operStatus==1, 'misc_/SiteScopeParser/greenball_img', @@ -96,6 +104,10 @@ </tal:block> </tal:block> +</form> +<form method="post" tal:attributes="action here/absolute_url" + name="winServiceListForm"> + <tal:block tal:define="tableName string:winserviceslist; objects here/os/winservices/objectValuesAll; tabletitle string:Win Services; @@ -108,7 +120,10 @@ <!-- BEGIN TABLE CONTENTS --> <tr> + <th class="tableheader"></th> <th tal:replace="structure python:here.ZenTableManager.getTableHeader( + tableName,'getServiceClass','Class')"/> + <th tal:replace="structure python:here.ZenTableManager.getTableHeader( tableName,'caption','Caption')"/> <th tal:replace="structure python:here.ZenTableManager.getTableHeader( tableName,'startMode','StartMode')"/> @@ -123,6 +138,11 @@ <tal:block tal:repeat="srv batch"> <tr tal:define="odd repeat/srv/odd" tal:attributes="class python:test(odd, 'odd', 'even')"> + <td class="tablevalues" align="center"> + <input type="checkbox" name="componentNames:list" + tal:attributes="value srv/getRelationshipManagerId"/> + </td> + <td tal:content="structure srv/getServiceClassLink"/> <td><a class="tablevalues" tal:content="srv/caption" tal:attributes="href srv/getPrimaryUrlPath">evtsys</a> </td> @@ -151,7 +171,10 @@ </tal:block> </tal:block> - +</form> +<form method="post" tal:attributes="action here/absolute_url" + name="osProcessListForm"> + <tal:block tal:define="tableName string:osprocesslist; objects here/os/processes/objectValuesAll; tabletitle string:OS Processes; @@ -175,6 +198,7 @@ <!-- BEGIN TABLE CONTENTS --> <tr> + <th class="tableheader"></th> <th tal:replace="structure python:here.ZenTableManager.getTableHeader( tableName,'getOSProcessClass','Class')"/> <th tal:replace="structure python:here.ZenTableManager.getTableHeader( @@ -190,6 +214,10 @@ <tal:block tal:repeat="proc batch"> <tr tal:define="odd repeat/proc/odd" tal:attributes="class python:test(odd, 'odd', 'even')"> + <td class="tablevalues" align="center"> + <input type="checkbox" name="componentNames:list" + tal:attributes="value proc/getRelationshipManagerId"/> + </td> <td tal:content="structure proc/getOSProcessClassLink"/> <td><a class="tablevalues" tal:content="python:proc.name()[:50]" tal:attributes="href proc/getPrimaryUrlPath">evtsys</a> @@ -218,6 +246,9 @@ </tal:block> </tal:block> +</form> +<form method="post" tal:attributes="action here/absolute_url" + name="ipServiceListForm"> <tal:block metal:define-macro="ipserviceList" tal:define="tableName string:ipservicelist; @@ -232,7 +263,10 @@ <!-- BEGIN TABLE CONTENTS --> <tr> + <th class="tableheader"></th> <th tal:replace="structure python:here.ZenTableManager.getTableHeader( + tableName,'getServiceClass','Class')"/> + <th tal:replace="structure python:here.ZenTableManager.getTableHeader( tableName,'getKeyword','Name')">Name </th> <th tal:replace="structure python:here.ZenTableManager.getTableHeader( @@ -255,6 +289,11 @@ <tal:block tal:repeat="srv batch"> <tr tal:define="odd repeat/srv/odd" tal:attributes="class python:test(odd, 'odd', 'even')"> + <td class="tablevalues" align="center"> + <input type="checkbox" name="componentNames:list" + tal:attributes="value srv/getRelationshipManagerId"/> + </td> + <td tal:content="structure srv/getServiceClassLink"/> <td><a class="tablevalues" tal:content="srv/name" tal:attributes="href srv/getPrimaryUrlPath">evtsys</a> </td> @@ -286,6 +325,9 @@ </tal:block> </tal:block> +</form> +<form method="post" tal:attributes="action here/absolute_url" + name="fileSystemListForm"> <tal:block metal:define-macro="fileSysList" tal:define="tableName string:fileSyslist; @@ -300,6 +342,7 @@ <!-- BEGIN TABLE CONTENTS --> <tr tal:condition="objects"> + <th class="tableheader"></th> <th tal:replace="structure python:here.ZenTableManager.getTableHeader( tableName,'mount','Mount')">Mount </th> @@ -330,6 +373,11 @@ <tal:block tal:repeat="fsys batch"> <tr tal:define="odd repeat/fsys/odd" tal:attributes="class python:test(odd, 'odd', 'even')"> + + <td class="tablevalues" align="center"> + <input type="checkbox" name="componentNames:list" + tal:attributes="value fsys/getRelationshipManagerId"/> + </td> <td class="tablevalues"> <a class=tablevalues tal:content="fsys/mount" tal:attributes="href fsys/getPrimaryUrlPath">sd0</a> @@ -371,6 +419,10 @@ </tal:block> </tal:block> +</form> +<form method="post" tal:attributes="action here/absolute_url" + name="ipRouteEntryListForm"> + <tal:block metal:define-macro="routeTableList" tal:define="tableName string:routeTablelist; objects here/os/routes/objectValuesAll; @@ -382,6 +434,7 @@ <!-- BEGIN TABLE CONTENTS --> <tr tal:condition="batch"> + <th class="tableheader"></th> <th tal:replace="structure python:here.ZenTableManager.getTableHeader( tableName,'primarySortKey','Destination')"/> <th tal:replace="structure python:here.ZenTableManager.getTableHeader( @@ -402,12 +455,18 @@ <tal:block tal:repeat="route batch"> <tr tal:define="odd repeat/route/odd" tal:attributes="class python:test(odd, 'odd', 'even')"> + <td class="tablevalues" align="center"> + <input type="checkbox" name="componentNames:list" + tal:attributes="value route/getRelationshipManagerId"/> + </td> <td class="tablevalues" tal:content="structure route/getTargetLink"/> <td class="tablevalues"> <span tal:replace="structure route/getNextHopIpLink"/> (<span tal:replace="structure route/getNextHopDeviceLink"/>) </td> - <td class="tablevalues" tal:content="route/getInterfaceNameString"/> + <td class="tablevalues"><a tal:content="route/getInterfaceNameString" + tal:attributes="href route/interface/getPrimaryUrlPath"/> + </td> <td class="tablevalues" tal:content="route/routeproto"/> <td class="tablevalues" tal:content="route/routetype"/> <td class="tablevalues" align="center"> @@ -429,6 +488,8 @@ </tal:block> </tal:block> +</form> + </tal:block> </tal:block> Modified: trunk/Products/ZenModel/skins/zenmodel/dialog_addIpRouteEntry.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/dialog_addIpRouteEntry.pt 2007-04-06 21:30:32 UTC (rev 4556) +++ trunk/Products/ZenModel/skins/zenmodel/dialog_addIpRouteEntry.pt 2007-04-06 21:48:55 UTC (rev 4557) @@ -4,9 +4,24 @@ <p style="text-align:right;"> Destination: <input name="dest"><br/><br/> Next Hop: <input name="nexthopid"><br/><br/> -Interface: <input name="interface"><br/><br/> -Protocol: <input name="routeproto"><br/><br/> -Type: <input name="routetype"><br/><br/> +Interface: <select name="interface" +tal:define="interfaces here/os/interfaces/objectValuesAll"> + <option tal:repeat="interface interfaces" + tal:attributes="value interface/name" + tal:content="interface/name">/</option> +</select><br/><br/> +Protocol: <select name="routeproto" +tal:define="protocols here/os/routeProtoMap"> + <option tal:repeat="protocol protocols" + tal:attributes="value protocol" + tal:content="protocol">/</option> +</select><br/><br/> +Type: <select name="routetype" +tal:define="types here/os/routeTypeMap"> + <option tal:repeat="type types" + tal:attributes="value type" + tal:content="type">/</option> +</select><br/><br/> </p> <div id="dialog_buttons"> <input type="submit" name="addIpRouteEntry:method" Added: trunk/Products/ZenWidgets/skins/zenui/dialog_deleteFileSystems.pt Added: trunk/Products/ZenWidgets/skins/zenui/dialog_deleteIpInterfaces.pt Added: trunk/Products/ZenWidgets/skins/zenui/dialog_deleteIpRouteEntries.pt Added: trunk/Products/ZenWidgets/skins/zenui/dialog_deleteIpServices.pt Added: trunk/Products/ZenWidgets/skins/zenui/dialog_deleteOSProcesses.pt Added: trunk/Products/ZenWidgets/skins/zenui/dialog_deleteWinServices.pt Added: trunk/Products/ZenWidgets/skins/zenui/dialog_lockFileSystems.pt Added: trunk/Products/ZenWidgets/skins/zenui/dialog_lockIpInterfaces.pt Added: trunk/Products/ZenWidgets/skins/zenui/dialog_lockIpRouteEntries.pt Added: trunk/Products/ZenWidgets/skins/zenui/dialog_lockIpServices.pt Added: trunk/Products/ZenWidgets/skins/zenui/dialog_lockOSProcesses.pt Added: trunk/Products/ZenWidgets/skins/zenui/dialog_lockWinServices.pt |
From: <sv...@ze...> - 2007-04-06 21:30:31
|
Author: edahl Date: 2007-04-06 17:30:32 -0400 (Fri, 06 Apr 2007) New Revision: 4556 Modified: trunk/Products/DataCollector/plugins/zenoss/cmd/darwin/cpu.py trunk/Products/DataCollector/plugins/zenoss/cmd/darwin/ifconfig.py trunk/Products/DataCollector/plugins/zenoss/cmd/darwin/memory.py trunk/Products/DataCollector/plugins/zenoss/cmd/darwin/netstat_an.py trunk/Products/DataCollector/plugins/zenoss/cmd/darwin/process.py trunk/Products/DataCollector/plugins/zenoss/cmd/darwin/swap.py Log: * make darwin only run after the uname is found Modified: trunk/Products/DataCollector/plugins/zenoss/cmd/darwin/cpu.py =================================================================== --- trunk/Products/DataCollector/plugins/zenoss/cmd/darwin/cpu.py 2007-04-06 21:16:19 UTC (rev 4555) +++ trunk/Products/DataCollector/plugins/zenoss/cmd/darwin/cpu.py 2007-04-06 21:30:32 UTC (rev 4556) @@ -27,7 +27,7 @@ def condition(self, device, log): """does device meet the proper conditions for this collector to run""" - return device.os.uname in ['Darwin', ''] + return device.os.uname == 'Darwin' def process(self, device, results, log): Modified: trunk/Products/DataCollector/plugins/zenoss/cmd/darwin/ifconfig.py =================================================================== --- trunk/Products/DataCollector/plugins/zenoss/cmd/darwin/ifconfig.py 2007-04-06 21:16:19 UTC (rev 4555) +++ trunk/Products/DataCollector/plugins/zenoss/cmd/darwin/ifconfig.py 2007-04-06 21:30:32 UTC (rev 4556) @@ -23,7 +23,7 @@ def condition(self, device, log): - return device.os.uname in ['Darwin', ''] + return device.os.uname == 'Darwin' def chunk(self, output): @@ -33,16 +33,14 @@ chunks = [] chunk = [] for line in output.split('\n'): - if line.startsWith(' '): + if line.startswith(' '): chunk.append(' ') chunk.append(line) else: section = string.join(chunk, ' ').strip() if len(section) > 0: chunks.append(section) - chunk = [line] - chunks.append(string.join(chunk, ' ')) return chunks Modified: trunk/Products/DataCollector/plugins/zenoss/cmd/darwin/memory.py =================================================================== --- trunk/Products/DataCollector/plugins/zenoss/cmd/darwin/memory.py 2007-04-06 21:16:19 UTC (rev 4555) +++ trunk/Products/DataCollector/plugins/zenoss/cmd/darwin/memory.py 2007-04-06 21:30:32 UTC (rev 4556) @@ -22,7 +22,7 @@ def condition(self, device, log): - return device.os.uname in ['Darwin', ''] + return device.os.uname == 'Darwin' def process(self, device, results, log): Modified: trunk/Products/DataCollector/plugins/zenoss/cmd/darwin/netstat_an.py =================================================================== --- trunk/Products/DataCollector/plugins/zenoss/cmd/darwin/netstat_an.py 2007-04-06 21:16:19 UTC (rev 4555) +++ trunk/Products/DataCollector/plugins/zenoss/cmd/darwin/netstat_an.py 2007-04-06 21:30:32 UTC (rev 4556) @@ -20,7 +20,7 @@ def condition(self, device, log): - return device.os.uname in ['Darwin', ''] + return device.os.uname == 'Darwin' def process(self, device, results, log): Modified: trunk/Products/DataCollector/plugins/zenoss/cmd/darwin/process.py =================================================================== --- trunk/Products/DataCollector/plugins/zenoss/cmd/darwin/process.py 2007-04-06 21:16:19 UTC (rev 4555) +++ trunk/Products/DataCollector/plugins/zenoss/cmd/darwin/process.py 2007-04-06 21:30:32 UTC (rev 4556) @@ -24,7 +24,7 @@ def condition(self, device, log): - return device.os.uname in ['Darwin', ''] + return device.os.uname == 'Darwin' def process(self, device, results, log): Modified: trunk/Products/DataCollector/plugins/zenoss/cmd/darwin/swap.py =================================================================== --- trunk/Products/DataCollector/plugins/zenoss/cmd/darwin/swap.py 2007-04-06 21:16:19 UTC (rev 4555) +++ trunk/Products/DataCollector/plugins/zenoss/cmd/darwin/swap.py 2007-04-06 21:30:32 UTC (rev 4556) @@ -27,7 +27,7 @@ def condition(self, device, log): - return device.os.uname in ['Darwin', ''] + return device.os.uname == 'Darwin' def process(self, device, results, log): |
From: <sv...@ze...> - 2007-04-06 21:16:26
|
Author: ecn Date: 2007-04-06 17:16:19 -0400 (Fri, 06 Apr 2007) New Revision: 4555 Modified: trunk/Products/ZenHub/services/XmlRPCConfig.py trunk/Products/ZenRRD/zenperfxmlrpc.py Log: * push configs to the ever-popular zenperfxmlrpc Modified: trunk/Products/ZenHub/services/XmlRPCConfig.py =================================================================== --- trunk/Products/ZenHub/services/XmlRPCConfig.py 2007-04-06 21:11:05 UTC (rev 4554) +++ trunk/Products/ZenHub/services/XmlRPCConfig.py 2007-04-06 21:16:19 UTC (rev 4555) @@ -11,3 +11,9 @@ def remote_getXmlRpcDevices(self, *args, **kwargs): return self.config.getXmlRpcDevices(*args, **kwargs) + def getDeviceConfig(self, device): + return device.getXmlRpcTargets() + + def sendDeviceConfig(self, listener, config): + listener.callRemote('updateDeviceConfig', config) + Modified: trunk/Products/ZenRRD/zenperfxmlrpc.py =================================================================== --- trunk/Products/ZenRRD/zenperfxmlrpc.py 2007-04-06 21:11:05 UTC (rev 4554) +++ trunk/Products/ZenRRD/zenperfxmlrpc.py 2007-04-06 21:16:19 UTC (rev 4555) @@ -287,6 +287,11 @@ return p, url_key + def remote_updateDeviceConfig(self, cfg): + self.log.debug("Asynch update of config") + self.updateDeviceConfig(cfg) + + def updateDeviceConfig(self, xmlRpcTargets): 'Save the device configuration and create an XMLRPC proxy to talk to it' |
From: <sv...@ze...> - 2007-04-06 21:11:06
|
Author: ecn Date: 2007-04-06 17:11:05 -0400 (Fri, 06 Apr 2007) New Revision: 4554 Modified: trunk/Products/ZenHub/services/CommandConfig.py trunk/Products/ZenHub/services/PerformanceConfig.py trunk/Products/ZenHub/services/ProcessConfig.py trunk/Products/ZenHub/services/SnmpPerfConfig.py Log: * push configs to the Big 3 collectors Modified: trunk/Products/ZenHub/services/CommandConfig.py =================================================================== --- trunk/Products/ZenHub/services/CommandConfig.py 2007-04-06 21:10:25 UTC (rev 4553) +++ trunk/Products/ZenHub/services/CommandConfig.py 2007-04-06 21:11:05 UTC (rev 4554) @@ -5,3 +5,17 @@ def remote_getDataSourceCommands(self, *args, **kwargs): return self.config.getDataSourceCommands(*args, **kwargs) + def getDeviceConfig(self, device): + return device.getDataSourceCommands() + + def sendDeviceConfig(self, listener, config): + listener.callRemote('updateConfig', config) + + def update(self, object): + from Products.ZenModel.RRDDataSource import RRDDataSource + if isinstance(object, RRDDataSource): + if object.sourcetype != 'COMMAND': + return + + PerformanceConfig.update(self, object) + Modified: trunk/Products/ZenHub/services/PerformanceConfig.py =================================================================== --- trunk/Products/ZenHub/services/PerformanceConfig.py 2007-04-06 21:10:25 UTC (rev 4553) +++ trunk/Products/ZenHub/services/PerformanceConfig.py 2007-04-06 21:11:05 UTC (rev 4554) @@ -14,3 +14,46 @@ def remote_getDefaultRRDCreateCommand(self, *args, **kwargs): return self.config.getDefaultRRDCreateCommand(*args, **kwargs) + + def notifyAll(self, device): + if device.perfServer().id == self.instance: + cfg = self.getDeviceConfig(device) + if cfg is not None: + for listener in self.listeners: + self.sendDeviceConfig(listener, cfg) + + def getDeviceConfig(self, device): + "How to get the config for a device" + return None + + def sendDeviceConfig(self, listener, config): + "How to send the config to a device, probably via callRemote" + pass + + def update(self, object): + if not self.listeners: + return + + # the PerformanceConf changed + from Products.ZenModel.PerformanceConf import PerformanceConf + if isinstance(object, PerformanceConf): + for listener in self.listeners: + listener.callRemote('setPropertyItems', object.propertyItems()) + + # somethinge else... hunt around for some devices + from Products.ZenModel.Device import Device + from Products.ZenModel.DeviceClass import DeviceClass + from Acquisition import aq_parent + + while object: + # walk up until you hit an organizer or a device + if isinstance(object, DeviceClass): + for device in object.getSubDevices(): + self.notifyAll(device) + break + + if isinstance(object, Device): + self.notifyAll(object) + break + + object = aq_parent(object) Modified: trunk/Products/ZenHub/services/ProcessConfig.py =================================================================== --- trunk/Products/ZenHub/services/ProcessConfig.py 2007-04-06 21:10:25 UTC (rev 4553) +++ trunk/Products/ZenHub/services/ProcessConfig.py 2007-04-06 21:11:05 UTC (rev 4554) @@ -8,3 +8,9 @@ def remote_getProcessStatus(self, devices=None): return self.config.getProcessStatus(devices) + def getDeviceConfig(self, device): + return device.getOSProcessConf() + + def sendDeviceConfig(self, listener, config): + listener.callRemote('updateDevice', config) + Modified: trunk/Products/ZenHub/services/SnmpPerfConfig.py =================================================================== --- trunk/Products/ZenHub/services/SnmpPerfConfig.py 2007-04-06 21:10:25 UTC (rev 4553) +++ trunk/Products/ZenHub/services/SnmpPerfConfig.py 2007-04-06 21:11:05 UTC (rev 4554) @@ -8,46 +8,16 @@ def remote_getDeviceUpdates(self, devices): return self.config.getDeviceUpdates(devices) - def update(self, object): - if not self.listeners: - return + def getDeviceConfig(self, device): + return device.getSnmpOidTargets() - # the PerformanceConf changed - from Products.ZenModel.PerformanceConf import PerformanceConf - if isinstance(object, PerformanceConf): - for listener in self.listeners: - listener.callRemote('setPropertyItems', object.propertyItems()) - - # this is how to tell listeners there's a device change - def notifyAll(device): - if device.perfServer().id == self.instance: - cfg = device.getSnmpOidTargets() - for listener in self.listeners: - listener.callRemote('updateDeviceConfig', cfg) + def sendDeviceConfig(self, listener, config): + listener.callRemote('updateDeviceConfig', config) - # a device changed - from Products.ZenModel.Device import Device - if isinstance(object, Device): - notifyAll(object) - - # the template changed + def update(self, object): from Products.ZenModel.RRDDataSource import RRDDataSource - from Products.ZenModel.RRDDataPoint import RRDDataPoint - from Products.ZenModel.DeviceClass import DeviceClass - from Acquisition import aq_parent if isinstance(object, RRDDataSource): if object.sourcetype != 'SNMP': return - while object: - - if isinstance(object, DeviceClass): - for device in object.getSubDevices(): - notifyAll(device) - break - - if isinstance(object, Device): - notifyAll(object) - break - - object = aq_parent(object) + PerformanceConfig.update(self, object) |
From: <sv...@ze...> - 2007-04-06 21:10:27
|
Author: ecn Date: 2007-04-06 17:10:25 -0400 (Fri, 06 Apr 2007) New Revision: 4553 Modified: trunk/Products/ZenRRD/zenprocess.py Log: * provide an config push method Modified: trunk/Products/ZenRRD/zenprocess.py =================================================================== --- trunk/Products/ZenRRD/zenprocess.py 2007-04-06 21:10:11 UTC (rev 4552) +++ trunk/Products/ZenRRD/zenprocess.py 2007-04-06 21:10:25 UTC (rev 4553) @@ -264,24 +264,33 @@ return drive(doFetchConfig) + def remote_updateDevice(self, cfg): + name = self.updateDevice(cfg) + self.log.debug("Async config update for %s", name) + + def updateDevice(self, cfg): + (name, addr, snmpConf), procs = cfg + community, version, timeout, tries = snmpConf + d = self._devices.setdefault(name, Device()) + d.name = name + d.address = addr + d.community = community + d.version = version + d.timeout = timeout + d.tries = tries + d.updateConfig(procs) + d.protocol = self.snmpPort.protocol + return name + + def start(self, driver): 'Read the basic config needed to do anything' log.debug("fetching config") yield self.fetchConfig(); n = driver.next() removed = Set(self._devices.keys()) - for (name, addr, snmpConf), procs in n: - community, version, timeout, tries = snmpConf - removed.discard(name) - d = self._devices.setdefault(name, Device()) - d.name = name - d.address = addr - d.community = community - d.version = version - d.timeout = timeout - d.tries = tries - d.updateConfig(procs) - d.protocol = self.snmpPort.protocol + for cfg in n: + removed.discard(self.updateDevice(cfg)) for r in removed: del self._devices[r] |
From: <sv...@ze...> - 2007-04-06 21:10:13
|
Author: ecn Date: 2007-04-06 17:10:11 -0400 (Fri, 06 Apr 2007) New Revision: 4552 Modified: trunk/Products/ZenRRD/zencommand.py Log: * provide an config push method Modified: trunk/Products/ZenRRD/zencommand.py =================================================================== --- trunk/Products/ZenRRD/zencommand.py 2007-04-06 21:06:18 UTC (rev 4551) +++ trunk/Products/ZenRRD/zencommand.py 2007-04-06 21:10:11 UTC (rev 4552) @@ -369,6 +369,10 @@ self.pool = SshPool() + def remote_updateConfig(self, config): + self.log.debug("Async configuration update") + self.updateConfig([config]) + def updateConfig(self, config): current = dict([((c.device,c.command), c) for c in self.schedule]) update = [] |
From: <sv...@ze...> - 2007-04-06 21:06:26
|
Author: ecn Date: 2007-04-06 17:06:18 -0400 (Fri, 06 Apr 2007) New Revision: 4551 Modified: trunk/Products/ZenModel/DataRoot.py trunk/Products/ZenModel/Device.py Log: * simplify notification Modified: trunk/Products/ZenModel/DataRoot.py =================================================================== --- trunk/Products/ZenModel/DataRoot.py 2007-04-06 20:48:50 UTC (rev 4550) +++ trunk/Products/ZenModel/DataRoot.py 2007-04-06 21:06:18 UTC (rev 4551) @@ -463,12 +463,9 @@ if REQUEST is not None: return self.callZenScreen(REQUEST) - def notifyObjectChange(self, object = None): - if object is not None: - path = object.getPrimaryPath() - if len(path) > 2: - self.hubQueue.put(path) - else: - self.dmd.hubQueue.put(self.getPrimaryPath()) + def notifyObjectChange(self, object): + path = object.getPrimaryPath() + if len(path) > 2: + self.hubQueue.put(path) InitializeClass(DataRoot) Modified: trunk/Products/ZenModel/Device.py =================================================================== --- trunk/Products/ZenModel/Device.py 2007-04-06 20:48:50 UTC (rev 4550) +++ trunk/Products/ZenModel/Device.py 2007-04-06 21:06:18 UTC (rev 4551) @@ -880,7 +880,7 @@ """Set the changed datetime for this device. value default is now. """ self._lastChange.setDate(value) - self.notifyObjectChange() + self.notifyObjectChange(self) security.declareProtected('Change Device', 'setSnmpLastCollection') |
From: <sv...@ze...> - 2007-04-06 20:48:52
|
Author: ecn Date: 2007-04-06 16:48:50 -0400 (Fri, 06 Apr 2007) New Revision: 4550 Modified: trunk/Products/ZenRelations/PrimaryPathObjectManager.py Log: * handle semi-constructed objects better Modified: trunk/Products/ZenRelations/PrimaryPathObjectManager.py =================================================================== --- trunk/Products/ZenRelations/PrimaryPathObjectManager.py 2007-04-06 20:36:24 UTC (rev 4549) +++ trunk/Products/ZenRelations/PrimaryPathObjectManager.py 2007-04-06 20:48:50 UTC (rev 4550) @@ -90,16 +90,23 @@ RoleManager.manage_options + ZItem.manage_options) + def _noticeChange(self): + # the object may not be hooked in to have acquisition yet + try: + self.notifyObjectChange(self) + except AttributeError: + pass + def _setObject(self, id, obj, roles=None, user=None, set_owner=1): """Track __primary_parent__ when we are set into an object""" + self._noticeChange() obj.__primary_parent__ = aq_base(self) - self.notifyObjectChange(self) return ObjectManager._setObject(self, id, obj, roles, user, set_owner) def _delObject(self, id, dp=1): """When deleted clear __primary_parent__.""" - self.notifyObjectChange(self) + self._noticeChange() obj = self._getOb(id) ObjectManager._delObject(self, id, dp) obj.__primary_parent__ = None @@ -111,14 +118,14 @@ """ def _setObject(self, id, obj, roles=None, user=None, set_owner=1): """Track __primary_parent__ when we are set into an object""" - self.notifyObjectChange(self) + self._noticeChange() obj.__primary_parent__ = aq_base(self) return ObjectManager._setObject(self, id, obj, roles, user, set_owner) def _delObject(self, id, dp=1): """When deleted clear __primary_parent__.""" - self.notifyObjectChange(self) + self._noticeChange() obj = self._getOb(id) ObjectManager._delObject(self, id, dp) obj.__primary_parent__ = None |
From: <sv...@ze...> - 2007-04-06 20:36:34
|
Author: ecn Date: 2007-04-06 16:36:24 -0400 (Fri, 06 Apr 2007) New Revision: 4549 Modified: trunk/Products/ZenRRD/RRDDaemon.py Log: * spell callRemote correctly Modified: trunk/Products/ZenRRD/RRDDaemon.py =================================================================== --- trunk/Products/ZenRRD/RRDDaemon.py 2007-04-06 19:48:52 UTC (rev 4548) +++ trunk/Products/ZenRRD/RRDDaemon.py 2007-04-06 20:36:24 UTC (rev 4549) @@ -191,7 +191,7 @@ def model(self): class Fake: - def callremote(self, *args, **kwargs): + def callRemote(self, *args, **kwargs): return defer.fail("No connection to ZenHub") return self.services.get(self.initialServices[-1], Fake()) |
From: <sv...@ze...> - 2007-04-06 19:48:54
|
Author: ecn Date: 2007-04-06 15:48:52 -0400 (Fri, 06 Apr 2007) New Revision: 4548 Modified: trunk/Products/ZenHub/services/SnmpPerfConfig.py trunk/Products/ZenHub/zenhub.py trunk/Products/ZenModel/DataRoot.py trunk/Products/ZenModel/Device.py trunk/Products/ZenRelations/PrimaryPathObjectManager.py trunk/Products/ZenRelations/ZenPropertyManager.py Log: * notice more changes Modified: trunk/Products/ZenHub/services/SnmpPerfConfig.py =================================================================== --- trunk/Products/ZenHub/services/SnmpPerfConfig.py 2007-04-06 19:48:30 UTC (rev 4547) +++ trunk/Products/ZenHub/services/SnmpPerfConfig.py 2007-04-06 19:48:52 UTC (rev 4548) @@ -9,18 +9,45 @@ return self.config.getDeviceUpdates(devices) def update(self, object): - from Products.ZenModel.Device import Device if not self.listeners: return - if isinstance(object, Device): - if object.perfServer().id != self.instance: - return - cfg = object.getSnmpOidTargets() - for listener in self.listeners: - listener.callRemote('updateDeviceConfig', cfg) + # the PerformanceConf changed from Products.ZenModel.PerformanceConf import PerformanceConf if isinstance(object, PerformanceConf): for listener in self.listeners: listener.callRemote('setPropertyItems', object.propertyItems()) + # this is how to tell listeners there's a device change + def notifyAll(device): + if device.perfServer().id == self.instance: + cfg = device.getSnmpOidTargets() + for listener in self.listeners: + listener.callRemote('updateDeviceConfig', cfg) + + # a device changed + from Products.ZenModel.Device import Device + if isinstance(object, Device): + notifyAll(object) + + # the template changed + from Products.ZenModel.RRDDataSource import RRDDataSource + from Products.ZenModel.RRDDataPoint import RRDDataPoint + from Products.ZenModel.DeviceClass import DeviceClass + from Acquisition import aq_parent + if isinstance(object, RRDDataSource): + if object.sourcetype != 'SNMP': + return + + while object: + + if isinstance(object, DeviceClass): + for device in object.getSubDevices(): + notifyAll(device) + break + + if isinstance(object, Device): + notifyAll(object) + break + + object = aq_parent(object) Modified: trunk/Products/ZenHub/zenhub.py =================================================================== --- trunk/Products/ZenHub/zenhub.py 2007-04-06 19:48:30 UTC (rev 4547) +++ trunk/Products/ZenHub/zenhub.py 2007-04-06 19:48:52 UTC (rev 4548) @@ -139,6 +139,7 @@ def doProcessQueue(self, q): while self.dmd.hubQueue: object = q.pull() + self.log.debug("Object %s changed", "/".join(object)) from Products.ZenUtils.Utils import getObjByPath object = getObjByPath(self.dmd, object) for s in self.services.values(): Modified: trunk/Products/ZenModel/DataRoot.py =================================================================== --- trunk/Products/ZenModel/DataRoot.py 2007-04-06 19:48:30 UTC (rev 4547) +++ trunk/Products/ZenModel/DataRoot.py 2007-04-06 19:48:52 UTC (rev 4548) @@ -465,7 +465,9 @@ def notifyObjectChange(self, object = None): if object is not None: - self.hubQueue.put(object.getPrimaryPath()) + path = object.getPrimaryPath() + if len(path) > 2: + self.hubQueue.put(path) else: self.dmd.hubQueue.put(self.getPrimaryPath()) Modified: trunk/Products/ZenModel/Device.py =================================================================== --- trunk/Products/ZenModel/Device.py 2007-04-06 19:48:30 UTC (rev 4547) +++ trunk/Products/ZenModel/Device.py 2007-04-06 19:48:52 UTC (rev 4548) @@ -805,7 +805,8 @@ self.setLastChange() if REQUEST: - REQUEST['message'] = "Device Saved at time:" + from Products.ZenUtils.Time import SaveMessage + REQUEST['message'] = SaveMessage() return self.callZenScreen(REQUEST) Modified: trunk/Products/ZenRelations/PrimaryPathObjectManager.py =================================================================== --- trunk/Products/ZenRelations/PrimaryPathObjectManager.py 2007-04-06 19:48:30 UTC (rev 4547) +++ trunk/Products/ZenRelations/PrimaryPathObjectManager.py 2007-04-06 19:48:52 UTC (rev 4548) @@ -93,11 +93,13 @@ def _setObject(self, id, obj, roles=None, user=None, set_owner=1): """Track __primary_parent__ when we are set into an object""" obj.__primary_parent__ = aq_base(self) + self.notifyObjectChange(self) return ObjectManager._setObject(self, id, obj, roles, user, set_owner) def _delObject(self, id, dp=1): """When deleted clear __primary_parent__.""" + self.notifyObjectChange(self) obj = self._getOb(id) ObjectManager._delObject(self, id, dp) obj.__primary_parent__ = None @@ -109,12 +111,14 @@ """ def _setObject(self, id, obj, roles=None, user=None, set_owner=1): """Track __primary_parent__ when we are set into an object""" + self.notifyObjectChange(self) obj.__primary_parent__ = aq_base(self) return ObjectManager._setObject(self, id, obj, roles, user, set_owner) def _delObject(self, id, dp=1): """When deleted clear __primary_parent__.""" + self.notifyObjectChange(self) obj = self._getOb(id) ObjectManager._delObject(self, id, dp) obj.__primary_parent__ = None Modified: trunk/Products/ZenRelations/ZenPropertyManager.py =================================================================== --- trunk/Products/ZenRelations/ZenPropertyManager.py 2007-04-06 19:48:30 UTC (rev 4547) +++ trunk/Products/ZenRelations/ZenPropertyManager.py 2007-04-06 19:48:52 UTC (rev 4548) @@ -219,6 +219,7 @@ """ if propname: self._delProperty(propname) + self.notifyObjectChange(self) if REQUEST: return self.callZenScreen(REQUEST) |
From: <sv...@ze...> - 2007-04-06 19:48:31
|
Author: ecn Date: 2007-04-06 15:48:30 -0400 (Fri, 06 Apr 2007) New Revision: 4547 Modified: trunk/Products/ZenUtils/Time.py Log: * fix that "saved at time message" Modified: trunk/Products/ZenUtils/Time.py =================================================================== --- trunk/Products/ZenUtils/Time.py 2007-04-06 19:47:29 UTC (rev 4546) +++ trunk/Products/ZenUtils/Time.py 2007-04-06 19:48:30 UTC (rev 4547) @@ -41,6 +41,13 @@ value = _maybenow(gmtSecondsSince1970) return time.strftime("%Y%m%d%H%M%S", time.localtime(value)) +def HHMMSS(gmtSecondsSince1970 = None): + value = _maybenow(gmtSecondsSince1970) + return time.strftime("%H:%M:%S", time.localtime(value)) + +def SaveMessage(): + return "Saved at time: " + HHMMSS() + def Duration(seconds): result = ':%02d' % (seconds % 60) seconds /= 60 |
From: <sv...@ze...> - 2007-04-06 19:47:31
|
Author: ecn Date: 2007-04-06 15:47:29 -0400 (Fri, 06 Apr 2007) New Revision: 4546 Modified: trunk/Products/ZenEvents/EventClassInst.py trunk/Products/ZenModel/Manufacturer.py trunk/Products/ZenModel/OSProcessClass.py trunk/Products/ZenModel/ProductClass.py trunk/Products/ZenModel/ServiceClass.py trunk/Products/ZenModel/ZenModelBase.py trunk/Products/ZenModel/ZenModelRM.py Log: * fix that "saved at time message" Modified: trunk/Products/ZenEvents/EventClassInst.py =================================================================== --- trunk/Products/ZenEvents/EventClassInst.py 2007-04-06 18:38:07 UTC (rev 4545) +++ trunk/Products/ZenEvents/EventClassInst.py 2007-04-06 19:47:29 UTC (rev 4546) @@ -319,7 +319,8 @@ self.explanation = explanation self.resolution = resolution if REQUEST: - REQUEST['message'] = "Saved at time:" + from Products.ZenUtils.Time import SaveMessage + REQUEST['message'] = SaveMessage() return self.callZenScreen(REQUEST, redirect) Modified: trunk/Products/ZenModel/Manufacturer.py =================================================================== --- trunk/Products/ZenModel/Manufacturer.py 2007-04-06 18:38:07 UTC (rev 4545) +++ trunk/Products/ZenModel/Manufacturer.py 2007-04-06 19:47:29 UTC (rev 4546) @@ -186,7 +186,8 @@ self.state = state self.zip = zip if REQUEST: - REQUEST['message'] = "Saved at time:" + from Products.ZenUtils.Time import SaveMessage + REQUEST['message'] = SaveMessage() return self.callZenScreen(REQUEST, redirect) Modified: trunk/Products/ZenModel/OSProcessClass.py =================================================================== --- trunk/Products/ZenModel/OSProcessClass.py 2007-04-06 18:38:07 UTC (rev 4545) +++ trunk/Products/ZenModel/OSProcessClass.py 2007-04-06 19:47:29 UTC (rev 4546) @@ -142,7 +142,8 @@ self.description = description self.ignoreParameters = ignoreParameters if REQUEST: - REQUEST['message'] = "Saved at time:" + from Products.ZenUtils.Time import SaveMessage + REQUEST['message'] = SaveMessage() return self.callZenScreen(REQUEST, redirect) Modified: trunk/Products/ZenModel/ProductClass.py =================================================================== --- trunk/Products/ZenModel/ProductClass.py 2007-04-06 18:38:07 UTC (rev 4545) +++ trunk/Products/ZenModel/ProductClass.py 2007-04-06 19:47:29 UTC (rev 4546) @@ -162,7 +162,8 @@ self.partNumber = partNumber self.description = description if REQUEST: - REQUEST['message'] = "Saved at time:" + from Products.ZenUtils.Time import SaveMessage + REQUEST['message'] = SaveMessage() return self.callZenScreen(REQUEST, redirect) Modified: trunk/Products/ZenModel/ServiceClass.py =================================================================== --- trunk/Products/ZenModel/ServiceClass.py 2007-04-06 18:38:07 UTC (rev 4545) +++ trunk/Products/ZenModel/ServiceClass.py 2007-04-06 19:47:29 UTC (rev 4546) @@ -181,7 +181,8 @@ self.port = port self.description = description if REQUEST: - REQUEST['message'] = "Saved at time:" + from Products.ZenUtils.Time import SaveMessage + REQUEST['message'] = SaveMessage() return self.callZenScreen(REQUEST, redirect) Modified: trunk/Products/ZenModel/ZenModelBase.py =================================================================== --- trunk/Products/ZenModel/ZenModelBase.py 2007-04-06 18:38:07 UTC (rev 4545) +++ trunk/Products/ZenModel/ZenModelBase.py 2007-04-06 19:47:29 UTC (rev 4546) @@ -148,7 +148,8 @@ """ self.manage_changeProperties(**REQUEST.form) if REQUEST: - REQUEST['message'] = "Saved at time:" + from Products.ZenUtils.Time import SaveMessage + REQUEST['message'] = SaveMessage() return self.callZenScreen(REQUEST) Modified: trunk/Products/ZenModel/ZenModelRM.py =================================================================== --- trunk/Products/ZenModel/ZenModelRM.py 2007-04-06 18:38:07 UTC (rev 4545) +++ trunk/Products/ZenModel/ZenModelRM.py 2007-04-06 19:47:29 UTC (rev 4546) @@ -72,7 +72,8 @@ self.manage_changeProperties(**REQUEST.form) self.notifyObjectChange(self) if REQUEST: - REQUEST['message'] = "Saved at time:" + from Products.ZenUtils.Time import SaveMessage + REQUEST['message'] = SaveMessage() return self.callZenScreen(REQUEST, redirect) |