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-02 15:18:27
|
Author: chris Date: 2007-04-02 11:18:27 -0400 (Mon, 02 Apr 2007) New Revision: 4445 Added: trunk/inst/rpm/centos43.deps Removed: trunk/inst/rpm/centos-4.3.deps Log: renamed. release numbers cannot have dashes in them Deleted: trunk/inst/rpm/centos-4.3.deps Copied: trunk/inst/rpm/centos43.deps (from rev 4442, trunk/inst/rpm/centos-4.3.deps) |
From: <sv...@ze...> - 2007-04-02 14:59:11
|
Author: ecn Date: 2007-04-02 10:59:12 -0400 (Mon, 02 Apr 2007) New Revision: 4444 Added: trunk/Products/ZenHub/client2.py Log: * simple xmlrpc tester Added: trunk/Products/ZenHub/client2.py |
From: <sv...@ze...> - 2007-04-02 14:51:56
|
Author: ecn Date: 2007-04-02 10:51:57 -0400 (Mon, 02 Apr 2007) New Revision: 4443 Modified: trunk/Products/ZenHub/ trunk/Products/ZenHub/client1.py trunk/Products/ZenHub/zenhub.py Log: * ignore *.pyc Property changes on: trunk/Products/ZenHub ___________________________________________________________________ Name: svn:ignore + *.pyc Modified: trunk/Products/ZenHub/client1.py =================================================================== --- trunk/Products/ZenHub/client1.py 2007-04-02 14:51:05 UTC (rev 4442) +++ trunk/Products/ZenHub/client1.py 2007-04-02 14:51:57 UTC (rev 4443) @@ -4,18 +4,25 @@ from twisted.internet import reactor from twisted.cred import credentials +import Globals +from Products.ZenUtils.Driver import drive + +import zenhub + def main(): - factory = pb.PBClientFactory() - reactor.connectTCP("localhost", 8800, factory) - def1 = factory.login(credentials.UsernamePassword("user1", "pass1")) - def1.addCallback(connected) - #def1.addCallback(lambda _: reactor.stop()) + def go(driver): + factory = pb.PBClientFactory() + reactor.connectTCP("localhost", zenhub.PB_PORT, factory) + + yield factory.login(credentials.UsernamePassword("zenoss", "zenoss")) + perspective = driver.next() + print 'got perspective', perspective + + yield perspective.callRemote('getService', 'EventService', 'client1') + service = driver.next() + print 'got service', service + + drive(go).addBoth(lambda x: reactor.stop()) reactor.run() -def connected(perspective): - print "got perspective1 ref:", perspective - print "asking it to foo(13)" - perspective.callRemote("foo", 13) - main() - Modified: trunk/Products/ZenHub/zenhub.py =================================================================== --- trunk/Products/ZenHub/zenhub.py 2007-04-02 14:51:05 UTC (rev 4442) +++ trunk/Products/ZenHub/zenhub.py 2007-04-02 14:51:57 UTC (rev 4443) @@ -14,12 +14,11 @@ __version__ = "$Revision$"[11:-2] -import time -import socket +from socket import getfqdn +import os from twisted.cred import portal, checkers -from twisted.cred.checkers import InMemoryUsernamePasswordDatabaseDontUse from twisted.spread import pb from twisted.internet import reactor, defer @@ -51,7 +50,7 @@ if not self.hub.services.has_key(serviceName): return None svc = self.hub.services[serviceName] - svc.addCollector[collector.getName()] = collector + # svc.addCollector[collector.getName()] = collector return svc @@ -68,7 +67,6 @@ return pb.IPerspective, self.hubAvitar, lambda:None - class ZenHub(ZCmdBase): 'Listen for xmlrpc requests and turn them into events' @@ -90,16 +88,23 @@ xmlsvc = XmlRpcService(self.dmd) reactor.listenTCP(self.options.xmlrpcport, server.Site(xmlsvc)) - self.zem.sendEvent(Event(device=socket.getfqdn(), - eventClass=App_Start, - summary="%s started" % self.name, - severity=0, - component=self.name)) + self.sendEvent(eventClass=App_Start, + summary="%s started" % self.name, + severity=0) + def sendEvent(self, **kw): + if not 'device' in kw: + kw['device'] = getfqdn() + if not 'component' in kw: + kw['component'] = self.name + self.zem.sendEvent(Event(**kw)) + def loadCheckers(self): - checker = InMemoryUsernamePasswordDatabaseDontUse() - checker.addUser("test", "test") - return [checker] + try: + return [checkers.FilePasswordDB(self.options.passwordfile)] + except Exception, ex: + self.log.exception("Unable to load %s", self.options.passwordfile) + return [] def buildServices(self): @@ -112,7 +117,7 @@ """Since we don't do anything on a regular basis, just push heartbeats regularly""" seconds = 30 - evt = EventHeartbeat(socket.getfqdn(), self.name, 3*seconds) + evt = EventHeartbeat(getfqdn(), self.name, 3*seconds) self.zem.sendEvent(evt) reactor.callLater(seconds, self.heartbeat) @@ -120,11 +125,9 @@ def finish(self): 'things to do at shutdown: thread cleanup, logs and events' #self.report() - self.zem.sendEvent(Event(device=socket.getfqdn(), - eventClass=App_Stop, - summary="%s stopped" % self.name, - severity=4, - component=self.name)) + self.sendEvent(eventClass=App_Stop, + summary="%s stopped" % self.name, + severity=4) def sigTerm(self, signum, frame): @@ -156,6 +159,11 @@ dest='pbport', type='int', default=PB_PORT) + self.parser.add_option('--passwd', + dest='passwordfile', + type='string', + default=os.path.join(os.environ['ZENHOME'], + 'etc','hubpasswd')) if __name__ == '__main__': |
From: <sv...@ze...> - 2007-04-02 14:51:04
|
Author: chris Date: 2007-04-02 10:51:05 -0400 (Mon, 02 Apr 2007) New Revision: 4442 Modified: trunk/inst/rpm/centos-4.3.deps Log: one more slashy Modified: trunk/inst/rpm/centos-4.3.deps =================================================================== --- trunk/inst/rpm/centos-4.3.deps 2007-04-02 14:48:29 UTC (rev 4441) +++ trunk/inst/rpm/centos-4.3.deps 2007-04-02 14:51:05 UTC (rev 4442) @@ -2,4 +2,4 @@ Requires: MySQL-client-standard >= 5.0.22 \ Requires: python >= 2.3.4 \ Requires: net-snmp \ -Requires: sudo +Requires: sudo \ |
From: <sv...@ze...> - 2007-04-02 14:48:28
|
Author: chris Date: 2007-04-02 10:48:29 -0400 (Mon, 02 Apr 2007) New Revision: 4441 Modified: trunk/inst/rpm/centos-4.3.deps Log: added slashies in order for sed to work Modified: trunk/inst/rpm/centos-4.3.deps =================================================================== --- trunk/inst/rpm/centos-4.3.deps 2007-04-02 14:41:35 UTC (rev 4440) +++ trunk/inst/rpm/centos-4.3.deps 2007-04-02 14:48:29 UTC (rev 4441) @@ -1,5 +1,5 @@ -Requires: MySQL-server-standard >= 5.0.22 -Requires: MySQL-client-standard >= 5.0.22 -Requires: python >= 2.3.4 -Requires: net-snmp +Requires: MySQL-server-standard >= 5.0.22 \ +Requires: MySQL-client-standard >= 5.0.22 \ +Requires: python >= 2.3.4 \ +Requires: net-snmp \ Requires: sudo |
From: <sv...@ze...> - 2007-04-02 14:41:34
|
Author: chris Date: 2007-04-02 10:41:35 -0400 (Mon, 02 Apr 2007) New Revision: 4440 Added: trunk/inst/rpm/ trunk/inst/rpm/centos-4.3.deps trunk/inst/rpm/zenoss-plugins.spec trunk/inst/rpm/zenoss.spec Log: added. all rpm related stuff lives here Added: trunk/inst/rpm/centos-4.3.deps Copied: trunk/inst/rpm/zenoss-plugins.spec (from rev 4394, trunk/inst/zenoss-plugins.spec) Copied: trunk/inst/rpm/zenoss.spec (from rev 4394, trunk/inst/zenoss.spec) |
From: <sv...@ze...> - 2007-04-02 14:41:18
|
Author: chris Date: 2007-04-02 10:41:20 -0400 (Mon, 02 Apr 2007) New Revision: 4439 Removed: trunk/inst/zenoss-plugins.spec trunk/inst/zenoss.spec Log: moved into the rpm directory Deleted: trunk/inst/zenoss-plugins.spec Deleted: trunk/inst/zenoss.spec |
From: <sv...@ze...> - 2007-04-02 14:40:56
|
Author: chris Date: 2007-04-02 10:40:53 -0400 (Mon, 02 Apr 2007) New Revision: 4438 Modified: trunk/inst/GNUmakefile Log: added an extract of the inst/fs directory. this will allow us to land files with fully qualified directory names in them onto various boxes Modified: trunk/inst/GNUmakefile =================================================================== --- trunk/inst/GNUmakefile 2007-04-02 14:13:19 UTC (rev 4437) +++ trunk/inst/GNUmakefile 2007-04-02 14:40:53 UTC (rev 4438) @@ -375,6 +375,7 @@ $(SVNGET) $(SVNURL)/$(SVNTAG)/Products Products $(LOG) ; \ find Products -name .cvsignore -exec rm -f '{}' \; ; \ $(SVNGET) $(SVNURL)/$(SVNTAG)/bin bin $(LOG) ; \ + $(SVNGET) $(SVNURL)/$(SVNTAG)/inst/fs extras $(LOG) ; \ fi libzenoss-install: always |
From: <sv...@ze...> - 2007-04-02 14:13:19
|
Author: ecn Date: 2007-04-02 10:13:19 -0400 (Mon, 02 Apr 2007) New Revision: 4437 Modified: trunk/Products/DataCollector/zenmodeler.py Log: #653: allow user to specify the list of plugins, in order * define the list of names the user has selected Modified: trunk/Products/DataCollector/zenmodeler.py =================================================================== --- trunk/Products/DataCollector/zenmodeler.py 2007-04-02 14:03:50 UTC (rev 4436) +++ trunk/Products/DataCollector/zenmodeler.py 2007-04-02 14:13:19 UTC (rev 4437) @@ -82,6 +82,7 @@ tpref = getattr(device,'zTransportPreference', 'snmp') aqignore = getattr(device, 'zCollectorIgnorePlugins', "") aqcollect = getattr(device, 'zCollectorCollectPlugins', "") + names = getattr(device, 'zCollectorPlugins', []) if transport == 'snmp' and device.zSnmpMonitorIgnore: return [] plugins = {} for plugin in self.collectorPlugins.values(): |
From: <sv...@ze...> - 2007-04-02 14:03:50
|
Author: ecn Date: 2007-04-02 10:03:50 -0400 (Mon, 02 Apr 2007) New Revision: 4436 Modified: trunk/Products/DataCollector/zenmodeler.py Log: #653: allow user to specify the list of plugins, in order * added more ugly Modified: trunk/Products/DataCollector/zenmodeler.py =================================================================== --- trunk/Products/DataCollector/zenmodeler.py 2007-04-02 13:53:10 UTC (rev 4435) +++ trunk/Products/DataCollector/zenmodeler.py 2007-04-02 14:03:50 UTC (rev 4436) @@ -87,7 +87,10 @@ for plugin in self.collectorPlugins.values(): pname = plugin.name() try: - if not plugin.condition(device, self.log): + if pname in names: + self.log.debug("using %s on %s",pname, device.id) + plugins[plugin.maptype] = plugin + elif not plugin.condition(device, self.log): self.log.debug("condition failed %s on %s",pname,device.id) elif ((self.options.ignorePlugins and re.search(self.options.ignorePlugins, pname)) |
From: <sv...@ze...> - 2007-04-02 13:53:10
|
Author: marc Date: 2007-04-02 09:53:10 -0400 (Mon, 02 Apr 2007) New Revision: 4435 Modified: trunk/Products/ZenEvents/EventClass.py Log: #1157 * changed path in relation Modified: trunk/Products/ZenEvents/EventClass.py =================================================================== --- trunk/Products/ZenEvents/EventClass.py 2007-04-02 13:32:38 UTC (rev 4434) +++ trunk/Products/ZenEvents/EventClass.py 2007-04-02 13:53:10 UTC (rev 4435) @@ -52,7 +52,7 @@ default_catalog = "eventClassSearch" _relations = ZenPackable._relations + ( - ("instances", ToManyCont(ToOne,"Products.ZenEvents.EventClassInst","eventClass")), + ("instances", ToManyCont(ToOne,"EventClassInst","eventClass")), ) |
From: <sv...@ze...> - 2007-04-02 13:33:02
|
Author: ecn Date: 2007-04-02 09:32:38 -0400 (Mon, 02 Apr 2007) New Revision: 4434 Added: trunk/Products/ZenModel/migrate/zCollectorPlugins.py Modified: trunk/Products/ZenModel/Device.py trunk/Products/ZenModel/DeviceClass.py trunk/Products/ZenModel/migrate/__init__.py trunk/Products/ZenModel/skins/zenmodel/zPropertyEdit.pt trunk/Products/ZenRelations/ZenPropertyManager.py Log: #653: allow user to specify the list of plugins, in order Modified: trunk/Products/ZenModel/Device.py =================================================================== --- trunk/Products/ZenModel/Device.py 2007-04-02 13:29:31 UTC (rev 4433) +++ trunk/Products/ZenModel/Device.py 2007-04-02 13:32:38 UTC (rev 4434) @@ -1328,5 +1328,13 @@ map(lambda o: o.exportXml(ofile, ignorerels), (self.hw, self.os)) + def zenPropertyOptions(self, propname): + "Provide a set of default options for a ZProperty" + if propname == 'zCollectorPlugins': + from Products.DataCollector.Plugins import loadPlugins + names = loadPlugins(self.dmd).keys() + names.sort() + return names + return ManagedEntity.zenPropertyOptions(self, propname) InitializeClass(Device) Modified: trunk/Products/ZenModel/DeviceClass.py =================================================================== --- trunk/Products/ZenModel/DeviceClass.py 2007-04-02 13:29:31 UTC (rev 4433) +++ trunk/Products/ZenModel/DeviceClass.py 2007-04-02 13:32:38 UTC (rev 4434) @@ -581,8 +581,11 @@ # DataCollector properties devs._setProperty("zTransportPreference", "snmp") + # should be deprecated: devs._setProperty("zCollectorIgnorePlugins", "") devs._setProperty("zCollectorCollectPlugins", "") + # replaced by: + devs._setProperty("zCollectorPlugins", [], type='lines') devs._setProperty("zCollectorClientTimeout", 180, type="int") devs._setProperty("zCollectorDecoding", 'latin-1') devs._setProperty("zCommandUsername", "") Modified: trunk/Products/ZenModel/migrate/__init__.py =================================================================== --- trunk/Products/ZenModel/migrate/__init__.py 2007-04-02 13:29:31 UTC (rev 4433) +++ trunk/Products/ZenModel/migrate/__init__.py 2007-04-02 13:32:38 UTC (rev 4434) @@ -70,3 +70,4 @@ import deviceTemplatesProperty import zlocal import evenbetterstandarderrormessage +import zCollectorPlugins Added: trunk/Products/ZenModel/migrate/zCollectorPlugins.py Modified: trunk/Products/ZenModel/skins/zenmodel/zPropertyEdit.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/zPropertyEdit.pt 2007-04-02 13:29:31 UTC (rev 4433) +++ trunk/Products/ZenModel/skins/zenmodel/zPropertyEdit.pt 2007-04-02 13:32:38 UTC (rev 4434) @@ -1,6 +1,14 @@ <tal:block metal:use-macro="here/templates/macros/page2"> <tal:block metal:fill-slot="contentPane"> +<tal:block define="msie python:'MSIE' in here.REQUEST.HTTP_USER_AGENT"> +<tal:block tal:condition="not:msie"> + <script src="/zport/js/MochiKit.js"></script> + <script src="/zport/js/DragAndDrop.js"></script> + <script src="/zport/js/Sortable.js"></script> + <script src="zendragdrop.js"></script> +</tal:block> + <form method="post" tal:attributes="action string:${request/URL1}"> <input type="hidden" name="zenScreenName" tal:attributes="value template/id"/> @@ -28,7 +36,8 @@ tal:content="python: here.zenPropertyString(prop)"/> <td class="tablevalues" tal:condition="here/isManager" tal:define="ptype python:here.zenPropertyType(prop); - pvalue python: here.zenPropertyString(prop)"> + pvalue python:here.zenPropertyString(prop); + popts python:here.zenPropertyOptions(prop);"> <span tal:condition="python: ptype=='boolean'"> <select class="tablevalues" tal:attributes="name python:prop+':'+ptype"> @@ -36,12 +45,39 @@ tal:attributes="value e; selected python:e==pvalue"/> </select> </span> - <span tal:condition="python: ptype=='lines'"> - <textarea class="tablevalues" rows='3' cols="33" - tal:attributes="name python:prop+':'+ptype" - tal:content="pvalue"> - </textarea> - </span> + <span tal:condition="python: ptype=='lines'"> + <tal:block tal:condition="python:msie or not popts"> + <textarea class="tablevalues" rows='3' cols="33" + tal:attributes="name python:prop+':'+ptype" + tal:content="pvalue"> + </textarea> + </tal:block> + <!-- =========== swoopy sortable selector ============ --> + <tal:block tal:condition="python:not msie and popts" + tal:define="propName python:prop+':'+ptype; + ta python:'ta_' + prop; + ul python:'ul_' + prop;"> + <div style="float:left;"> + <textarea tal:content="pvalue" + tal:attributes="name propName; id ta"/> + <h5>Plugins (drag to change order)</h5> + </div> + <div style="float:left;"> + <ul tal:attributes="name propName; id ul" + class="sortable_list fieldlist"> + <li class="sortable_item fieldlist" + tal:repeat="plugin python: + [x for x in popts if x not in here.zCollectorPlugins]" + tal:content="plugin"/> + </ul> + <h5>Available fields (drag to other list to add)</h5> + </div> + <script tal:content=" + python:'''var x = new ZenDragDropList('%s', '%s');''' % (ta, ul) + "/> + <!-- =========== swoopy sortable selector =============== --> + </tal:block> + </span> <span tal:condition="python: ptype=='text'"> <textarea class="tablevalues" rows='5' cols="33" tal:attributes="name python:prop+':'+ptype" @@ -147,3 +183,5 @@ </tal:block> </tal:block> +</tal:block> + Modified: trunk/Products/ZenRelations/ZenPropertyManager.py =================================================================== --- trunk/Products/ZenRelations/ZenPropertyManager.py 2007-04-02 13:29:31 UTC (rev 4433) +++ trunk/Products/ZenRelations/ZenPropertyManager.py 2007-04-02 13:32:38 UTC (rev 4434) @@ -219,6 +219,11 @@ if propname: self._delProperty(propname) if REQUEST: return self.callZenScreen(REQUEST) - - + + + def zenPropertyOptions(self, propname): + "Provide a set of default options for a ZProperty" + return [] + + InitializeClass(ZenPropertyManager) |
From: <sv...@ze...> - 2007-04-02 13:29:33
|
Author: ecn Date: 2007-04-02 09:29:31 -0400 (Mon, 02 Apr 2007) New Revision: 4433 Added: trunk/Products/DataCollector/Plugins.py Modified: trunk/Products/DataCollector/zenmodeler.py Log: * move plugin code to it's own module Added: trunk/Products/DataCollector/Plugins.py Modified: trunk/Products/DataCollector/zenmodeler.py =================================================================== --- trunk/Products/DataCollector/zenmodeler.py 2007-04-02 12:53:00 UTC (rev 4432) +++ trunk/Products/DataCollector/zenmodeler.py 2007-04-02 13:29:31 UTC (rev 4433) @@ -4,8 +4,6 @@ # ################################################################# -import sys -import os import time import types import re @@ -17,7 +15,6 @@ from twisted.internet import reactor from Products.ZenUtils.ZCmdBase import ZCmdBase -from Products.ZenUtils.Utils import importClass from Products.ZenEvents.ZenEventClasses import Heartbeat from ApplyDataMap import ApplyDataMap, ApplyDataMapThread @@ -34,9 +31,7 @@ defaultPort = 22 defaultStartSleep = 10 * 60 -pluginskip = ("CollectorPlugin.py", "DataMaps.py") -def plfilter(f): - return f.endswith(".py") and not (f.startswith("_") or f in pluginskip) +from Plugins import loadPluginDir class ZenModeler(ZCmdBase): @@ -75,36 +70,10 @@ self.log.debug("in debug mode starting apply in main thread.") self.applyData = ApplyDataMap(self) - def loadPluginDir(self, pdir): - self.log.info("loading collector plugins from: %s", pdir) - lpdir = len(pdir)+1 - for path, dirname, filenames in os.walk(pdir): - path = path[lpdir:] - for filename in filter(plfilter, filenames): - modpath = os.path.join(path,filename[:-3]).replace("/",".") - self.log.debug("loading: %s", modpath) - try: - sys.path.insert(0, pdir) - const = importClass(modpath) - sys.path.remove(pdir) - plugin = const() - self.collectorPlugins[plugin.name()] = plugin - except ImportError: - self.log.exception("problem loading plugin:%s",modpath) - - def loadPlugins(self): """Load plugins from the plugin directory. """ - plugins = filter(lambda x: x.startswith("plugins"), sys.modules) - for key in ['zenoss'] + plugins: - self.log.debug("clearing plugin %s", key) - if sys.modules.has_key(key): del sys.modules[key] - pdir = os.path.join(os.path.dirname(__file__),"plugins") - self.log.info("loading collector plugins from:%s", pdir) - self.loadPluginDir(pdir) - for pack in self.dmd.packs(): - self.loadPluginDir(pack.path('modeler', 'plugins')) + self.collectorPlugins = loadPlugins(self.dmd) def selectPlugins(self, device, transport): |
From: <sv...@ze...> - 2007-04-02 12:53:28
|
Author: edahl Date: 2007-04-02 08:53:00 -0400 (Mon, 02 Apr 2007) New Revision: 4432 Added: trunk/Products/ZenHub/ trunk/Products/ZenHub/EventService.py trunk/Products/ZenHub/HubService.py trunk/Products/ZenHub/XmlRpcService.py trunk/Products/ZenHub/client1.py trunk/Products/ZenHub/pbclient.py trunk/Products/ZenHub/pbserver.py trunk/Products/ZenHub/zenhub.py Log: * very rough first pass at zenhub Added: trunk/Products/ZenHub/EventService.py Added: trunk/Products/ZenHub/HubService.py Added: trunk/Products/ZenHub/XmlRpcService.py Added: trunk/Products/ZenHub/client1.py Added: trunk/Products/ZenHub/pbclient.py Added: trunk/Products/ZenHub/pbserver.py Added: trunk/Products/ZenHub/zenhub.py |
From: <sv...@ze...> - 2007-03-31 00:09:37
|
Author: edahl Date: 2007-03-30 20:09:37 -0400 (Fri, 30 Mar 2007) New Revision: 4431 Modified: trunk/Products/ZenEvents/EventClassInst.py Log: * fix relationship definition Modified: trunk/Products/ZenEvents/EventClassInst.py =================================================================== --- trunk/Products/ZenEvents/EventClassInst.py 2007-03-30 20:50:52 UTC (rev 4430) +++ trunk/Products/ZenEvents/EventClassInst.py 2007-03-31 00:09:37 UTC (rev 4431) @@ -73,7 +73,7 @@ _relations = ZenPackable._relations + ( - ("eventClass", ToOne(ToMany,"Products.ZenEvents.EventClass","instances")), + ("eventClass", ToOne(ToManyCont,"Products.ZenEvents.EventClass","instances")), ) |
From: <sv...@ze...> - 2007-03-30 20:50:54
|
Author: ian Date: 2007-03-30 16:50:52 -0400 (Fri, 30 Mar 2007) New Revision: 4430 Modified: trunk/Products/ZenWidgets/skins/zenui/javascript/menus.js Log: * Made menu positioning take scrolling into account Modified: trunk/Products/ZenWidgets/skins/zenui/javascript/menus.js =================================================================== --- trunk/Products/ZenWidgets/skins/zenui/javascript/menus.js 2007-03-30 20:32:36 UTC (rev 4429) +++ trunk/Products/ZenWidgets/skins/zenui/javascript/menus.js 2007-03-30 20:50:52 UTC (rev 4430) @@ -4,15 +4,16 @@ var pDims = getElementDimensions(rel); var sDims = getElementDimensions(sub); var vDims = getViewportDimensions(); + var vPos = getViewportPosition(); finalDims = {x:0, y:0} // Check to see if the menu will appear outside the viewport // If so, make it fly out on the left totalX = pPos.x + pDims.w + sDims.w; - finalDims.x = totalX>=vDims.w?-sDims.w+2:sDims.w-10; + finalDims.x = totalX>=vDims.w+vPos.x?-sDims.w+2:sDims.w-10; // Check to see if the menu bottom is outside the viewport // If so, move it up so that it fits totalY = pPos.y + sDims.h; - finalDims.y = totalY>=vDims.h?0-(totalY-vDims.h):0; + finalDims.y = totalY>=vDims.h+vPos.y?0-(totalY-vDims.h)+vPos.y:0; return finalDims } @@ -22,14 +23,15 @@ var pDims = getElementDimensions(rel); var vDims = getViewportDimensions(); var mDims = getElementDimensions(menu); + var vPos = getViewportPosition(); finalDims = $(menu).className=='devmovemenuitems'?{x:0, y:0}:{x:0, y:24}; totalX = pPos.x + mDims.w; - finalDims.x = totalX>=vDims.w?pDims.w-mDims.w:finalDims.x; + finalDims.x = totalX>=vDims.w+vPos.x?pDims.w-mDims.w:finalDims.x; finalDims.x = $(menu).className=='devmovemenuitems'?-mDims.w:finalDims.x; totalY = pPos.y + pDims.h + mDims.h; var topmenu = getElementsByTagAndClassName('div', 'menu_top', menu)[0]; - if (totalY>=vDims.h) { - finalDims.y = 0-(totalY-vDims.h); + if (totalY>=vDims.h+vPos.y) { + finalDims.y = 0-(totalY-vDims.h)+vPos.y; setStyle(topmenu, {'background-image':'url(img/menu_top_rounded.gif)'}); } else { setStyle(topmenu, {'background-image':'url(img/menu_top.gif)'}); @@ -65,20 +67,16 @@ } var dropOtherMenuButtons = function(button) { + var lowerButton = function(btn) { setStyle(btn, {'z-index':'9000'})}; mymenu = $(button).parentNode; - others = getElementsByTagAndClassName('div','littlemenu'); - for (i=0;(btn=others[i]);++i) { - if (btn!=mymenu) setStyle(btn, {'z-index':'9000'}); - } + others = $$("div.littlemenu"); + map(lowerButton, others); setStyle(mymenu, {'z-index':'10000'}); } var hideOtherSubmenus = function(menu, submenu) { - submenu = $(submenu); - others = getElementsByTagAndClassName('div', 'submenu', menu.parentNode); - for (i=0;(sub=others[i]);++i) { - if (submenu!=sub) hideSubMenu(sub); - } + var smartHideSub = function(sub){if ($(submenu)!=sub) hideSubMenu(sub)} + map(smartHideSub, $$('div.submenu')); } var smto = Array(); @@ -119,6 +117,10 @@ addElementClass(button, 'menuselected'); }); }); + connect(menu, 'onclick', function() { + hideMenu(menu); + disconnectAll(button, 'onmouseover'); + }); connect(button, 'onmouseout', function() { smto[menu] = setTimeout('hideMenu("'+menu+'");disconnectAll("'+ button+'", "onmouseover");', 500); }); |
From: <sv...@ze...> - 2007-03-30 20:32:36
|
Author: edahl Date: 2007-03-30 16:32:36 -0400 (Fri, 30 Mar 2007) New Revision: 4429 Modified: trunk/Products/ZenModel/PerformanceConf.py trunk/Products/ZenRRD/RenderServer.py Log: * compress gopts in render server urls to get them under 2048 bytes for stupid IE. fixes #1153 Modified: trunk/Products/ZenModel/PerformanceConf.py =================================================================== --- trunk/Products/ZenModel/PerformanceConf.py 2007-03-30 20:14:29 UTC (rev 4428) +++ trunk/Products/ZenModel/PerformanceConf.py 2007-03-30 20:32:36 UTC (rev 4429) @@ -15,6 +15,7 @@ import os import glob +import zlib import transaction import logging log = logging.getLogger("zen.PerformanceConf") @@ -43,8 +44,6 @@ from ZenDate import ZenDate -from Products.PythonScripts.standard import url_quote - PERF_ROOT = os.path.join(os.environ['ZENHOME'], "perf") def performancePath(target): @@ -302,7 +301,7 @@ """set the full path of the target and send to view""" targetpath = performancePath(targetpath[1:]) gopts = view.graphOpts(context, targetpath, targettype) - gopts = url_quote('|'.join(gopts)) + gopts = url_quote(zlib.compress('|'.join(gopts))) url = "%s/render?gopts=%s&drange=%d" % (self.renderurl,gopts,drange) if self.renderurl.startswith("http"): return "/zport/RenderServer/render?remoteUrl=%s&gopts=%s&drange=%d" % (url_quote(url),gopts,drange) Modified: trunk/Products/ZenRRD/RenderServer.py =================================================================== --- trunk/Products/ZenRRD/RenderServer.py 2007-03-30 20:14:29 UTC (rev 4428) +++ trunk/Products/ZenRRD/RenderServer.py 2007-03-30 20:32:36 UTC (rev 4429) @@ -16,6 +16,7 @@ import time import logging import urllib +import zlib from AccessControl import ClassSecurityInfo from Globals import InitializeClass @@ -67,8 +68,10 @@ security.declareProtected('View', 'render') - def render(self, gopts=None, drange=None, remoteUrl=None, ftype='PNG', REQUEST=None): + def render(self, gopts=None, drange=None, remoteUrl=None, + ftype='PNG', REQUEST=None): """render a graph and return it""" + gopts = zlib.decompress(gopts) gopts = gopts.split('|') gopts = [g for g in gopts if g] drange = int(drange) |
From: <sv...@ze...> - 2007-03-30 20:14:33
|
Author: edahl Date: 2007-03-30 16:14:29 -0400 (Fri, 30 Mar 2007) New Revision: 4428 Modified: trunk/Products/DataCollector/plugins/zenoss/cmd/darwin/ Log: * add ignore to new directory Property changes on: trunk/Products/DataCollector/plugins/zenoss/cmd/darwin ___________________________________________________________________ Name: svn:ignore + *.pyc |
From: <sv...@ze...> - 2007-03-30 20:04:58
|
Author: marc Date: 2007-03-30 16:04:58 -0400 (Fri, 30 Mar 2007) New Revision: 4427 Modified: trunk/Products/ZenModel/FileSystem.py trunk/Products/ZenModel/IpInterface.py trunk/Products/ZenModel/IpService.py trunk/Products/ZenModel/OSProcess.py trunk/Products/ZenModel/OperatingSystem.py trunk/Products/ZenModel/WinService.py trunk/Products/ZenModel/migrate/menus.py trunk/Products/ZenModel/skins/zenmodel/dialog_addFileSystem.pt trunk/Products/ZenModel/skins/zenmodel/dialog_addOSProcess.pt trunk/Products/ZenModel/skins/zenmodel/viewFileSystem.pt trunk/Products/ZenModel/skins/zenmodel/viewIpInterface.pt Log: #748 * Added FileSystem, OSProcess, IpInterface, still testing Modified: trunk/Products/ZenModel/FileSystem.py =================================================================== --- trunk/Products/ZenModel/FileSystem.py 2007-03-30 20:03:57 UTC (rev 4426) +++ trunk/Products/ZenModel/FileSystem.py 2007-03-30 20:04:58 UTC (rev 4427) @@ -22,15 +22,14 @@ from OSComponent import OSComponent -def manage_addFileSystem(context, id, REQUEST = None): +def manage_addFileSystem(context, id, userCreated, REQUEST=None): """make a filesystem""" fs = FileSystem(id) context._setObject(id, fs) fs = context._getOb(id) - + if userCreated: fs.setUserCreateFlag() if REQUEST is not None: - REQUEST['RESPONSE'].redirect(context.absolute_url() - +'/manage_main') + REQUEST['RESPONSE'].redirect(context.absolute_url()+'/manage_main') addFileSystem = DTMLFile('dtml/addFileSystem',globals()) Modified: trunk/Products/ZenModel/IpInterface.py =================================================================== --- trunk/Products/ZenModel/IpInterface.py 2007-03-30 20:03:57 UTC (rev 4426) +++ trunk/Products/ZenModel/IpInterface.py 2007-03-30 20:04:58 UTC (rev 4427) @@ -41,7 +41,8 @@ d = IpInterface(id) context._setObject(id, d) d = context._getOb(id) - + setattr(d, 'name', id) + if REQUEST is not None: REQUEST['RESPONSE'].redirect(context.absolute_url() +'/manage_main') Modified: trunk/Products/ZenModel/IpService.py =================================================================== --- trunk/Products/ZenModel/IpService.py 2007-03-30 20:03:57 UTC (rev 4426) +++ trunk/Products/ZenModel/IpService.py 2007-03-30 20:04:58 UTC (rev 4427) @@ -24,15 +24,15 @@ def manage_addIpService(context, id, protocol, port, userCreated=None, REQUEST=None): """make a device""" - d = IpService(id) - context._setObject(id, d) - d = context._getOb(id) - setattr(d, 'name', id) - setattr(d, 'protocol', protocol) - setattr(d, 'port', int(port)) + s = IpService(id) + context._setObject(id, s) + s = context._getOb(id) + setattr(s, 'name', id) + setattr(s, 'protocol', protocol) + setattr(s, 'port', int(port)) args = {'protocol':protocol, 'port':int(port)} - d.setServiceClass(args) - if userCreated: d.setUserCreateFlag() + s.setServiceClass(args) + if userCreated: s.setUserCreateFlag() if REQUEST is not None: REQUEST['RESPONSE'].redirect(context.absolute_url() +'/manage_main') Modified: trunk/Products/ZenModel/OSProcess.py =================================================================== --- trunk/Products/ZenModel/OSProcess.py 2007-03-30 20:03:57 UTC (rev 4426) +++ trunk/Products/ZenModel/OSProcess.py 2007-03-30 20:04:58 UTC (rev 4427) @@ -10,20 +10,28 @@ from Commandable import Commandable from Products.ZenRelations.RelSchema import * from Acquisition import aq_chain +from zExceptions import NotFound from OSComponent import OSComponent from ZenPackable import ZenPackable -def manage_addOSProcess(context, id, className, title = None, REQUEST = None): +def manage_addOSProcess(context, id, className, userCreated, REQUEST = None): """make a device""" - d = OSProcess(id, title) - context._setObject(id, d) - d = context._getOb(id) - d.setOSProcessClass("/Processes" + className) - + context._setObject(id, OSProcess(id)) + osp = context._getOb(id) + if className == '/': className = '' + orgPath = "/Processes%s" % className + classPath = "%s/osProcessClasses/%s" % (orgPath, id) + import pdb; pdb.set_trace() + try: + osp.getDmdObj(classPath) + except KeyError, NotFound: + organizer = osp.getDmdObj(orgPath) + organizer.manage_addOSProcessClass(id) + osp.setOSProcessClass(classPath) + if userCreated: osp.setUserCreateFlag() if REQUEST is not None: - REQUEST['RESPONSE'].redirect(context.absolute_url() - +'/manage_main') + REQUEST['RESPONSE'].redirect(context.absolute_url()+'/manage_main') class OSProcess(OSComponent, Commandable, ZenPackable): """Hardware object""" @@ -86,7 +94,7 @@ return (self.id, self.name(), self.osProcessClass().ignoreParameters, self.alertOnRestart(), self.getFailSeverity(), thresholds) - + def setOSProcessClass(self, procKey): """Set the OSProcessClass based on procKey which is the proc + args. We set by matching regular expressions of each proces class. Modified: trunk/Products/ZenModel/OperatingSystem.py =================================================================== --- trunk/Products/ZenModel/OperatingSystem.py 2007-03-30 20:03:57 UTC (rev 4426) +++ trunk/Products/ZenModel/OperatingSystem.py 2007-03-30 20:04:58 UTC (rev 4427) @@ -116,7 +116,7 @@ """ manage_addIpInterface(self.interfaces, id) if REQUEST is not None: - REQUEST['RESPONSE'].redirect(self._getOb(id).absolute_url()) + REQUEST['RESPONSE'].redirect(self.interfaces._getOb(id).absolute_url()) def addWinService(self, id, @@ -144,7 +144,7 @@ className, userCreated) if REQUEST is not None: - REQUEST['RESPONSE'].redirect(self._getOb(id).absolute_url()) + REQUEST['RESPONSE'].redirect(self.processes._getOb(id).absolute_url()) def addIpService(self, id, @@ -162,12 +162,12 @@ if REQUEST is not None: REQUEST['RESPONSE'].redirect(self.ipservices._getOb(id).absolute_url()) - def addFileSystem(self, id, REQUEST=None): + def addFileSystem(self, id, userCreated, REQUEST=None): """Add an FileSystem. """ - manage_addFileSystem(self.filesystems, id) + manage_addFileSystem(self.filesystems, id, userCreated) if REQUEST is not None: - REQUEST['RESPONSE'].redirect(self._getOb(id).absolute_url()) + REQUEST['RESPONSE'].redirect(self.filesystems._getOb(id).absolute_url()) def addIpRouteEntry(self, dest, Modified: trunk/Products/ZenModel/WinService.py =================================================================== --- trunk/Products/ZenModel/WinService.py 2007-03-30 20:03:57 UTC (rev 4426) +++ trunk/Products/ZenModel/WinService.py 2007-03-30 20:04:58 UTC (rev 4427) @@ -14,14 +14,14 @@ def manage_addWinService(context, id, description, userCreated=None, REQUEST=None): """make a device""" - d = WinService(id) - context._setObject(id, d) - d = context._getOb(id) - setattr(d, 'name', id) - setattr(d, 'description', description) + s = WinService(id) + context._setObject(id, s) + s = context._getOb(id) + setattr(s, 'name', id) + setattr(s, 'description', description) args = {'name':id, 'description':description} - d.setServiceClass(args) - if userCreated: d.setUserCreateFlag() + s.setServiceClass(args) + if userCreated: s.setUserCreateFlag() if REQUEST is not None: REQUEST['RESPONSE'].redirect(context.absolute_url() +'/manage_main') Modified: trunk/Products/ZenModel/migrate/menus.py =================================================================== --- trunk/Products/ZenModel/migrate/menus.py 2007-03-30 20:03:57 UTC (rev 4426) +++ trunk/Products/ZenModel/migrate/menus.py 2007-03-30 20:04:58 UTC (rev 4427) @@ -490,6 +490,24 @@ permissions=('Change Device',), ) ], + 'IpService':[ + dict( + id= 'addIpService', + description='Add IpService...', + action= 'dialog_addIpService', + isdialog = True, + permissions=('Change Device',), + ) + ], + 'WinService':[ + dict( + id= 'addWinService', + description='Add WinService...', + action= 'dialog_addWinService', + isdialog = True, + permissions=('Change Device',), + ) + ], 'Event_list':[ dict( id= 'acknowledgeEvents', Modified: trunk/Products/ZenModel/skins/zenmodel/dialog_addFileSystem.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/dialog_addFileSystem.pt 2007-03-30 20:03:57 UTC (rev 4426) +++ trunk/Products/ZenModel/skins/zenmodel/dialog_addFileSystem.pt 2007-03-30 20:04:58 UTC (rev 4427) @@ -2,9 +2,10 @@ <p> What would you like to name your FileSystem?<br/> </p> +<input type="hidden" name="userCreated" value="True"> <br/> -<p style="text-align:center;"> -<input type="text" name="id"> +<p style="text-align:right;"> +Name: <input name="id"><br/> </p> <div id="dialog_buttons"> <input type="submit" name="addFileSystem:method" Modified: trunk/Products/ZenModel/skins/zenmodel/dialog_addOSProcess.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/dialog_addOSProcess.pt 2007-03-30 20:03:57 UTC (rev 4426) +++ trunk/Products/ZenModel/skins/zenmodel/dialog_addOSProcess.pt 2007-03-30 20:04:58 UTC (rev 4427) @@ -4,14 +4,14 @@ </p> <input type="hidden" name="userCreated" value="True"> <br/> -<p style="text-align:center;"> -Name:<input type="text" name="id"><br/> -Process Class:<select name="className" +<p style="text-align:right;"> +Name: <input type="text" name="id"><br/><br/> +Process Class: <select name="className" tal:define="targets python:here.getDmdRoot('Processes').getOrganizerNames()"> - <option value=""></option> - <option tal:repeat="target targets" + <option tal:repeat="target targets" + tal:attributes="value target" tal:content="target">/</option> -</select> +</select><br/> </p> <div id="dialog_buttons"> <input type="submit" name="addOSProcess:method" Modified: trunk/Products/ZenModel/skins/zenmodel/viewFileSystem.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/viewFileSystem.pt 2007-03-30 20:03:57 UTC (rev 4426) +++ trunk/Products/ZenModel/skins/zenmodel/viewFileSystem.pt 2007-03-30 20:04:58 UTC (rev 4427) @@ -17,8 +17,15 @@ <tal:block metal:fill-slot="zentablecontents"> <tr> - <td class=tableheader align=left>Mount Point</td> - <td class=tablevalues tal:content="here/mount">/usr</td> + <td class="tableheader" align=left>Mount Point</td> + <td class="tablevalues" tal:condition="not:here/isManager" + tal:content="here/mount">/usr</td> + <td class="tablevalues" tal:condition="here/isManager"> + <input tal:condition="here/isManager" + tal:attributes="class string:tablevalues; + name string:mount; + value here/mount"> + </td> <td class="tableheader">Monitor</td> <td class="tablevalues" tal:condition="here/isManager"> <select class="tablevalues" name="monitor:boolean" @@ -33,54 +40,133 @@ tal:content="here/monitored"/> </tr> <tr> - <td class=tableheader align=left>Storage Device</td> - <td class=tablevalues tal:content="here/storageDevice">1</td> - <td class=tableheader align=left>Type</td> - <td class=tablevalues tal:content="here/type">/usr</td> + <td class="tableheader" align=left>Storage Device</td> + <td class="tablevalues" tal:condition="not:here/isManager" + tal:content="here/storageDevice">1</td> + <td class="tablevalues" tal:condition="here/isManager"> + <input tal:condition="here/isManager" + 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" + tal:content="here/type">/usr</td> + <td class="tablevalues" tal:condition="here/isManager"> + <input tal:condition="here/isManager" + tal:attributes="class string:tablevalues; + name string:type; + value here/type"> + </td> </tr> <tr> - <td class=tableheader align=left>Block Size</td> - <td class=tablevalues tal:content="here/blockSize">1</td> - <td class=tableheader align=left>Total Bytes</td> - <td class=tablevalues tal:content="here/totalBytesString">/usr</td> + <td class="tableheader" align=left>Block Size</td> + <td class="tablevalues" tal:condition="not:here/isManager" + tal:content="here/blockSize">1</td> + <td class="tablevalues" tal:condition="here/isManager"> + <input tal:condition="here/isManager" + 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" + tal:content="here/totalBytesString">/usr</td> + <td class="tablevalues" tal:condition="here/isManager"> + <input tal:condition="here/isManager" + tal:attributes="class string:tablevalues; + name string:totalBytesString; + value here/totalBytesString"> + </td> </tr> <tr> - <td class=tableheader align=left>Used Bytes</td> - <td class=tablevalues tal:content="here/usedBytesString">1</td> - <td class=tableheader align=left>Available Bytes</td> - <td class=tablevalues colspan="3" tal:content="here/availBytesString"/> + <td class="tableheader" align=left>Used Bytes</td> + <td class="tablevalues" tal:condition="not:here/isManager" + tal:content="here/usedBytesString">1</td> + <td class="tablevalues" tal:condition="here/isManager"> + <input tal:condition="here/isManager" + 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" + tal:content="here/availBytesString"/> + <td class="tablevalues" tal:condition="here/isManager"> + <input tal:condition="here/isManager" + tal:attributes="class string:tablevalues; + name string:availBytesString; + value here/availBytesString"> + </td> </tr> <tr> - <td class=tableheader align=left>Total Files</td> - <td class=tablevalues tal:content="here/totalFiles">1</td> - <td class=tableheader align=left>Available Files</td> - <td class=tablevalues tal:content="here/availFiles">1</td> + <td class="tableheader" align=left>Total Files</td> + <td class="tablevalues" tal:condition="not:here/isManager" + tal:content="here/totalFiles">1</td> + <td class="tablevalues" tal:condition="here/isManager"> + <input tal:condition="here/isManager" + 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" + tal:content="here/availFiles">1</td> + <td class="tablevalues" tal:condition="here/isManager"> + <input tal:condition="here/isManager" + tal:attributes="class string:tablevalues; + name string:availFiles; + value here/availFiles"> + </td> </tr> <tr> - <td class=tableheader align=left>Capacity Bytes</td> - <td class=tablevalues tal:content="string:${here/capacity}%">1</td> - <td class=tableheader align=left>Capacity Files</td> - <td class=tablevalues tal:content="string:${here/inodeCapacity}%">1</td> + <td class="tableheader" align=left>Capacity Bytes</td> + <td class="tablevalues" tal:condition="not:here/isManager" + tal:content="string:${here/capacity}%">1</td> + <td class="tablevalues" tal:condition="here/isManager"> + <input tal:condition="here/isManager" + 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" + tal:content="string:${here/inodeCapacity}%">1</td> + <td class="tablevalues" tal:condition="here/isManager"> + <input tal:condition="here/isManager" + tal:attributes="class string:tablevalues; + name string:inodeCapacity; + value here/inodeCapacity"> + </td> </tr> <tr> - <td class=tableheader align=left>Max Name Length</td> - <td class=tablevalues tal:content="here/maxNameLen">1</td> - <td class=tableheader align=left>Snmp Index</td> - <td class=tablevalues tal:content="here/snmpindex">1</td> - </tr> - <tr> - <td class=tableheader align=left>Delete lock</td> - <td class=tablevalues> - <img tal:condition="here/isLockedFromDeletion" border="0" src="emblem-readonly.png"> + <td class="tableheader" align=left>Max Name Length</td> + <td class="tablevalues" tal:condition="not:here/isManager" + tal:content="here/maxNameLen">1</td> + <td class="tablevalues" tal:condition="here/isManager"> + <input tal:condition="here/isManager" + tal:attributes="class string:tablevalues; + name string:maxNameLen; + value here/maxNameLen"> </td> - <td class=tableheader align=left>Update lock</td> - <td class=tablevalues> - <img tal:condition="here/isLockedFromUpdates" border="0" src="emblem-readonly.png"> + <td class="tableheader" align=left>Snmp Index</td> + <td class="tablevalues" tal:condition="not:here/isManager" + tal:content="here/snmpindex">1</td> + <td class="tablevalues" tal:condition="here/isManager"> + <input tal:condition="here/isManager" + tal:attributes="class string:tablevalues; + name string:snmpindex; + value here/snmpindex"> </td> </tr> <tr> - <td class=tableheader align=left>Lock warnings</td> - <td class=tablevalues colspan=3 tal:content="here/lockWarning"> + <td class="tableheader" align=left>Locks</td> + <td class="tablevalues"> + <img tal:condition="here/isLockedFromDeletion" border="0" src="locked-delete-icon.png"> + <img tal:condition="here/isLockedFromUpdates" border="0" src="locked-update-icon.png"> + </td> + <td class="tableheader" align=left>Lock warnings</td> + <td class="tablevalues" tal:content="here/lockWarning"> Send event when blocked </td> </tr> Modified: trunk/Products/ZenModel/skins/zenmodel/viewIpInterface.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/viewIpInterface.pt 2007-03-30 20:03:57 UTC (rev 4426) +++ trunk/Products/ZenModel/skins/zenmodel/viewIpInterface.pt 2007-03-30 20:04:58 UTC (rev 4427) @@ -17,44 +17,30 @@ <!-- BEGIN TABLE CONTENTS --> <tr> - <td class=tableheader align=left>Name</td> - <td class=tablevalues tal:condition="not:here/isManager" + <td class="tableheader" align=left>Name</td> + <td class="tablevalues" tal:condition="not:here/isManager" tal:content="here/name">eth0</td> - <td class=tablevalues tal:condition="here/isManager"> + <td class="tablevalues" tal:condition="here/isManager"> <input tal:attributes="class string:tablevalues; - type string:text; - size string:50; name string:name; value here/name"> </td> - <td class=tableheader align=left>MAC Address</td> - <td class=tablevalues tal:condition="not:here/isManager" + <td class="tableheader" align=left>MAC Address</td> + <td class="tablevalues" tal:condition="not:here/isManager" tal:content="here/macaddress">00:11:22:AA:BB:CC</td> - <td class=tablevalues tal:condition="here/isManager"> + <td class="tablevalues" tal:condition="here/isManager"> <input tal:attributes="class string:tablevalues; - type string:text; - size string:50; name string:macaddress; value here/macaddress"> </td> </tr> <tr> - <td class="tableheader">Monitor</td> - <td class="tablevalues" tal:condition="here/isManager"> - <select class="tablevalues" name="monitor:boolean" - tal:condition="here/isManager"> - <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:content="here/monitored"/> - </td> <td class="tablevalues" tal:condition="not:here/isManager" tal:content="here/monitored"/> - <td class=tableheader align=left>IP Addresses</td> - <td class=tablevalues> + <td class="tableheader" align=left>IP Addresses</td> + <td class="tablevalues" colspan="3" tal:condition="not:here/isManager"> <span tal:repeat="ip here/getIpAddressObjs" omit-tag=""> - <a class=tablevalues + <a class="tablevalues" tal:condition="python:hasattr(ip,'getIpAddress')" tal:content="ip/getIpAddress" tal:attributes="href ip/getPrimaryUrlPath"> @@ -63,9 +49,17 @@ 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" + name="ips:lines" + tal:attributes="class string:tablevalues; + cols string:40; + rows string:5;" + tal:content="python: '\n'.join(here.ips)"/> + </td> </tr> <tr> - <td class=tableheader align=left>Operational Status</td> + <td class="tableheader" align=left>Operational Status</td> <td class="tablevalues" tal:condition="not:here/isManager" tal:content="python:here.operStatus==1 and 'Up' or 'Down'"> Up @@ -77,7 +71,7 @@ tal:attributes="value e; selected python:e==here.operStatus"/> </select> </td> - <td class=tableheader align=left>Administrative Status</td> + <td class="tableheader" align=left>Administrative Status</td> <td class="tablevalues" tal:condition="not:here/isManager" tal:content="python:here.adminStatus==1 and 'Up' or 'Down'"> Up @@ -91,69 +85,69 @@ </td> </tr> <tr> - <td class=tableheader align=left>Type</td> - <td class=tablevalues tal:condition="not:here/isManager" + <td class="tableheader" align=left>Type</td> + <td class="tablevalues" tal:condition="not:here/isManager" tal:content="here/type">Ethernet</td> - <td class=tablevalues tal:condition="here/isManager"> + <td class="tablevalues" tal:condition="here/isManager"> <input tal:attributes="class string:tablevalues; - type string:text; - size string:50; name string:type; value here/type"> </td> - <td class=tableheader align=left>Speed</td> - <td class=tablevalues tal:condition="not:here/isManager" + <td class="tableheader" align=left>Speed</td> + <td class="tablevalues" tal:condition="not:here/isManager" tal:content="here/speed">100000000</td> - <td class=tablevalues tal:condition="here/isManager"> + <td class="tablevalues" tal:condition="here/isManager"> <input tal:attributes="class string:tablevalues; - type string:text; - size string:50; name string:speed; value here/speed"> </td> </tr> <tr> - <td class=tableheader align=left>MTU</td> - <td class=tablevalues tal:condition="not:here/isManager" + <td class="tableheader" align=left>MTU</td> + <td class="tablevalues" tal:condition="not:here/isManager" tal:content="here/mtu">1500</td> - <td class=tablevalues tal:condition="here/isManager"> + <td class="tablevalues" tal:condition="here/isManager"> <input tal:attributes="class string:tablevalues; - type string:text; - size string:50; 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="tableheader" align=left>SNMP Index</td> + <td class="tablevalues" tal:condition="not:here/isManager" tal:content="here/ifindex">100000000</td> - <td class=tablevalues tal:condition="here/isManager"> + <td class="tablevalues" tal:condition="here/isManager"> <input tal:attributes="class string:tablevalues; - type string:text; - size string:50; name string:ifindex; value here/ifindex"> </td> </tr> <tr> - <td class=tableheader align=left>Description</td> - <td class=tablevalues colspan=3 tal:condition="not:here/isManager" + <td class="tableheader" align=left>Description</td> + <td class="tablevalues" tal:condition="not:here/isManager" tal:content="here/description">A nice interface</td> - <td class=tablevalues colspan=3 tal:condition="here/isManager"> + <td class="tablevalues" tal:condition="here/isManager"> <input tal:attributes="class string:tablevalues; - type string:text; - size string:50; name string:description; value here/description"> </td> + <td class="tableheader">Monitor</td> + <td class="tablevalues" tal:condition="here/isManager"> + <select class="tablevalues" name="monitor:boolean" + tal:condition="here/isManager"> + <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:content="here/monitored"/> + </td> </tr> <tr> - <td class=tableheader align=left>Locks</td> - <td class=tablevalues> + <td class="tableheader" align=left>Locks</td> + <td class="tablevalues"> <img tal:condition="here/isLockedFromDeletion" border="0" src="locked-delete-icon.png"> <img tal:condition="here/isLockedFromUpdates" border="0" src="locked-update-icon.png"> </td> - <td class=tableheader align=left>Lock warnings</td> - <td class=tablevalues tal:content="here/lockWarning">Send event when blocked</td> + <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"> <td align="left" class="tableheader" colspan="4"> |
From: <sv...@ze...> - 2007-03-30 20:03:58
|
Author: ian Date: 2007-03-30 16:03:57 -0400 (Fri, 30 Mar 2007) New Revision: 4426 Modified: trunk/Products/ZenModel/skins/zenmodel/templates.pt Log: * Set the thumbtack image to fail to display on initial page load Modified: trunk/Products/ZenModel/skins/zenmodel/templates.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/templates.pt 2007-03-30 18:56:36 UTC (rev 4425) +++ trunk/Products/ZenModel/skins/zenmodel/templates.pt 2007-03-30 20:03:57 UTC (rev 4426) @@ -34,6 +34,7 @@ #leftPane { display:none;} #rightPane { margin-left:12px;} #paneToggle { + display:none; background-image: url('img/paneToggle_bg_collapsed.gif'); border-right: medium none; } |
From: <sv...@ze...> - 2007-03-30 19:00:09
|
Author: marc Date: 2007-03-30 14:56:36 -0400 (Fri, 30 Mar 2007) New Revision: 4425 Modified: trunk/Products/ZenEvents/EventManagerBase.py Log: "finally" masks exceptions due to db connection issues. moved connect outside the "try, finally" block Modified: trunk/Products/ZenEvents/EventManagerBase.py =================================================================== --- trunk/Products/ZenEvents/EventManagerBase.py 2007-03-30 18:48:24 UTC (rev 4424) +++ trunk/Products/ZenEvents/EventManagerBase.py 2007-03-30 18:56:36 UTC (rev 4425) @@ -297,8 +297,8 @@ #print select retdata = self.checkCache(select) if not retdata: + conn = self.connect() try: - conn = self.connect() curs = conn.cursor() curs.execute(select) retdata = [] @@ -362,8 +362,8 @@ selectevent += " from %s where" % self.statusTable selectevent += " %s = '%s'" % (idfield, evid) if self.backend=="omnibus": selectevent += ";" + conn = self.connect() try: - conn = self.connect() curs = conn.cursor() #print selectevent curs.execute(selectevent) @@ -429,8 +429,8 @@ select = "select count(*) from %s where %s" % (self.statusTable, where) statusCount = self.checkCache(select) if not statusCount: + conn = self.connect() try: - conn = self.connect() curs = conn.cursor() #print select curs.execute(select) @@ -454,8 +454,8 @@ #print select statusCache = self.checkCache(select) if not statusCache: + conn = self.connect() try: - conn = self.connect() curs = conn.cursor() curs.execute(select) statusCache=[] @@ -489,8 +489,8 @@ select += where statusCache = self.checkCache(select) if not statusCache: + conn = self.connect() try: - conn = self.connect() curs = conn.cursor() curs.execute(select) statusCache=[] @@ -551,8 +551,8 @@ statusCache = self.checkCache(select) if not statusCache: try: + conn = self.connect() try: - conn = self.connect() curs = conn.cursor() curs.execute(select) statusCache = [ [d,int(c),int(s)] for d,c,s in curs.fetchall() ] @@ -583,8 +583,8 @@ statusCache = self.checkCache(select) if not statusCache: try: + conn = self.connect() try: - conn = self.connect() curs = conn.cursor() curs.execute(select) statusCache = {} @@ -636,8 +636,8 @@ cleanup = lambda : None if not statusCache: statusCache = [] + conn = self.connect() try: - conn = self.connect() curs = conn.cursor() curs.execute(sel) res = list(curs.fetchall()) @@ -672,8 +672,8 @@ select += where statusCache = self.checkCache(select) if not statusCache: + conn = self.connect() try: - conn = self.connect() curs = conn.cursor() curs.execute(select) statusCache ={} @@ -709,8 +709,8 @@ #print select statusCache = self.checkCache(select) if statusCache: return statusCache + conn = self.connect() try: - conn = self.connect() curs = conn.cursor() curs.execute(select) statusCache = [ uid[0] for uid in curs.fetchall() if uid[0] ] @@ -1028,8 +1028,8 @@ schema = {} fieldlist = [] sql = "describe %s;" % self.statusTable + conn = self.connect() try: - conn = self.connect() curs = conn.cursor() curs.execute(sql) for row in curs.fetchall(): @@ -1059,8 +1059,8 @@ 'SELECT evid, "%s", "%s" ' % (userId, reason) + \ 'FROM %s ' % table + whereClause query = stmt + ' ' + whereClause + conn = self.connect() try: - conn = self.connect() curs = conn.cursor() if toLog: curs.execute(insert) curs.execute(query) @@ -1134,8 +1134,8 @@ def manage_deleteHeartbeat(self, devname, REQUEST=None): if devname: delete = "delete from heartbeat where device = '%s'" % devname + conn = self.connect() try: - conn = self.connect() curs = conn.cursor() curs.execute(delete); finally: self.close(conn) @@ -1181,8 +1181,8 @@ sel = """select eventClassKey, eventClass, message from %s where evid in ('%s')""" sel = sel % (self.statusTable, "','".join(evids)) + conn = self.connect() try: - conn = self.connect() curs = conn.cursor() curs.execute(sel); for row in curs.fetchall(): @@ -1245,8 +1245,8 @@ security.declareProtected('Manage EventManager','manage_clearHeartbeats') def manage_clearHeartbeats(self, REQUEST=None): """truncate heartbeat table""" + conn = self.connect() try: - conn = self.connect() curs = conn.cursor() sql = 'truncate table heartbeat' curs.execute(sql) @@ -1271,8 +1271,8 @@ if not evid: return userId = getSecurityManager().getUser().getId() + conn = self.connect() try: - conn = self.connect() curs = conn.cursor() insert = 'INSERT INTO log (evid, userName, text) ' insert += 'VALUES ("%s", "%s", "%s")' % (evid, |
From: <sv...@ze...> - 2007-03-30 18:48:24
|
Author: ian Date: 2007-03-30 14:48:24 -0400 (Fri, 30 Mar 2007) New Revision: 4424 Modified: trunk/Products/ZenWidgets/skins/zenui/javascript/menus.js Log: * Final menu javascript bugs. Now adjusts regular menu position to account for short viewport size. Modified: trunk/Products/ZenWidgets/skins/zenui/javascript/menus.js =================================================================== --- trunk/Products/ZenWidgets/skins/zenui/javascript/menus.js 2007-03-30 18:30:07 UTC (rev 4423) +++ trunk/Products/ZenWidgets/skins/zenui/javascript/menus.js 2007-03-30 18:48:24 UTC (rev 4424) @@ -26,8 +26,14 @@ totalX = pPos.x + mDims.w; finalDims.x = totalX>=vDims.w?pDims.w-mDims.w:finalDims.x; finalDims.x = $(menu).className=='devmovemenuitems'?-mDims.w:finalDims.x; - totalY = pPos.y + mDims.h; - finalDims.y = totalY>=vDims.h?24:finalDims.y; + totalY = pPos.y + pDims.h + mDims.h; + var topmenu = getElementsByTagAndClassName('div', 'menu_top', menu)[0]; + if (totalY>=vDims.h) { + finalDims.y = 0-(totalY-vDims.h); + setStyle(topmenu, {'background-image':'url(img/menu_top_rounded.gif)'}); + } else { + setStyle(topmenu, {'background-image':'url(img/menu_top.gif)'}); + } return finalDims } |
From: <sv...@ze...> - 2007-03-30 18:30:09
|
Author: ian Date: 2007-03-30 14:30:07 -0400 (Fri, 30 Mar 2007) New Revision: 4423 Modified: trunk/Products/ZenModel/migrate/menus.py trunk/Products/ZenWidgets/skins/zenui/zenuimacros.pt Log: * Add context to the menu template so that menus are properly acquired * Fix a class name in the menus migrate script Modified: trunk/Products/ZenModel/migrate/menus.py =================================================================== --- trunk/Products/ZenModel/migrate/menus.py 2007-03-30 18:28:39 UTC (rev 4422) +++ trunk/Products/ZenModel/migrate/menus.py 2007-03-30 18:30:07 UTC (rev 4423) @@ -111,7 +111,7 @@ 'isdialog': True, 'permissions': ('Change Device',)}, {'action': 'editStatusMonitorConf', - 'allowed_classes': ['StatusMonitors'], + 'allowed_classes': ['StatusMonitorConf'], 'description': 'Edit', 'id': 'editStatusMonitorConf', 'permissions': ('Manage DMD',)}, Modified: trunk/Products/ZenWidgets/skins/zenui/zenuimacros.pt =================================================================== --- trunk/Products/ZenWidgets/skins/zenui/zenuimacros.pt 2007-03-30 18:28:39 UTC (rev 4422) +++ trunk/Products/ZenWidgets/skins/zenui/zenuimacros.pt 2007-03-30 18:30:07 UTC (rev 4423) @@ -5,7 +5,7 @@ <div class="menu" tal:define=" menu_ids menu_ids | python:['Edit','Actions']; basepath here/absolute_url_path" - tal:condition="python:here.getMenus(menu_ids)"> + tal:condition="python:here.getMenus(menu_ids, here)"> <div tal:attributes="id string:contextmenu_btn"> <a class="tabletitle"> </a> </div> |
From: <sv...@ze...> - 2007-03-30 18:28:37
|
Author: edahl Date: 2007-03-30 14:28:39 -0400 (Fri, 30 Mar 2007) New Revision: 4422 Modified: trunk/Products/ZenModel/RRDGraph.py Log: * add thresholds to graphs for custom graphs Modified: trunk/Products/ZenModel/RRDGraph.py =================================================================== --- trunk/Products/ZenModel/RRDGraph.py 2007-03-30 18:27:54 UTC (rev 4421) +++ trunk/Products/ZenModel/RRDGraph.py 2007-03-30 18:28:39 UTC (rev 4422) @@ -121,7 +121,7 @@ if self.hasSummary: gopts = self.addSummary(gopts) else: gopts = self.buildDS(gopts, rrdfile, template, self.summary) - gopts = self.thresholds(gopts, context, template) + gopts = self.thresholds(gopts, context, template) return gopts |
From: <sv...@ze...> - 2007-03-30 18:27:53
|
Author: edahl Date: 2007-03-30 14:27:54 -0400 (Fri, 30 Mar 2007) New Revision: 4421 Modified: trunk/Products/ZenModel/ZDeviceLoader.py Log: * handle calls from an xml-rpc client making a new device. Old method returned the html form the log information Modified: trunk/Products/ZenModel/ZDeviceLoader.py =================================================================== --- trunk/Products/ZenModel/ZDeviceLoader.py 2007-03-30 18:27:03 UTC (rev 4420) +++ trunk/Products/ZenModel/ZDeviceLoader.py 2007-03-30 18:27:54 UTC (rev 4421) @@ -24,6 +24,7 @@ from Products.ZenUtils.Utils import setWebLoggingStream, clearWebLoggingStream from Products.ZenUtils.Exceptions import ZentinelException +from Products.ZenModel.Exceptions import DeviceExistsError, NoSnmp from ZenModelItem import ZenModelItem from Device import manage_createDevice @@ -83,6 +84,9 @@ Load a device into the database connecting its major relations and collecting its configuration. """ + xmlrpc = False + if REQUEST and REQUEST['CONTENT_TYPE'].find('xml') > -1: + xmlrpc = True if zSnmpVer is None: try: zSnmpVer = str(self.Devices.getOrganizer(devicePath).zSnmpVer) @@ -90,7 +94,7 @@ zSnmpVer = 'v1' if not deviceName: return self.callZenScreen(REQUEST) device = None - if REQUEST: + if REQUEST and not xmlrpc: response = REQUEST.RESPONSE dlh = self.deviceLoggingHeader() idx = dlh.rindex("</table>") @@ -107,7 +111,12 @@ statusMonitors, performanceMonitor, discoverProto) transaction.commit() except (SystemExit, KeyboardInterrupt): raise + except DeviceExistsError: + if xmlrpc: return 2 + except NoSnmp: + if xmlrpc: return 3 except ZentinelException, e: + if xmlrpc: return 1 log.critical(e) except: log.exception('load of device %s failed' % deviceName) @@ -116,9 +125,10 @@ if discoverProto != "none": device.collectDevice(setlog=False, REQUEST=REQUEST) log.info("device %s loaded!" % deviceName) - if REQUEST: + if REQUEST and not xmlrpc: self.loaderFooter(device, response) clearWebLoggingStream(handler) + if xmlrpc: return 0 def addManufacturer(self, newHWManufacturerName=None, |