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-03-07 18:10:42
|
Author: ecn Date: 2007-03-07 12:10:36 -0600 (Wed, 07 Mar 2007) New Revision: 4220 Modified: trunk/Products/ZenModel/Device.py trunk/Products/ZenModel/PerformanceConf.py Log: * cleanup: ignore devices that don't have snmp monitoring Modified: trunk/Products/ZenModel/Device.py =================================================================== --- trunk/Products/ZenModel/Device.py 2007-03-07 17:50:50 UTC (rev 4219) +++ trunk/Products/ZenModel/Device.py 2007-03-07 18:10:36 UTC (rev 4220) @@ -876,6 +876,13 @@ return self.productionState >= self.zProdStateThreshold + def snmpMonitorDevice(self): + "Is this device subject to SNMP monitoring?" + return (self.monitorDevice() + and not self.zSnmpMonitorIgnore + and self.zSnmpCommunity) + + def getProductionStateString(self): """Return the prodstate as a string. """ Modified: trunk/Products/ZenModel/PerformanceConf.py =================================================================== --- trunk/Products/ZenModel/PerformanceConf.py 2007-03-07 17:50:50 UTC (rev 4219) +++ trunk/Products/ZenModel/PerformanceConf.py 2007-03-07 18:10:36 UTC (rev 4220) @@ -137,8 +137,7 @@ for dev in self.devices(): if devices and dev.id not in devices: continue dev = dev.primaryAq() - if (dev.monitorDevice() and not dev.zSnmpMonitorIgnore \ - and dev.zSnmpCommunity): + if dev.snmpMonitorDevice(): try: result.append(dev.getSnmpOidTargets()) except POSError: raise @@ -156,8 +155,7 @@ all = Set() for dev in self.devices(): dev = dev.primaryAq() - if (dev.monitorDevice() and not dev.zSnmpMonitorIgnore \ - and dev.zSnmpCommunity): + if dev.snmpMonitorDevice(): all.add(dev.id) if lastChanged.get(dev.id, 0) < float(dev.getLastChange()): print dev.id @@ -227,7 +225,7 @@ for dev in self.devices(): if devname and dev.id != devname: continue dev = dev.primaryAq() - if dev.monitorDevice(): + if dev.snmpMonitorDevice(): try: procinfo = dev.getOSProcessConf() if procinfo is None: continue |
From: <sv...@ze...> - 2007-03-07 17:50:53
|
Author: ecn Date: 2007-03-07 11:50:50 -0600 (Wed, 07 Mar 2007) New Revision: 4219 Modified: trunk/Products/ZenModel/PerformanceConf.py Log: * ignore devices that don't have snmp monitoring Modified: trunk/Products/ZenModel/PerformanceConf.py =================================================================== --- trunk/Products/ZenModel/PerformanceConf.py 2007-03-07 16:08:13 UTC (rev 4218) +++ trunk/Products/ZenModel/PerformanceConf.py 2007-03-07 17:50:50 UTC (rev 4219) @@ -137,7 +137,8 @@ for dev in self.devices(): if devices and dev.id not in devices: continue dev = dev.primaryAq() - if dev.monitorDevice(): + if (dev.monitorDevice() and not dev.zSnmpMonitorIgnore \ + and dev.zSnmpCommunity): try: result.append(dev.getSnmpOidTargets()) except POSError: raise @@ -151,13 +152,12 @@ The result is a list of devices that have changed, or not in the list.""" lastChanged = dict(devices) - import pprint - pprint.pprint(lastChanged) new = Set() all = Set() for dev in self.devices(): dev = dev.primaryAq() - if dev.monitorDevice(): + if (dev.monitorDevice() and not dev.zSnmpMonitorIgnore \ + and dev.zSnmpCommunity): all.add(dev.id) if lastChanged.get(dev.id, 0) < float(dev.getLastChange()): print dev.id |
From: <sv...@ze...> - 2007-03-07 16:08:47
|
Author: ecn Date: 2007-03-07 10:08:13 -0600 (Wed, 07 Mar 2007) New Revision: 4218 Modified: trunk/Products/ZenRRD/SnmpDaemon.py trunk/Products/ZenRRD/zenperfsnmp.py trunk/Products/ZenRRD/zenprocess.py Log: * use warnings module until logging is configured * use proper deletion semantics Modified: trunk/Products/ZenRRD/SnmpDaemon.py =================================================================== --- trunk/Products/ZenRRD/SnmpDaemon.py 2007-03-07 14:24:42 UTC (rev 4217) +++ trunk/Products/ZenRRD/SnmpDaemon.py 2007-03-07 16:08:13 UTC (rev 4218) @@ -19,6 +19,8 @@ try: from pynetsnmp.twistedsnmp import snmpprotocol except: + import warnings + warnings.warn("Using python-based snmp enging") from twistedsnmp import snmpprotocol Modified: trunk/Products/ZenRRD/zenperfsnmp.py =================================================================== --- trunk/Products/ZenRRD/zenperfsnmp.py 2007-03-07 14:24:42 UTC (rev 4217) +++ trunk/Products/ZenRRD/zenperfsnmp.py 2007-03-07 16:08:13 UTC (rev 4218) @@ -25,9 +25,9 @@ from twisted.internet import reactor, defer try: from pynetsnmp.twistedsnmp import AgentProxy - log.info("Using net-snmp snmp engine") except ImportError: - log.warning("Using python-based snmp enging") + import warnings + warnings.warn("Using python-based snmp enging") from twistedsnmp.agentproxy import AgentProxy if not hasattr(AgentProxy, 'open'): def ignore(self): pass @@ -57,6 +57,27 @@ if not os.path.exists(dir): os.makedirs(dir) +def read(fname): + if os.path.exists(fname): + fp = file(fname, 'rb') + try: + return fp.read() + finally: + fp.close() + return '' + +def write(fname, data): + makeDirs(os.path.basename(fname)) + fp = open(fname, 'wb') + try: + fp.write(data) + finally: + fp.close() + +def unlink(fname): + if os.path.exists(fname): + os.unlink(fname) + def chunk(lst, n): 'break lst into n-sized chunks' return [lst[i:i+n] for i in range(0, len(lst), n)] @@ -225,21 +246,13 @@ makeDirs(base) root, ds, fs = os.walk(base).next() for d in ds: - configFile = pickleName(d) - if os.path.exists(configFile): - fp = file(configFile, 'rb') - try: - self.updateDeviceConfig(cPickle.load(fp)) - finally: - fp.close() + config = read(pickleName(d)) + if config: + self.updateDeviceConfig(cPickle.loads(config)) - def cleanup(self, fullPath): self.log.warning("Deleting old RRD file: %s", fullPath) - try: - os.unlink(fullPath) - except OSError: - self.log.error("Unable to delete old RRD file: %s", fullPath) + os.unlink(fullPath) def maybeQuit(self): "Stop if all performance has been fetched, and we aren't cycling" @@ -265,7 +278,7 @@ log.info("fetching configs for %r", devices) yield self.model.callRemote('getDevices', devices) - self.updateDeviceList(driver.next()) + self.updateDeviceList(devices, driver.next()) log.info("fetching snmp status") yield self.model.callRemote('getSnmpStatus', self.options.device) @@ -282,29 +295,25 @@ self.rrd = RRDUtil(createCommand, self.snmpCycleInterval) - def updateDeviceList(self, deviceList): + def updateDeviceList(self, requested, responses): 'Update the config for devices devices' if self.options.device: self.log.debug('Gathering performance data for %s ' % self.options.device) - if not deviceList: - self.log.warn("no devices found, keeping existing list") - return - deviceNames = Set() - for snmpTargets in deviceList: + for snmpTargets in responses: self.updateDeviceConfig(snmpTargets) deviceNames.add(snmpTargets[1][0]) # stop collecting those no longer in the list - doomed = Set(self.proxies.keys()) - deviceNames + doomed = Set(requested) - deviceNames for name in doomed: - self.log.debug('removing device %s' % name) - del self.proxies[name] + self.log.info('removing device %s' % name) + if name in self.proxies: + del self.proxies[name] config = pickleName(name) - if os.path.exists(config): - os.unlink(config) + unlink(config) # we could delete the RRD files, too ips = Set() @@ -368,13 +377,7 @@ version, timeout, tries, maxOIDs) if p.lastChange < last: p.lastChange = last - try: - makeDirs(performancePath('Devices/%s' % deviceName)) - fp = open(pickleName(deviceName), 'wb') - cPickle.dump(snmpTargets, fp) - fp.close() - except IOError, ex: - log.exception("Unable to save local config for %s" % deviceName) + write(pickleName(deviceName), cPickle.dumps(snmpTargets)) for name, oid, path, dsType, createCmd, minmax, thresholds in oidData: createCmd = createCmd.strip() Modified: trunk/Products/ZenRRD/zenprocess.py =================================================================== --- trunk/Products/ZenRRD/zenprocess.py 2007-03-07 14:24:42 UTC (rev 4217) +++ trunk/Products/ZenRRD/zenprocess.py 2007-03-07 16:08:13 UTC (rev 4218) @@ -25,9 +25,9 @@ try: from pynetsnmp.twistedsnmp import AgentProxy from pynetsnmp.tableretriever import TableRetriever - log.info("Using net-snmp snmp engine") except ImportError: - log.warning("Using twistedsnmp engine") + import warning + warning.warn("Using python-based snmp enging") from twistedsnmp.agentproxy import AgentProxy from twistedsnmp.tableretriever import TableRetriever |
From: <sv...@ze...> - 2007-03-07 14:24:45
|
Author: ian Date: 2007-03-07 08:24:42 -0600 (Wed, 07 Mar 2007) New Revision: 4217 Modified: trunk/Products/ZenModel/skins/zenmodel/zenoss.css Log: * Removing old @import statements Modified: trunk/Products/ZenModel/skins/zenmodel/zenoss.css =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/zenoss.css 2007-03-07 13:17:08 UTC (rev 4216) +++ trunk/Products/ZenModel/skins/zenmodel/zenoss.css 2007-03-07 14:24:42 UTC (rev 4217) @@ -708,7 +708,3 @@ background: transparent url('img/paneToggle_bg.gif') top left no-repeat; } -@import url('filterbox.css'); -@import url('menus.css'); - - |
From: <sv...@ze...> - 2007-03-07 13:17:12
|
Author: ian Date: 2007-03-07 07:17:08 -0600 (Wed, 07 Mar 2007) New Revision: 4216 Modified: trunk/Products/ZenModel/skins/zenmodel/Dashboard.pt trunk/Products/ZenModel/skins/zenmodel/deviceManagement.pt trunk/Products/ZenModel/skins/zenmodel/deviceOrganizerManage.pt trunk/Products/ZenModel/skins/zenmodel/editCustSchema.pt trunk/Products/ZenModel/skins/zenmodel/maintenanceWindowsMacro.pt trunk/Products/ZenModel/skins/zenmodel/perfConfig.pt trunk/Products/ZenModel/skins/zenmodel/serviceOrganizerManage.pt trunk/Products/ZenModel/skins/zenmodel/serviceOrganizerOverview.pt trunk/Products/ZenModel/skins/zenmodel/userCommandsMacros.pt trunk/Products/ZenModel/skins/zenmodel/viewHistory.pt trunk/Products/ZenModel/skins/zenmodel/zPropertyEdit.pt Log: * Several template updates to use the new table headers Modified: trunk/Products/ZenModel/skins/zenmodel/Dashboard.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/Dashboard.pt 2007-03-06 22:47:38 UTC (rev 4215) +++ trunk/Products/ZenModel/skins/zenmodel/Dashboard.pt 2007-03-07 13:17:08 UTC (rev 4216) @@ -29,13 +29,17 @@ <!-- Top Left --> <td rowspan="2" width="50%" valign="top"> - <table class="zentable" cellpadding="3" cellspacing="1"> + +<table class="zentable" cellpadding="3" cellspacing="1"> <thead> + +<tal:block tal:define="tblcolspan string:6"> +<tr tal:define=" tabletitle string:Systems-Level Event Summary"> +<tal:block metal:use-macro="here/zenuimacros/macros/tabletitle"/></tr><tr> +<td tal:attributes="colspan tblcolspan" style="padding:0px"> + <table class="innerzentable" cellpadding="3" cellspacing="1"> + <tr> - <th class="tabletitle" colspan="6"> - <a style="color: white" href="/zport/dmd/Systems/viewEvents">Systems</a>-Level Event Summary</th> - </tr> - <tr> <th class="tableheader">System</th> <th class="tableheader">Critical</th> <th class="tableheader">Error</th> @@ -43,49 +47,62 @@ <th class="tableheader">Info</th> <th class="tableheader">Debug</th> </tr> - </thead> <tbody id="systemevents"> </tbody> </table> +</td></tr></tal:block></thead></table> + </td> <td valign="top"> - <table class="zentable" cellpadding="3" cellspacing="1"> + +<table class="zentable" cellpadding="3" cellspacing="1"> <thead> + +<tal:block tal:define="tblcolspan string:4"> +<tr +tal:define=" +tabletitle string:Devices with Events (Severity >= Error)"> +<tal:block metal:use-macro="here/zenuimacros/macros/tabletitle"/></tr><tr><td tal:attributes="colspan tblcolspan" style="padding:0px"> <table class="innerzentable" cellpadding="3" cellspacing="1"> + <tr> - <th class="tabletitle" colspan="4"> - <a style="color: white" href="/zport/dmd/Devices/viewEvents">Devices</a> with Events (Severity >= Error)</th> - </tr> - <tr> <th class="tableheader">Name</th> <th class="tableheader">Acked By</th> <th class="tableheader">Critical</th> <th class="tableheader">Error</th> </tr> - </thead> <tbody id="deviceevents"> </tbody> </table> +</td></tr></tal:block></thead></table> + </td> </tr> <tr> <td valign="bottom"> - <table class="zentable" cellpadding="3" cellspacing="1"> - <thead> - <tr> - <th class="tabletitle" colspan="6"> - Zenoss Infrastructure <a style="color: white" href="zport/dmd/Reports/Event%20Reports/All%20Heartbeats">Issues</a></th> + +<table class="zentable" cellpadding="3" cellspacing="1"> + <thead> + <tal:block tal:define="tblcolspan string:6"> + <tr tal:define=" tabletitle string:Zenoss Infrastructure Issues"> + <tal:block metal:use-macro="here/zenuimacros/macros/tabletitle"/> </tr> <tr> - <th class="tableheader">Device</th> - <th class="tableheader">Component</th> - <th class="tableheader">Seconds</th> + <td tal:attributes="colspan tblcolspan" style="padding:0px"> + <table class="innerzentable" cellpadding="3" cellspacing="1"> + <tr> + <th class="tableheader">Device</th> + <th class="tableheader">Component</th> + <th class="tableheader">Seconds</th> + </tr> + <tbody id="heartbeat"> + </tbody> + </table> + + </td> </tr> - </thead> - <tbody id="heartbeat"> - </tbody> - </table> - </td> - </tr> + </tal:block> +</thead></table></td></tr> + </table> </tal:block> </tal:block> Modified: trunk/Products/ZenModel/skins/zenmodel/deviceManagement.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/deviceManagement.pt 2007-03-06 22:47:38 UTC (rev 4215) +++ trunk/Products/ZenModel/skins/zenmodel/deviceManagement.pt 2007-03-07 13:17:08 UTC (rev 4216) @@ -10,9 +10,16 @@ <form action="_" method="post" tal:attributes="action here/REQUEST/URL1"> <input type="hidden" name="zenScreenName" tal:attributes="value template/id" /> + <table class="zentable" border=0 cellpadding=3 cellspacing=1> - <tr><th class=tabletitle align=center colspan=2>Device Management</th></tr> + +<tal:block tal:define="tblcolspan string:2"> +<tr +tal:define=" +tabletitle string:Device Management"> +<tal:block metal:use-macro="here/zenuimacros/macros/tabletitle"/></tr><tr><td tal:attributes="colspan tblcolspan" style="padding:0px"> <table class="innerzentable" cellpadding="3" cellspacing="1"> + <tal:block metal:use-macro="here/userCommandsMacros/macros/runCommand" /> <tr> @@ -81,6 +88,8 @@ </td> </tr> </table> +</td></tr></tal:block></table> + </form> <span metal:use-macro="here/templates/macros/contentSeparator"/> @@ -95,18 +104,21 @@ <form method="post" tal:attributes="action here/absolute_url_path" metal:define-macro="adminRolesTable"> <input type="hidden" name="zenScreenName" tal:attributes="value template/id"/> + <table class="zentable" cellpadding="3" cellspacing="1" tal:define="objects here/adminRoles/objectValuesAll; editable here/isManager; tableName string:deviceadminroles; batch python:here.ZenTableManager.getBatch(tableName,objects);"> <input type='hidden' name='tableName' tal:attributes="value tableName" /> + +<tal:block tal:define="tblcolspan string:5"> +<tr +tal:define=" +tabletitle string:Administrators"> +<tal:block metal:use-macro="here/zenuimacros/macros/tabletitle"/></tr><tr><td tal:attributes="colspan tblcolspan" style="padding:0px"> <table class="innerzentable" cellpadding="3" cellspacing="1"> + <tr> - <th class="tabletitle" colspan="5"> - Administrators - </th> - </tr> - <tr> <th tal:replace="structure python:here.ZenTableManager.getTableHeader( tableName,'primarySortKey','Name')"/> <th tal:replace="structure python:here.ZenTableManager.getTableHeader( @@ -173,20 +185,25 @@ </td> </tr> </table> +</td></tr></tal:block></table> + </form> <span metal:use-macro="here/templates/macros/contentSeparator"/> + <table class="zentable" cellpadding="3" cellspacing="1" metal:define-macro="graphLinks" tal:condition="here/havePydot" tal:define=" routers string:${here/absolute_url_path}/deviceGraphRouters; networks string:${here/absolute_url_path}/deviceGraphNets"> + +<tal:block tal:define="tblcolspan string:4"> +<tr +tal:define=" +tabletitle string:Graphs"> +<tal:block metal:use-macro="here/zenuimacros/macros/tabletitle"/></tr><tr><td tal:attributes="colspan tblcolspan" style="padding:0px"> <table class="innerzentable" cellpadding="3" cellspacing="1"> + <tr> - <th class="tabletitle" colspan="4"> - Graphs - </th> - </tr> - <tr> <td class="tableheader">Relative Network Graph</td> <td class="tablevalues" colspan="3"><a tal:attributes="href routers">Image Link</a> (routers only)</td> @@ -197,6 +214,8 @@ networks">Image Link</a> (routers and networks)</td> </tr> </table> +</td></tr></tal:block></table> + </tal:block> </tal:block> Modified: trunk/Products/ZenModel/skins/zenmodel/deviceOrganizerManage.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/deviceOrganizerManage.pt 2007-03-06 22:47:38 UTC (rev 4215) +++ trunk/Products/ZenModel/skins/zenmodel/deviceOrganizerManage.pt 2007-03-07 13:17:08 UTC (rev 4216) @@ -5,8 +5,13 @@ <form action="_" method="post" tal:attributes="action here/REQUEST/URL1"> <input type="hidden" name="zenScreenName" tal:attributes="value template/id" /> + <table class="zentable" border=0 cellpadding=3 cellspacing=1> - <tr><th class=tabletitle align=center colspan="5">Device Management</th></tr> + +<tal:block tal:define="tblcolspan string:5"> +<tr tal:define=" tabletitle string:Device Management"> +<tal:block metal:use-macro="here/zenuimacros/macros/tabletitle"/></tr><tr><td tal:attributes="colspan tblcolspan" style="padding:0px"> <table class="innerzentable" cellpadding="3" cellspacing="1"> + <span metal:use-macro="here/userCommandsMacros/macros/runCommand" /> @@ -31,6 +36,8 @@ </td> </tr> </table> +</td></tr></tal:block></table> + </form> <br/> Modified: trunk/Products/ZenModel/skins/zenmodel/editCustSchema.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/editCustSchema.pt 2007-03-06 22:47:38 UTC (rev 4215) +++ trunk/Products/ZenModel/skins/zenmodel/editCustSchema.pt 2007-03-07 13:17:08 UTC (rev 4216) @@ -4,14 +4,17 @@ <form method="post" tal:attributes="action string:${request/URL1}"> <input type="hidden" name="zenScreenName" tal:attributes="value template/id"/> + <table class="zentable" cellpadding="3" cellspacing="1" tal:define="props here/custPropertyMap"> + +<tal:block tal:define="tblcolspan string:5"> +<tr +tal:define=" +tabletitle string:Custom Properties"> +<tal:block metal:use-macro="here/zenuimacros/macros/tabletitle"/></tr><tr><td tal:attributes="colspan tblcolspan" style="padding:0px"> <table class="innerzentable" cellpadding="3" cellspacing="1"> + <tr> - <th class="tabletitle" colspan="5"> - Custom Properties - </th> - </tr> - <tr> <th class="tableheader">Property</th> <th class="tableheader">Label</th> <th class="tableheader">Value</th> @@ -72,13 +75,22 @@ </td> </tr> </table> +</td></tr></tal:block></table> + </form> <br/> <form method="post" tal:attributes="action here/getPrimaryUrlPath"> <input type="hidden" name="zenScreenName" tal:attributes="value template/id"/> + <table class="zentable" cellpadding="3" cellspacing="1"> -<tr><th class="tabletitle" colspan="2">Add Property</th></tr> + +<tal:block tal:define="tblcolspan string:2"> +<tr +tal:define=" +tabletitle string:Add Property"> +<tal:block metal:use-macro="here/zenuimacros/macros/tabletitle"/></tr><tr><td tal:attributes="colspan tblcolspan" style="padding:0px"> <table class="innerzentable" cellpadding="3" cellspacing="1"> + <tr> <td class="tableheader">Label</td> <td class="tablevalues"> @@ -124,6 +136,8 @@ </td> </tr> </table> +</td></tr></tal:block></table> + </form> </tal:block> </tal:block> Modified: trunk/Products/ZenModel/skins/zenmodel/maintenanceWindowsMacro.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/maintenanceWindowsMacro.pt 2007-03-06 22:47:38 UTC (rev 4215) +++ trunk/Products/ZenModel/skins/zenmodel/maintenanceWindowsMacro.pt 2007-03-07 13:17:08 UTC (rev 4216) @@ -1,17 +1,20 @@ <form method="post" tal:attributes="action here/absolute_url_path" metal:define-macro="maintenanceWindows"> <input type="hidden" name="zenScreenName" tal:attributes="value template/id"/> + <table class="zentable" cellpadding="3" cellspacing="1" tal:define="objects here/maintenanceWindows/objectValuesAll; tableName string:devicemaintenancewindow; batch python:here.ZenTableManager.getBatch(tableName,objects);"> <input type='hidden' name='tableName' tal:attributes="value tableName" /> + +<tal:block tal:define="tblcolspan string:7"> +<tr +tal:define=" +tabletitle string:Maintenance Windows"> +<tal:block metal:use-macro="here/zenuimacros/macros/tabletitle"/></tr><tr><td tal:attributes="colspan tblcolspan" style="padding:0px"> <table class="innerzentable" cellpadding="3" cellspacing="1"> + <tr> - <th class="tabletitle" align="left" colspan="7"> - Maintenance Windows - </th> - </tr> - <tr> <th tal:replace="structure python:here.ZenTableManager.getTableHeader( tableName,'primarySortKey','Name','cmp')"> Name @@ -80,4 +83,6 @@ </td> </tr> </table> +</td></tr></tal:block></table> + </form> Modified: trunk/Products/ZenModel/skins/zenmodel/perfConfig.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/perfConfig.pt 2007-03-06 22:47:38 UTC (rev 4215) +++ trunk/Products/ZenModel/skins/zenmodel/perfConfig.pt 2007-03-07 13:17:08 UTC (rev 4216) @@ -1,6 +1,7 @@ <tal:block metal:use-macro="here/templates/macros/page2"> <tal:block metal:fill-slot="contentPane"> <form method="post" tal:attributes="action here/absolute_url_path"> + <table class="zentable" cellpadding="3" cellspacing="1" metal:define-macro="rrdtemplatelist" tal:define="tableName string:rrdtemplatelist; @@ -10,10 +11,14 @@ tal:attributes="value tableName" /> <input type="hidden" name="zenScreenName" tal:attributes="value template/id"/> + +<tal:block tal:define="tblcolspan string:4"> +<tr +tal:define=" +tabletitle string:Performance Templates"> +<tal:block metal:use-macro="here/zenuimacros/macros/tabletitle"/></tr><tr><td tal:attributes="colspan tblcolspan" style="padding:0px"> <table class="innerzentable" cellpadding="3" cellspacing="1"> + <tr> - <th class="tabletitle" align="left" colspan="4">Performance Templates</th> - </tr> - <tr> <th class="tableheader" width="5px"></th> <th tal:replace="structure python:here.ZenTableManager.getTableHeader( tableName,'getId','Name')"/> @@ -48,6 +53,7 @@ <span metal:use-macro="here/zenTableNavigation/macros/navbody"/> </td> </tr> + <tr class="tableheader" tal:condition="here/isManager"> <td colspan="4"> <input class="tableheader" type="text" name="id"/> @@ -83,9 +89,16 @@ </td> </tr> - <tr> - <th class="tabletitle" align="left" colspan="6">Import</th> - </tr> +</table> +</td></tr></tal:block></table> + + +<table class="zentable"> +<tal:block tal:define="tblcolspan string:6"> +<tr +tal:define=" +tabletitle string:Import"> +<tal:block metal:use-macro="here/zenuimacros/macros/tabletitle"/></tr><tr><td tal:attributes="colspan tblcolspan" style="padding:0px"> <table class="innerzentable" cellpadding="3" cellspacing="1"> <tr class="tableheader" tal:condition="here/isManager"> <td colspan="6"> Import templates to PerfConf from the desired source @@ -124,6 +137,8 @@ </tr> --> </table> +</td></tr></tal:block></table> + </form> </tal:block> </tal:block> Modified: trunk/Products/ZenModel/skins/zenmodel/serviceOrganizerManage.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/serviceOrganizerManage.pt 2007-03-06 22:47:38 UTC (rev 4215) +++ trunk/Products/ZenModel/skins/zenmodel/serviceOrganizerManage.pt 2007-03-07 13:17:08 UTC (rev 4216) @@ -3,14 +3,19 @@ <form method="post" tal:attributes="action here/absolute_url_path"> <input type="hidden" name="zenScreenName" tal:attributes="value template/id"/> - <table class="zentable" cellpadding="3" cellspacing="1"> - <tr> - <th class="tabletitle" colspan="2"> - Service Management - </th> - </tr> + +<table class="zentable" cellpadding="3" cellspacing="1"> + +<tal:block tal:define="tblcolspan string:2"> +<tr +tal:define=" +tabletitle string:Service Management"> +<tal:block metal:use-macro="here/zenuimacros/macros/tabletitle"/></tr><tr><td tal:attributes="colspan tblcolspan" style="padding:0px"> <table class="innerzentable" cellpadding="3" cellspacing="1"> + <tal:block metal:use-macro="here/userCommandsMacros/macros/runCommand" /> </table> +</td></tr></tal:block></table> + </form> <span metal:use-macro="here/templates/macros/contentSeparator"/> Modified: trunk/Products/ZenModel/skins/zenmodel/serviceOrganizerOverview.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/serviceOrganizerOverview.pt 2007-03-06 22:47:38 UTC (rev 4215) +++ trunk/Products/ZenModel/skins/zenmodel/serviceOrganizerOverview.pt 2007-03-07 13:17:08 UTC (rev 4216) @@ -2,6 +2,7 @@ <tal:block metal:fill-slot="contentPane"> <form method="post" tal:attributes="action here/absolute_url_path"> + <table class="zentable" cellpadding="3" cellspacing="1" tal:define="objects here/children; tableName string:children; @@ -9,11 +10,13 @@ <input type='hidden' name='tableName' tal:attributes="value tableName" /> <input type="hidden" name="zenScreenName" tal:attributes="value template/id"/> - <tr> - <th class=tabletitle align=left colspan="6"> - Sub-Folders - </th> - </tr> + +<tal:block tal:define="tblcolspan string:6"> +<tr +tal:define=" +tabletitle string:Sub-Folders"> +<tal:block metal:use-macro="here/zenuimacros/macros/tabletitle"/></tr><tr><td tal:attributes="colspan tblcolspan" style="padding:0px"> <table class="innerzentable" cellpadding="3" cellspacing="1"> + <span tal:condition="objects" tal:omit-tag=""> <tr> <th tal:replace="structure python:here.ZenTableManager.getTableHeader( @@ -71,11 +74,14 @@ </td> </tr> </table> +</td></tr></tal:block></table> + </form> <span metal:use-macro="here/templates/macros/contentSeparator"/> <form method="post" tal:attributes="action here/absolute_url_path"> + <table class="zentable" cellpadding="3" cellspacing="1" tal:define="objects here/serviceclasses; tableName string:serviceclasseslist; @@ -83,9 +89,13 @@ <input type='hidden' name='tableName' tal:attributes="value tableName" /> <input type="hidden" name="zenScreenName" tal:attributes="value template/id"/> - <tr> - <th class="tabletitle" align="left" colspan="5">Services</th> - </tr> + +<tal:block tal:define="tblcolspan string:5"> +<tr +tal:define=" +tabletitle string:Services"> +<tal:block metal:use-macro="here/zenuimacros/macros/tabletitle"/></tr><tr><td tal:attributes="colspan tblcolspan" style="padding:0px"> <table class="innerzentable" cellpadding="3" cellspacing="1"> + <span tal:condition="objects" tal:omit-tag=""> <tr> <th tal:replace="structure python:here.ZenTableManager.getTableHeader( @@ -147,6 +157,8 @@ </td> </tr> </table> +</td></tr></tal:block></table> + </form> </tal:block> Modified: trunk/Products/ZenModel/skins/zenmodel/userCommandsMacros.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/userCommandsMacros.pt 2007-03-06 22:47:38 UTC (rev 4215) +++ trunk/Products/ZenModel/skins/zenmodel/userCommandsMacros.pt 2007-03-07 13:17:08 UTC (rev 4216) @@ -8,13 +8,16 @@ batch python:here.ZenTableManager.getBatch(tableName,objects);"> <input type="hidden" name="zenScreenName" tal:attributes="value template/id"/> <input type='hidden' name='tableName' tal:attributes="value tableName" /> + <table class="zentable" cellpadding="3" cellspacing="1"> + +<tal:block tal:define="tblcolspan string:5"> +<tr +tal:define=" +tabletitle string:Define Commands"> +<tal:block metal:use-macro="here/zenuimacros/macros/tabletitle"/></tr><tr><td tal:attributes="colspan tblcolspan" style="padding:0px"> <table class="innerzentable" cellpadding="3" cellspacing="1"> + <tr> - <th class="tabletitle" colspan="5"> - Define Commands - </th> - </tr> - <tr> <th tal:replace="structure python:here.ZenTableManager.getTableHeader( tableName,'primarySortKey','Name')"/> <th tal:replace="structure python:here.ZenTableManager.getTableHeader( @@ -64,6 +67,8 @@ </td> </tr> </table> +</td></tr></tal:block></table> + </form> Modified: trunk/Products/ZenModel/skins/zenmodel/viewHistory.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/viewHistory.pt 2007-03-06 22:47:38 UTC (rev 4215) +++ trunk/Products/ZenModel/skins/zenmodel/viewHistory.pt 2007-03-07 13:17:08 UTC (rev 4216) @@ -1,12 +1,13 @@ <tal:block metal:use-macro="here/templates/macros/page2"> <tal:block metal:fill-slot="contentPane"> + <table class="zentable" cellpadding="3" cellspacing="1"> + +<tal:block tal:define="tblcolspan string:4"> +<tr tal:define="tabletitle string:Changes for ${here/getId}"> +<tal:block metal:use-macro="here/zenuimacros/macros/tabletitle"/></tr><tr><td tal:attributes="colspan tblcolspan" style="padding:0px"> <table class="innerzentable" cellpadding="3" cellspacing="1"> + <tr> - <th class="tabletitle" colspan="4" - tal:content="string:Changes for ${here/getId}"> - </th> - </tr> - <tr> <th class="tableheader" align="left"> Time of change </th> @@ -30,5 +31,7 @@ </tr> </tal:block> </table> +</td></tr></tal:block></table> + </tal:block> </tal:block> Modified: trunk/Products/ZenModel/skins/zenmodel/zPropertyEdit.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/zPropertyEdit.pt 2007-03-06 22:47:38 UTC (rev 4215) +++ trunk/Products/ZenModel/skins/zenmodel/zPropertyEdit.pt 2007-03-07 13:17:08 UTC (rev 4216) @@ -4,14 +4,17 @@ <form method="post" tal:attributes="action string:${request/URL1}"> <input type="hidden" name="zenScreenName" tal:attributes="value template/id"/> + <table class="zentable" cellpadding="3" cellspacing="1" tal:define="props here/zenPropertyIds"> + +<tal:block tal:define="tblcolspan string:4"> +<tr +tal:define=" +tabletitle string:zProperties Configuration"> +<tal:block metal:use-macro="here/zenuimacros/macros/tabletitle"/></tr><tr><td tal:attributes="colspan tblcolspan" style="padding:0px"> <table class="innerzentable" cellpadding="3" cellspacing="1"> + <tr> - <th class="tabletitle" colspan="4"> - zProperties Configuration - </th> - </tr> - <tr> <th class="tableheader" align="center">Property</th> <th class="tableheader" align="center">Value</th> <th class="tableheader" align="center">Type</th> @@ -93,13 +96,22 @@ </td> </tr> </table> +</td></tr></tal:block></table> + </form> <form tal:condition="here/isManager" method="post" tal:attributes="action string:${request/URL1}"> <input type="hidden" name="zenScreenName" tal:attributes="value template/id"/> + <table class="zentable" cellpadding="3" cellspacing="1"> -<tr><th class="tabletitle">Delete Local Property</th></tr> + +<tal:block tal:define="tblcolspan string:1"> +<tr +tal:define=" +tabletitle string:Delete Local Property"> +<tal:block metal:use-macro="here/zenuimacros/macros/tabletitle"/></tr><tr><td tal:attributes="colspan tblcolspan" style="padding:0px"> <table class="innerzentable" cellpadding="3" cellspacing="1"> + <tr class="tableheader"> <td> <select name="propname" class="tableheader"> @@ -114,6 +126,8 @@ </td> </tr> </table> +</td></tr></tal:block></table> + </form> </tal:block> |
From: <sv...@ze...> - 2007-03-06 22:47:38
|
Author: ecn Date: 2007-03-06 16:47:38 -0600 (Tue, 06 Mar 2007) New Revision: 4215 Modified: trunk/inst/GNUmakefile Log: * prep for pynetsnmp Modified: trunk/inst/GNUmakefile =================================================================== --- trunk/inst/GNUmakefile 2007-03-06 22:44:06 UTC (rev 4214) +++ trunk/inst/GNUmakefile 2007-03-06 22:47:38 UTC (rev 4215) @@ -75,6 +75,8 @@ TESTGEN= $(call ROOT, testgen) PDISXPATH= $(call ROOT, PDIS-XPath) ELEMENTTREE= $(call ROOT, elementtree) +PYNETSNMP= $(call ROOT, pynetsnmp) +CTYPES= $(call ROOT, ctypes) # optional packages SENDPAGE= $(call ROOT, sendpage) @@ -185,6 +187,12 @@ epydoc-install: build/$(EPYDOC)/.unpacked $(PYINSTALL) +pynetsnmp-install: build/$(PYNETSNMP)/.unpacked ctypes-install + $(PYINSTALL) + +ctypes-install: build/$(CTYPES)/.unpacked + $(PYINSTALL) + testgen-install: build/$(TESTGEN)/.unpacked pdisxpath-install elementtree-install $(PYINSTALL) |
From: <sv...@ze...> - 2007-03-06 22:44:06
|
Author: ecn Date: 2007-03-06 16:44:06 -0600 (Tue, 06 Mar 2007) New Revision: 4214 Added: trunk/inst/externallibs/ctypes-1.0.1.tar.gz Log: * prep for pynetsnmp Added: trunk/inst/externallibs/ctypes-1.0.1.tar.gz Property changes on: trunk/inst/externallibs/ctypes-1.0.1.tar.gz ___________________________________________________________________ Name: svn:mime-type + application/octet-stream |
From: <sv...@ze...> - 2007-03-06 22:05:32
|
Author: ecn Date: 2007-03-06 16:05:29 -0600 (Tue, 06 Mar 2007) New Revision: 4213 Modified: trunk/Products/ZenRRD/zenprocess.py Log: * grr... fix bad import exception Modified: trunk/Products/ZenRRD/zenprocess.py =================================================================== --- trunk/Products/ZenRRD/zenprocess.py 2007-03-06 20:21:17 UTC (rev 4212) +++ trunk/Products/ZenRRD/zenprocess.py 2007-03-06 22:05:29 UTC (rev 4213) @@ -26,7 +26,7 @@ from pynetsnmp.twistedsnmp import AgentProxy from pynetsnmp.tableretriever import TableRetriever log.info("Using net-snmp snmp engine") -except NameError, ImportError: +except ImportError: log.warning("Using twistedsnmp engine") from twistedsnmp.agentproxy import AgentProxy from twistedsnmp.tableretriever import TableRetriever |
From: <sv...@ze...> - 2007-03-06 20:21:17
|
Author: ecn Date: 2007-03-06 14:21:17 -0600 (Tue, 06 Mar 2007) New Revision: 4212 Modified: trunk/Products/DataCollector/SnmpClient.py Log: * use pynetsnmp Modified: trunk/Products/DataCollector/SnmpClient.py =================================================================== --- trunk/Products/DataCollector/SnmpClient.py 2007-03-06 20:18:26 UTC (rev 4211) +++ trunk/Products/DataCollector/SnmpClient.py 2007-03-06 20:21:17 UTC (rev 4212) @@ -4,7 +4,11 @@ from twisted.internet import reactor, error, defer from twisted.python import failure -from twistedsnmp import snmpprotocol, agentproxy +try: + from pynetsnmp.twistedsnmp import snmpprotocol, AgentProxy +except ImportError: + from twistedsnmp import snmpprotocol + from twistedsnmp.agentproxy import AgentProxy import Globals @@ -38,14 +42,19 @@ self.timeout = float(getattr(device,'zSnmpTimeout', defaultTimeout)) srcport = snmpprotocol.port() - self.proxy = agentproxy.AgentProxy(ipaddr, port, community, snmpver, - protocol=srcport.protocol) + self.proxy = AgentProxy(ipaddr, port, community, snmpver, + protocol=srcport.protocol) + if not hasattr(self.proxy, 'open'): + def doNothing(): pass + self.proxy.open = doNothing + self.proxy.close = doNothing def run(self): """Start snmp collection. """ log.debug("timeout=%s, tries=%s", self.timeout, self.tries) + self.proxy.open() drive(self.doRun).addBoth(self.clientFinished) @@ -122,6 +131,7 @@ return data def clientFinished(self, *ignored): + self.proxy.close() """tell the datacollector that we are all done""" log.info("snmp client finished collection for %s" % self.hostname) if self.datacollector: |
From: <sv...@ze...> - 2007-03-06 20:18:26
|
Author: ecn Date: 2007-03-06 14:18:26 -0600 (Tue, 06 Mar 2007) New Revision: 4211 Modified: trunk/Products/DataCollector/SnmpSession.py Log: * deprecate SnmpSession Modified: trunk/Products/DataCollector/SnmpSession.py =================================================================== --- trunk/Products/DataCollector/SnmpSession.py 2007-03-06 19:14:52 UTC (rev 4210) +++ trunk/Products/DataCollector/SnmpSession.py 2007-03-06 20:18:26 UTC (rev 4211) @@ -1,3 +1,5 @@ +import warnings +warnings.warn("SnmpSession is deprecated", DeprecationWarning) ################################################################# # # Copyright (c) 2002 Zenoss, Inc. All rights reserved. |
From: <sv...@ze...> - 2007-03-06 19:14:54
|
Author: marc Date: 2007-03-06 13:14:52 -0600 (Tue, 06 Mar 2007) New Revision: 4210 Modified: trunk/Products/ZenModel/RRDDataSource.py trunk/Products/ZenModel/RRDTemplate.py Log: #630 * Updated retrieval of PerfConf Modified: trunk/Products/ZenModel/RRDDataSource.py =================================================================== --- trunk/Products/ZenModel/RRDDataSource.py 2007-03-06 18:49:28 UTC (rev 4209) +++ trunk/Products/ZenModel/RRDDataSource.py 2007-03-06 19:14:52 UTC (rev 4210) @@ -220,8 +220,7 @@ for id in ids: dp = getattr(self.datapoints,id,False) if dp: - - perfConf = self.getDmd().Monitors.getPerformanceMonitor('localhost') + perfConf = self.device().getPerformanceServer() perfConf.deleteRRDFiles(device=self.device().id, datapoint=dp.name()) clean(self.graphs, dp.name()) Modified: trunk/Products/ZenModel/RRDTemplate.py =================================================================== --- trunk/Products/ZenModel/RRDTemplate.py 2007-03-06 18:49:28 UTC (rev 4209) +++ trunk/Products/ZenModel/RRDTemplate.py 2007-03-06 19:14:52 UTC (rev 4210) @@ -219,8 +219,7 @@ if not ids: return self.callZenScreen(REQUEST) for id in ids: if getattr(self.datasources,id,False): - - perfConf = self.getDmd().Monitors.getPerformanceMonitor('localhost') + perfConf = self.device().getPerformanceServer() perfConf.deleteRRDFiles(device=self.device().id, datasource=id) self.datasources._delObject(id) |
From: <sv...@ze...> - 2007-03-06 18:50:01
|
Author: oubiwann Date: 2007-03-06 12:49:28 -0600 (Tue, 06 Mar 2007) New Revision: 4209 Added: trunk/Products/ZenUtils/patches/ trunk/Products/ZenUtils/patches/__init__.py trunk/Products/ZenUtils/patches/pasmonkey.py Modified: sandboxen/oubiwann/ChangeLog trunk/Products/ZenUtils/Security.py trunk/Products/ZenUtils/__init__.py Log: 2007.03.06 * Cleaned up the PAS monkey patches (see #1042), putting them in their own module with a useful docstring. Modified: sandboxen/oubiwann/ChangeLog =================================================================== --- sandboxen/oubiwann/ChangeLog 2007-03-06 16:23:54 UTC (rev 4208) +++ sandboxen/oubiwann/ChangeLog 2007-03-06 18:49:28 UTC (rev 4209) @@ -1,3 +1,8 @@ +2007.03.06 + +* Cleaned up the PAS monkey patches (see #1042), putting them in their own +module with a useful docstring. + 2006.12.12 * Updated the manner in which config and log files are read in ZenossInfo.py to Modified: trunk/Products/ZenUtils/Security.py =================================================================== --- trunk/Products/ZenUtils/Security.py 2007-03-06 16:23:54 UTC (rev 4208) +++ trunk/Products/ZenUtils/Security.py 2007-03-06 18:49:28 UTC (rev 4209) @@ -238,7 +238,7 @@ acl = context.acl_users # if there's an acl_users object, let's see if theres a login_form # attribute; if there is, we need to delete it - if (hasattr(acl, 'cookieAuthHelper') + if (hasattr(acl, 'cookieAuthHelper') and hasattr(acl.cookieAuthHelper, 'login_form')): acl.cookieAuthHelper._delObject('login_form') except AttributeError: Modified: trunk/Products/ZenUtils/__init__.py =================================================================== --- trunk/Products/ZenUtils/__init__.py 2007-03-06 16:23:54 UTC (rev 4208) +++ trunk/Products/ZenUtils/__init__.py 2007-03-06 18:49:28 UTC (rev 4209) @@ -1,74 +1,5 @@ from Products.CMFCore.DirectoryView import registerDirectory registerDirectory('js', globals()) -# monkey patch PAS to allow inituser files, but check to see if we need to -# actually apply the patch, first -- support may have been added at some point -from Products.PluggableAuthService import PluggableAuthService -from Security import _createInitialUser -pas = PluggableAuthService.PluggableAuthService -if not hasattr(pas, '_createInitialUser'): - pas._createInitialUser = _createInitialUser - -# monkey patches for the PAS login form -from Products.PluggableAuthService.plugins import CookieAuthHelper - -def manage_afterAdd(self, item, container): - """We don't want CookieAuthHelper setting the login attribute, we we'll - override manage_afterAdd(). - - For now, the only thing that manage_afterAdd does is set the login_form - attribute, but we will need to check this after every upgrade of the PAS. - """ - pass - -CookieAuthHelper.CookieAuthHelper.manage_afterAdd = manage_afterAdd - -def login(self): - """ Set a cookie and redirect to the url that we tried to - authenticate against originally. - """ - request = self.REQUEST - response = request['RESPONSE'] - - login = request.get('__ac_name', '') - password = request.get('__ac_password', '') - submitted = request.get('submitted', '') - - pas_instance = self._getPAS() - - if pas_instance is not None: - pas_instance.updateCredentials(request, response, login, password) - - came_from = request.form.get('came_from') or '' - if 'submitted' not in came_from: - came_from += '?submitted=%s' % submitted - if self.dmd.acceptedTerms: - url = came_from - else: - url = "%s/zenoss_terms/?came_from=%s" % (self.absolute_url(), came_from) - return response.redirect(url) - -CookieAuthHelper.CookieAuthHelper.login = login - - -def termsCheck(self): - """ Check to see if the user has accepted the Zenoss terms. - """ - request = self.REQUEST - response = request['RESPONSE'] - - acceptStatus = request.form.get('terms') or '' - url = request.form.get('came_from') or self.absolute_url() - - if acceptStatus != 'Accept': - self.resetCredentials(request, response) - if '?' in url: - url += '&' - else: - url += '?' - url += 'terms=Decline' - else: - self.dmd.acceptedTerms = True - return response.redirect(url) - -CookieAuthHelper.CookieAuthHelper.termsCheck = termsCheck +# import any monkey patches that may be necessary +from patches import pasmonkey Added: trunk/Products/ZenUtils/patches/__init__.py Added: trunk/Products/ZenUtils/patches/pasmonkey.py |
From: <sv...@ze...> - 2007-03-06 16:23:58
|
Author: ecn Date: 2007-03-06 10:23:54 -0600 (Tue, 06 Mar 2007) New Revision: 4208 Modified: trunk/Products/ZenModel/Device.py Log: * eliminate deprecation warning if netsnmp is not installed for most cases Modified: trunk/Products/ZenModel/Device.py =================================================================== --- trunk/Products/ZenModel/Device.py 2007-03-06 16:22:14 UTC (rev 4207) +++ trunk/Products/ZenModel/Device.py 2007-03-06 16:23:54 UTC (rev 4208) @@ -41,12 +41,6 @@ from ZODB.POSException import POSError from AccessControl import Permissions as permissions -try: - from pynetsnmp.SnmpSession import SnmpSession -except: - from Products.DataCollector.SnmpSession import SnmpSession - - #from Products.SnmpCollector.SnmpCollector import findSnmpCommunity from Products.DataCollector.ApplyDataMap import ApplyDataMap @@ -144,6 +138,11 @@ def findCommunity(context, ip, devicePath, community="", port=161): """Find the snmp community for an ip address using zSnmpCommunities. """ + try: + from pynetsnmp.SnmpSession import SnmpSession + except: + from Products.DataCollector.SnmpSession import SnmpSession + devroot = context.getDmdRoot('Devices').createOrganizer(devicePath) communities = [] if community: communities.append(community) |
From: <sv...@ze...> - 2007-03-06 16:22:17
|
Author: ecn Date: 2007-03-06 10:22:14 -0600 (Tue, 06 Mar 2007) New Revision: 4207 Modified: trunk/Products/ZenModel/Device.py Log: * replace Erik's SnmpSession class Modified: trunk/Products/ZenModel/Device.py =================================================================== --- trunk/Products/ZenModel/Device.py 2007-03-06 15:19:42 UTC (rev 4206) +++ trunk/Products/ZenModel/Device.py 2007-03-06 16:22:14 UTC (rev 4207) @@ -41,8 +41,13 @@ from ZODB.POSException import POSError from AccessControl import Permissions as permissions +try: + from pynetsnmp.SnmpSession import SnmpSession +except: + from Products.DataCollector.SnmpSession import SnmpSession + + #from Products.SnmpCollector.SnmpCollector import findSnmpCommunity -from Products.DataCollector.SnmpSession import SnmpSession from Products.DataCollector.ApplyDataMap import ApplyDataMap from Products.ZenRelations.RelSchema import * @@ -156,14 +161,6 @@ try: devname = session.get(oid).values()[0] goodcommunity = session.community -# FIXME - v2 queries don't take multiple head oids which needs to be -# reconciled with v1 where we want that as an optimization. -# will revisit when I have more time. -EAD -# try: -# session.getTable(sysTableOid, bulk=True) -# snmpver="v2" -# except (SystemExit, KeyboardInterrupt): raise -# except: snmpver="v1" break except (SystemExit, KeyboardInterrupt, POSError): raise except: pass #keep trying until we run out |
From: <sv...@ze...> - 2007-03-06 15:19:43
|
Author: ecn Date: 2007-03-06 09:19:42 -0600 (Tue, 06 Mar 2007) New Revision: 4206 Modified: trunk/Products/ZenModel/PerformanceConf.py Log: * provide method to query all device process status in one call Modified: trunk/Products/ZenModel/PerformanceConf.py =================================================================== --- trunk/Products/ZenModel/PerformanceConf.py 2007-03-06 15:19:19 UTC (rev 4205) +++ trunk/Products/ZenModel/PerformanceConf.py 2007-03-06 15:19:42 UTC (rev 4206) @@ -193,6 +193,33 @@ return [(dev.id, counts.get(dev.id, 0)) for dev in self.devices()] + def getProcessStatus(self, device=None): + "Get the known process status from the Event Manager" + from Products.ZenEvents.ZenEventClasses import Status_OSProcess + zem = self.dmd.ZenEventManager + down = {} + conn = zem.connect() + try: + curs = conn.cursor() + query = ("SELECT device, component, count" + " FROM status" + " WHERE eventClass = '%s'" % Status_OSProcess) + if device: + query += " AND device = '%s'" % device + curs.execute(query) + for device, component, count in curs.fetchall(): + down[device] = (component, count) + finally: + conn.close() + result = [] + for dev in self.devices(): + try: + component, count = down[dev.id] + result.append( (dev.id, component, count) ) + except KeyError: + pass + return result + def getOSProcessConf(self, devname=None): '''Get the OS Process configuration for all devices. ''' |
From: <sv...@ze...> - 2007-03-06 15:19:19
|
Author: ecn Date: 2007-03-06 09:19:19 -0600 (Tue, 06 Mar 2007) New Revision: 4205 Modified: trunk/Products/DataCollector/zenmodeler.py Log: * eliminate unused snmp imports Modified: trunk/Products/DataCollector/zenmodeler.py =================================================================== --- trunk/Products/DataCollector/zenmodeler.py 2007-03-06 15:18:43 UTC (rev 4204) +++ trunk/Products/DataCollector/zenmodeler.py 2007-03-06 15:19:19 UTC (rev 4205) @@ -15,13 +15,11 @@ import transaction import DateTime from twisted.internet import reactor -from pysnmp.error import PySnmpError from Products.ZenUtils.ZCmdBase import ZCmdBase from Products.ZenUtils.Utils import importClass from Products.ZenEvents.ZenEventClasses import Heartbeat -from SnmpSession import SnmpSession, ZenSnmpError from ApplyDataMap import ApplyDataMap, ApplyDataMapThread import SshClient import TelnetClient |
From: <sv...@ze...> - 2007-03-06 15:18:45
|
Author: ecn Date: 2007-03-06 09:18:43 -0600 (Tue, 06 Mar 2007) New Revision: 4204 Modified: trunk/Products/ZenRRD/zenprocess.py Log: * eliminate call to getStatus for each process Modified: trunk/Products/ZenRRD/zenprocess.py =================================================================== --- trunk/Products/ZenRRD/zenprocess.py 2007-03-06 15:18:04 UTC (rev 4203) +++ trunk/Products/ZenRRD/zenprocess.py 2007-03-06 15:18:43 UTC (rev 4204) @@ -199,7 +199,7 @@ def updateConfig(self, processes): unused = Set(self.processes.keys()) for name, originalName, ignoreParameters, \ - restart, severity, status, thresholds \ + restart, severity, thresholds \ in processes: unused.discard(name) p = self.processes.setdefault(name, Process()) @@ -213,7 +213,6 @@ m = before.get(name, ThresholdManager()) m.update(threshes) p.thresholds[name] = m - p.status = status for name in unused: del self.processes[name] @@ -283,6 +282,9 @@ yield self.model.callRemote('getSnmpStatus', self.options.device) self.updateSnmpStatus(driver.next()) + yield self.model.callRemote('getProcessStatus', self.options.device) + self.updateProcessStatus(driver.next()) + # fetch pids with an SNMP scan yield self.findPids(self.devices.values()); driver.next() driveLater(self.configCycleInterval * 60, self.start) @@ -294,7 +296,14 @@ if d: d.snmpStatus = count - + def updateProcessStatus(self, status): + down = {} + for device, component, count in status: + down[ (device, component) ] = count + for name, device in self.devices.items(): + for p in device.processes.values(): + p.status = down.get( (name, p.originalName), 0) + def findPids(self, devices): "Scan all devices for process names and args" jobs = NJobs(PARALLEL_JOBS, self.scanDevice, devices) |
From: <sv...@ze...> - 2007-03-06 15:18:33
|
Author: ecn Date: 2007-03-06 09:18:04 -0600 (Tue, 06 Mar 2007) New Revision: 4203 Modified: trunk/Products/ZenModel/OSProcess.py Log: * eliminate call to getStatus for each process Modified: trunk/Products/ZenModel/OSProcess.py =================================================================== --- trunk/Products/ZenModel/OSProcess.py 2007-03-06 15:17:43 UTC (rev 4202) +++ trunk/Products/ZenModel/OSProcess.py 2007-03-06 15:18:04 UTC (rev 4203) @@ -69,7 +69,6 @@ def getOSProcessConf(self): """Return information used to monitor this process. """ - thresholds = [] try: templ = self.getRRDTemplate(self.getRRDTemplateName()) @@ -79,8 +78,7 @@ except RRDObjectNotFound, e: log.warn(e) return (self.id, self.name(), self.osProcessClass().ignoreParameters, - self.alertOnRestart(), self.getFailSeverity(), - self.getStatus(), thresholds) + self.alertOnRestart(), self.getFailSeverity(), thresholds) def setOSProcessClass(self, procKey): |
From: <sv...@ze...> - 2007-03-06 15:18:16
|
Author: ecn Date: 2007-03-06 09:17:43 -0600 (Tue, 06 Mar 2007) New Revision: 4202 Modified: trunk/Products/ZenEvents/MySqlSendEvent.py Log: * minor nit: conn can be unset if the connect fails Modified: trunk/Products/ZenEvents/MySqlSendEvent.py =================================================================== --- trunk/Products/ZenEvents/MySqlSendEvent.py 2007-03-06 15:17:05 UTC (rev 4201) +++ trunk/Products/ZenEvents/MySqlSendEvent.py 2007-03-06 15:17:43 UTC (rev 4202) @@ -95,8 +95,8 @@ def doSendEvent(self, event): insert = "" statusdata, detaildata = self.eventDataMaps(event) + conn = self.connect() try: - conn = self.connect() curs = conn.cursor() evid = guid.generate() event.evid = evid |
From: <sv...@ze...> - 2007-03-06 15:17:10
|
Author: ecn Date: 2007-03-06 09:17:05 -0600 (Tue, 06 Mar 2007) New Revision: 4201 Modified: trunk/Products/ZenEvents/EventManagerBase.py Log: * fix unknown method self.conn() Modified: trunk/Products/ZenEvents/EventManagerBase.py =================================================================== --- trunk/Products/ZenEvents/EventManagerBase.py 2007-03-06 15:16:00 UTC (rev 4200) +++ trunk/Products/ZenEvents/EventManagerBase.py 2007-03-06 15:17:05 UTC (rev 4201) @@ -1159,7 +1159,7 @@ try: conn = self.connect() curs = conn.cursor() - self.dmd.ZenEventHistory.loadSchema(self.conn()) + self.dmd.ZenEventHistory.loadSchema(conn) finally: self.close(conn) if REQUEST: return self.callZenScreen(REQUEST) @@ -1235,7 +1235,7 @@ insert = 'INSERT INTO log (evid, userName, text) ' insert += 'VALUES ("%s", "%s", "%s")' % (evid, userId, - self.conn().escape_string(message)) + conn.escape_string(message)) curs.execute(insert) finally: self.close(conn) self.clearCache('evid' + evid) |
From: <sv...@ze...> - 2007-03-06 15:16:06
|
Author: ecn Date: 2007-03-06 09:16:00 -0600 (Tue, 06 Mar 2007) New Revision: 4200 Modified: trunk/Products/ZenRRD/SnmpDaemon.py Log: * better backwards compatibility with twistedsnmp Modified: trunk/Products/ZenRRD/SnmpDaemon.py =================================================================== --- trunk/Products/ZenRRD/SnmpDaemon.py 2007-03-06 15:12:14 UTC (rev 4199) +++ trunk/Products/ZenRRD/SnmpDaemon.py 2007-03-06 15:16:00 UTC (rev 4200) @@ -16,8 +16,12 @@ from RRDDaemon import RRDDaemon -from twistedsnmp import snmpprotocol +try: + from pynetsnmp.twistedsnmp import snmpprotocol +except: + from twistedsnmp import snmpprotocol + class SnmpDaemon(RRDDaemon): snmpCycleInterval = 5*60 # seconds heartBeatTimeout = snmpCycleInterval*3 |
From: <sv...@ze...> - 2007-03-06 15:12:19
|
Author: edahl Date: 2007-03-06 09:12:14 -0600 (Tue, 06 Mar 2007) New Revision: 4199 Modified: trunk/wmi/README Log: * changed readme to use CPPFLAGS not CFLAGS (which didn't work for me) Modified: trunk/wmi/README =================================================================== --- trunk/wmi/README 2007-03-06 14:27:53 UTC (rev 4198) +++ trunk/wmi/README 2007-03-06 15:12:14 UTC (rev 4199) @@ -19,7 +19,7 @@ Simple steps(change python path if necessary): $ cd Samba/source $ ./autogen.sh -$ CFLAGS="-I/usr/include/python2.4" ./configure +$ CPPFLAGS="-I/usr/include/python2.4" ./configure $ make proto bin/wmic bin/wmis wmi/_pywmi.so INSTALLATION |
From: <sv...@ze...> - 2007-03-06 14:28:05
|
Author: marc Date: 2007-03-06 08:27:53 -0600 (Tue, 06 Mar 2007) New Revision: 4198 Modified: trunk/Products/ZenRRD/RenderServer.py Log: * removed bad char Modified: trunk/Products/ZenRRD/RenderServer.py =================================================================== --- trunk/Products/ZenRRD/RenderServer.py 2007-03-06 14:22:03 UTC (rev 4197) +++ trunk/Products/ZenRRD/RenderServer.py 2007-03-06 14:27:53 UTC (rev 4198) @@ -120,7 +120,7 @@ except OSError: log.warn("File %s does not exist" % filename) if remoteUrl: - urllib.urlopen(remoteUrl)Å + urllib.urlopen(remoteUrl) security.declareProtected('View', 'plugin') def plugin(self, name, REQUEST=None): |
From: <sv...@ze...> - 2007-03-06 14:22:07
|
Author: marc Date: 2007-03-06 08:22:03 -0600 (Tue, 06 Mar 2007) New Revision: 4197 Modified: trunk/Products/ZenModel/PerformanceConf.py trunk/Products/ZenModel/RRDDataSource.py trunk/Products/ZenModel/RRDTemplate.py trunk/Products/ZenRRD/RenderServer.py Log: #630 * Delete RRD files when a datapoint or datasource is deleted through the UI * Deletes local and remote RRD files through RenderServer.py Modified: trunk/Products/ZenModel/PerformanceConf.py =================================================================== --- trunk/Products/ZenModel/PerformanceConf.py 2007-03-06 14:19:12 UTC (rev 4196) +++ trunk/Products/ZenModel/PerformanceConf.py 2007-03-06 14:22:03 UTC (rev 4197) @@ -364,5 +364,14 @@ dses.append(dstmpl %(ds.getName(), ds.rrdtype, ds.getName(), inst)) return "\n".join(dses) + def deleteRRDFiles(self, device, datasource=None, datapoint=None): + remoteUrl = None + if self.renderurl.startswith("http"): + if datapoint: + remoteUrl = "%s/deleteRRDFiles?device=%s&datapoint=%s" % (self.renderurl,device,datapoint) + else: + remoteUrl = "%s/deleteRRDFiles?device=%s&datasource=%s" % (self.renderurl,device,datasource) + rs = self.getDmd().getParentNode().RenderServer + rs.deleteRRDFiles(device, datasource, datapoint, remoteUrl) InitializeClass(PerformanceConf) Modified: trunk/Products/ZenModel/RRDDataSource.py =================================================================== --- trunk/Products/ZenModel/RRDDataSource.py 2007-03-06 14:19:12 UTC (rev 4196) +++ trunk/Products/ZenModel/RRDDataSource.py 2007-03-06 14:22:03 UTC (rev 4197) @@ -220,9 +220,14 @@ for id in ids: dp = getattr(self.datapoints,id,False) if dp: + + perfConf = self.getDmd().Monitors.getPerformanceMonitor('localhost') + perfConf.deleteRRDFiles(device=self.device().id, datapoint=dp.name()) + clean(self.graphs, dp.name()) clean(self.thresholds, dp.name()) self.datapoints._delObject(dp.id) + if REQUEST: return self.callZenScreen(REQUEST) Modified: trunk/Products/ZenModel/RRDTemplate.py =================================================================== --- trunk/Products/ZenModel/RRDTemplate.py 2007-03-06 14:19:12 UTC (rev 4196) +++ trunk/Products/ZenModel/RRDTemplate.py 2007-03-06 14:22:03 UTC (rev 4197) @@ -219,9 +219,14 @@ if not ids: return self.callZenScreen(REQUEST) for id in ids: if getattr(self.datasources,id,False): + + perfConf = self.getDmd().Monitors.getPerformanceMonitor('localhost') + perfConf.deleteRRDFiles(device=self.device().id, datasource=id) + self.datasources._delObject(id) clean(self.graphs, id) clean(self.thresholds, id) + if REQUEST: return self.callZenScreen(REQUEST) Modified: trunk/Products/ZenRRD/RenderServer.py =================================================================== --- trunk/Products/ZenRRD/RenderServer.py 2007-03-06 14:19:12 UTC (rev 4196) +++ trunk/Products/ZenRRD/RenderServer.py 2007-03-06 14:22:03 UTC (rev 4197) @@ -32,6 +32,9 @@ from RRDToolItem import RRDToolItem +from Products.ZenModel.PerformanceConf import performancePath +import glob + import utils log = logging.getLogger("RenderServer") @@ -98,7 +101,27 @@ graph = self.getGraph(id, ftype, REQUEST) return graph - + + def deleteRRDFiles(self, device, + datasource=None, datapoint=None, + remoteUrl=None, REQUEST=None): + if datapoint: + rrdPath = '/Devices/%s/%s.rrd' % (device, datapoint) + try: + os.remove(performancePath(rrdPath)) + except OSError: + log.warn("File %s does not exist" % performancePath(rrdPath)) + elif datasource: + rrdPath = '/Devices/%s/%s_*.rrd' % (device, datasource) + filenames = glob.glob(performancePath(rrdPath)) + for filename in filenames: + try: + os.remove(filename) + except OSError: + log.warn("File %s does not exist" % filename) + if remoteUrl: + urllib.urlopen(remoteUrl)Å + security.declareProtected('View', 'plugin') def plugin(self, name, REQUEST=None): "render a custom graph and return it" |
From: <sv...@ze...> - 2007-03-06 14:19:14
|
Author: ian Date: 2007-03-06 08:19:12 -0600 (Tue, 06 Mar 2007) New Revision: 4196 Modified: trunk/Products/ZenModel/skins/zenmodel/Dashboard.pt Log: * Fixed links on the dashboard that caused a javascript bug. Modified: trunk/Products/ZenModel/skins/zenmodel/Dashboard.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/Dashboard.pt 2007-03-06 14:15:05 UTC (rev 4195) +++ trunk/Products/ZenModel/skins/zenmodel/Dashboard.pt 2007-03-06 14:19:12 UTC (rev 4196) @@ -33,7 +33,7 @@ <thead> <tr> <th class="tabletitle" colspan="6"> - <a style="color: white" href="/zport/dmd/Systems/viewEvents/">Systems</a>-Level Event Summary</th> + <a style="color: white" href="/zport/dmd/Systems/viewEvents">Systems</a>-Level Event Summary</th> </tr> <tr> <th class="tableheader">System</th> @@ -53,7 +53,7 @@ <thead> <tr> <th class="tabletitle" colspan="4"> - <a style="color: white" href="/zport/dmd/Devices/viewEvents/">Devices</a> with Events (Severity >= Error)</th> + <a style="color: white" href="/zport/dmd/Devices/viewEvents">Devices</a> with Events (Severity >= Error)</th> </tr> <tr> <th class="tableheader">Name</th> |