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-16 13:29:55
|
Author: ecn Date: 2007-03-16 09:29:55 -0400 (Fri, 16 Mar 2007) New Revision: 4295 Modified: trunk/Products/ZenModel/Organizer.py trunk/Products/ZenModel/Report.py Log: * these classes inherit this property already Modified: trunk/Products/ZenModel/Organizer.py =================================================================== --- trunk/Products/ZenModel/Organizer.py 2007-03-16 13:29:12 UTC (rev 4294) +++ trunk/Products/ZenModel/Organizer.py 2007-03-16 13:29:55 UTC (rev 4295) @@ -37,8 +37,6 @@ {'id':'description', 'type':'string', 'mode':'w'}, ) - _relations = ZenPackable._relations - security = ClassSecurityInfo() security.declareObjectProtected("View") Modified: trunk/Products/ZenModel/Report.py =================================================================== --- trunk/Products/ZenModel/Report.py 2007-03-16 13:29:12 UTC (rev 4294) +++ trunk/Products/ZenModel/Report.py 2007-03-16 13:29:55 UTC (rev 4295) @@ -66,8 +66,6 @@ # this is deprecated don't use!!! description = "" - _relations = ZenPackable._relations - security = ClassSecurityInfo() |
From: <sv...@ze...> - 2007-03-16 13:29:10
|
Author: ecn Date: 2007-03-16 09:29:12 -0400 (Fri, 16 Mar 2007) New Revision: 4294 Modified: trunk/Products/ZenModel/ReportClass.py Log: * remove unnecessary import Modified: trunk/Products/ZenModel/ReportClass.py =================================================================== --- trunk/Products/ZenModel/ReportClass.py 2007-03-16 13:28:22 UTC (rev 4293) +++ trunk/Products/ZenModel/ReportClass.py 2007-03-16 13:29:12 UTC (rev 4294) @@ -23,7 +23,6 @@ from Organizer import Organizer from Report import Report -from ZenPackable import ZenPackable def manage_addReportClass(context, id, title = None, REQUEST = None): """make a device class""" |
From: <sv...@ze...> - 2007-03-16 13:28:26
|
Author: ecn Date: 2007-03-16 09:28:22 -0400 (Fri, 16 Mar 2007) New Revision: 4293 Modified: trunk/Products/ZenModel/migrate/packs.py Log: * make this run lots faster and avoid problems with abandoned objects (PerformanceReport, for example) Modified: trunk/Products/ZenModel/migrate/packs.py =================================================================== --- trunk/Products/ZenModel/migrate/packs.py 2007-03-16 13:07:28 UTC (rev 4292) +++ trunk/Products/ZenModel/migrate/packs.py 2007-03-16 13:28:22 UTC (rev 4293) @@ -13,18 +13,24 @@ import Migrate log = Migrate.log +from Products.ZenModel.ZenPackable import ZenPackable + class Packs(Migrate.Step): version = Migrate.Version(1, 2, 0) def cutover(self, dmd): def recurse(obj): - log.debug(obj.getPrimaryUrlPath()) try: - obj.buildRelations() - except AttributeError: - pass - for child in obj.objectValues(): - recurse(child) + path = obj.getPrimaryUrlPath() + if obj.getPrimaryUrlPath() not in ('/zport/dmd/Devices', + '/zport/dmd/Networks'): + log.debug(path) + if isinstance(obj, ZenPackable): + obj.buildRelations() + for child in obj.objectValues(): + recurse(child) + except Exception, ex: + log.debug("Exception building relations: %s", ex) recurse(dmd) Packs() |
From: <sv...@ze...> - 2007-03-16 13:07:33
|
Author: ian Date: 2007-03-16 09:07:28 -0400 (Fri, 16 Mar 2007) New Revision: 4292 Modified: trunk/Products/ZenModel/ZenMenuItem.py Log: * Add a flag to designate if a menu item points to a dialog Modified: trunk/Products/ZenModel/ZenMenuItem.py =================================================================== --- trunk/Products/ZenModel/ZenMenuItem.py 2007-03-16 12:36:01 UTC (rev 4291) +++ trunk/Products/ZenModel/ZenMenuItem.py 2007-03-16 13:07:28 UTC (rev 4292) @@ -22,6 +22,7 @@ action = "" permissions = (Permissions.view,) isglobal = True + isdialog = False banned_classes = () allowed_classes = () @@ -32,6 +33,7 @@ {'id':'permissions', 'type':'lines', 'mode':'w'}, {'id':'banned_classes','type':'lines','mode':'w'}, {'id':'allowed_classes','type':'lines','mode':'w'}, + {'id':'isdialog', 'type':'boolean','mode':'w'}, ) _relations = ( |
From: <sv...@ze...> - 2007-03-16 12:36:02
|
Author: ian Date: 2007-03-16 08:36:01 -0400 (Fri, 16 Mar 2007) New Revision: 4291 Modified: trunk/Products/ZenModel/ServiceOrganizer.py trunk/Products/ZenModel/migrate/menus.py trunk/Products/ZenModel/skins/zenmodel/deviceList.pt trunk/Products/ZenModel/skins/zenmodel/deviceListMacro.pt trunk/Products/ZenModel/skins/zenmodel/deviceStatus.pt trunk/Products/ZenModel/skins/zenmodel/mibOrganizerOverview.pt trunk/Products/ZenModel/skins/zenmodel/osProcessOrganizerOverview.pt trunk/Products/ZenModel/skins/zenmodel/perfConfig.pt trunk/Products/ZenModel/skins/zenmodel/serviceOrganizerOverview.pt trunk/Products/ZenModel/skins/zenmodel/userCommandsMacros.pt trunk/Products/ZenModel/skins/zenmodel/viewDeviceReport.pt trunk/Products/ZenModel/skins/zenmodel/viewManufacturers.pt trunk/Products/ZenModel/skins/zenmodel/viewReportClass.pt trunk/Products/ZenWidgets/skins/zentablemanager/zenTableNavigation.pt trunk/Products/ZenWidgets/skins/zenui/zenuimacros.pt Log: * Moved all filter controls up into the table headers. Modified: trunk/Products/ZenModel/ServiceOrganizer.py =================================================================== --- trunk/Products/ZenModel/ServiceOrganizer.py 2007-03-16 12:13:23 UTC (rev 4290) +++ trunk/Products/ZenModel/ServiceOrganizer.py 2007-03-16 12:36:01 UTC (rev 4291) @@ -14,6 +14,7 @@ from AccessControl import Permissions from Acquisition import aq_base from Commandable import Commandable +from ZenMenuable import ZenMenuable from Products.ZenRelations.RelSchema import * Modified: trunk/Products/ZenModel/migrate/menus.py =================================================================== --- trunk/Products/ZenModel/migrate/menus.py 2007-03-16 12:13:23 UTC (rev 4290) +++ trunk/Products/ZenModel/migrate/menus.py 2007-03-16 12:36:01 UTC (rev 4291) @@ -59,14 +59,13 @@ ), dict( id= 'viewHistory', - description='Changes', + description='View Changes', action= 'viewHistory', permissions=('View',) ) ] }) - dmd.Devices.buildMenus( {'Context':[ dict( @@ -109,8 +108,46 @@ action= 'zPropertyEdit', permissions=('Change Device',) ), + dict( + id= 'unlock', + description='Unlock', + action= 'unlock', + permissions=('Change Device',), + allowed_classes=('Device','DeviceComponent') + ), + dict( + id= 'lockFromDeletion', + description='Lock from deletion', + action= 'lockFromDeletion', + permissions=('Change Device',), + allowed_classes=('Device','DeviceComponent') + ), + dict( + id= 'lockFromUpdate', + description='Lock from update/deletion', + action= 'lockFromUpdate', + permissions=('Change Device',), + allowed_classes=('Device','DeviceComponent') + ), + dict( + id= 'setSendEventWhenBlockedFlag', + description='Send event when blocked', + action= 'setSendEventWhenBlockedFlag', + permissions=('Change Device',), + allowed_classes=('Device','DeviceComponent') + ), + dict( + id= 'unsetSendEventWhenBlockedFlag', + description='Do not send event when blocked', + action= 'unsetSendEventWhenBlockedFlag', + permissions=('Change Device',), + allowed_classes=('Device','DeviceComponent') + ), ], - 'Device':[ + 'Device_org_list':[ + + ], + 'Device_list':[ dict( id= 'moveclass', description='Move to Class...', @@ -148,45 +185,6 @@ permissions=('View',) ), ], - 'Lockable':[ - dict( - id= 'unlock', - description='Unlock', - action= 'unlock', - permissions=('Change Device',), - allowed_classes=('Device','DeviceComponent') - ), - dict( - id= 'lockFromDeletion', - description='Lock from deletion', - action= 'lockFromDeletion', - permissions=('Change Device',), - allowed_classes=('Device','DeviceComponent') - ), - dict( - id= 'lockFromUpdate', - description='Lock from update/deletion', - action= 'lockFromUpdate', - permissions=('Change Device',), - allowed_classes=('Device','DeviceComponent') - ), - ], - 'LockWarning':[ - dict( - id= 'setSendEventWhenBlockedFlag', - description='Send event when blocked', - action= 'setSendEventWhenBlockedFlag', - permissions=('Change Device',), - allowed_classes=('Device','DeviceComponent') - ), - dict( - id= 'unsetSendEventWhenBlockedFlag', - description='Do not send event when blocked', - action= 'unsetSendEventWhenBlockedFlag', - permissions=('Change Device',), - allowed_classes=('Device','DeviceComponent') - ), - ] }) Modified: trunk/Products/ZenModel/skins/zenmodel/deviceList.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/deviceList.pt 2007-03-16 12:13:23 UTC (rev 4290) +++ trunk/Products/ZenModel/skins/zenmodel/deviceList.pt 2007-03-16 12:36:01 UTC (rev 4291) @@ -14,7 +14,7 @@ <input type="hidden" name="tableName" tal:attributes="value tableName"/> <tal:block tal:define="tabletitle string:Device List; showfilterbox python:True; - menu_id string:Device"> + menu_id string:Device_list"> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> <tal:block metal:fill-slot="zentablecontents"> @@ -27,9 +27,6 @@ metal:use-macro="here/zenTableNavigation/macros/navbodypagedevice"/> </td> </tr> - <tal:block tal:define="numColumns string:5"> - <tal:block metal:use-macro="here/deviceListMacro/macros/deviceControl"/> - </tal:block> <!-- END TABLE CONTENTS --> Modified: trunk/Products/ZenModel/skins/zenmodel/deviceListMacro.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/deviceListMacro.pt 2007-03-16 12:13:23 UTC (rev 4290) +++ trunk/Products/ZenModel/skins/zenmodel/deviceListMacro.pt 2007-03-16 12:36:01 UTC (rev 4291) @@ -37,9 +37,12 @@ src="/zport/portal_skins/zenmodel/submitViaEnter.js"></script> - <tal:block tal:define="objects here/devices/objectValuesAll; + <tal:block tal:define="objects python:list(here.devices.objectValuesAll()); tableName string:devicelistmacro; - batch python:here.ZenTableManager.getBatch(tableName,objects); tabletitle string:Devices"> + showfilterbox python:True; + menu_id string:device_list; + batch python:here.ZenTableManager.getBatch(tableName,objects); + tabletitle string:Devices"> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> <!--====Optional titlebar slots============= Modified: trunk/Products/ZenModel/skins/zenmodel/deviceStatus.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/deviceStatus.pt 2007-03-16 12:13:23 UTC (rev 4290) +++ trunk/Products/ZenModel/skins/zenmodel/deviceStatus.pt 2007-03-16 12:36:01 UTC (rev 4291) @@ -12,16 +12,6 @@ <!-- BEGIN TABLE CONTENTS --> <tr> - <td tal:define="tabletitle python:here.lockStatus(); - menu_id string:Lockable"> - <tal:block metal:use-macro="here/zenuimacros/macros/tabletitle"/> - </td> - <td tal:define="tabletitle python:here.lockWarning(); - menu_id string:LockWarning"> - <tal:block metal:use-macro="here/zenuimacros/macros/tabletitle"/> - </td> - </tr> - <tr> <td class="tableheader">Events</td> <td class="tablevalues rainbow"> <table width='100%' Modified: trunk/Products/ZenModel/skins/zenmodel/mibOrganizerOverview.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/mibOrganizerOverview.pt 2007-03-16 12:13:23 UTC (rev 4290) +++ trunk/Products/ZenModel/skins/zenmodel/mibOrganizerOverview.pt 2007-03-16 12:36:01 UTC (rev 4291) @@ -4,6 +4,7 @@ <form method="post" tal:attributes="action here/absolute_url_path"> <tal:block tal:define="objects here/children; tableName string:children; + showfilterbox python:True; tabletitle string:Sub-Folders; batch python:here.ZenTableManager.getBatch(tableName,objects);"> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> @@ -93,8 +94,10 @@ <form method="post" tal:attributes="action here/absolute_url_path"> <tal:block tal:define="objects here/mibs; tableName string:mibslist; + showfilterbox python:True; tabletitle string:Mibs; - batch python:here.ZenTableManager.getBatch(tableName,objects);"> + batch python:here.ZenTableManager.getBatch(tableName,objects);" + tal:condition="objects"> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> <!--==================== Modified: trunk/Products/ZenModel/skins/zenmodel/osProcessOrganizerOverview.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/osProcessOrganizerOverview.pt 2007-03-16 12:13:23 UTC (rev 4290) +++ trunk/Products/ZenModel/skins/zenmodel/osProcessOrganizerOverview.pt 2007-03-16 12:36:01 UTC (rev 4291) @@ -6,6 +6,7 @@ <tal:block tal:define="objects here/children; tableName string:children; + showfilterbox python:True; tabletitle string:Sub-Folders; batch python:here.ZenTableManager.getBatch(tableName,objects);"> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> @@ -80,6 +81,7 @@ <tal:block tal:define="objects here/osProcessClasses; tableName string:osprocessclasseslist; + showfilterbox python:True; tabletitle string:Processes; batch python:here.ZenTableManager.getBatch(tableName,objects);"> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> Modified: trunk/Products/ZenModel/skins/zenmodel/perfConfig.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/perfConfig.pt 2007-03-16 12:13:23 UTC (rev 4290) +++ trunk/Products/ZenModel/skins/zenmodel/perfConfig.pt 2007-03-16 12:36:01 UTC (rev 4291) @@ -7,6 +7,7 @@ tal:define=" tableName string:rrdtemplatelist; objects here/getRRDTemplates; + showfilterbox python:True; batch python:here.ZenTableManager.getBatch(tableName,objects); tabletitle string:Performance Templates; "> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> Modified: trunk/Products/ZenModel/skins/zenmodel/serviceOrganizerOverview.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/serviceOrganizerOverview.pt 2007-03-16 12:13:23 UTC (rev 4290) +++ trunk/Products/ZenModel/skins/zenmodel/serviceOrganizerOverview.pt 2007-03-16 12:36:01 UTC (rev 4291) @@ -5,6 +5,7 @@ <tal:block tal:define="objects here/children; tableName string:children; + showfilterbox python:True; tabletitle string:Sub-Folders; batch python:here.ZenTableManager.getBatch(tableName,objects);"> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> @@ -84,6 +85,7 @@ <tal:block tal:define="objects here/serviceclasses; tableName string:serviceclasseslist; + showfilterbox python:True; tabletitle string:Services; batch python:here.ZenTableManager.getBatch(tableName,objects);"> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> Modified: trunk/Products/ZenModel/skins/zenmodel/userCommandsMacros.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/userCommandsMacros.pt 2007-03-16 12:13:23 UTC (rev 4290) +++ trunk/Products/ZenModel/skins/zenmodel/userCommandsMacros.pt 2007-03-16 12:36:01 UTC (rev 4291) @@ -4,6 +4,7 @@ metal:define-macro="userCommandsTable" tal:define="objects here/userCommands/objectValuesAll; editable here/isManager; + showfilterbox python:True; tableName string:userCommands; batch python:here.ZenTableManager.getBatch(tableName,objects);"> <input type="hidden" name="zenScreenName" tal:attributes="value template/id"/> Modified: trunk/Products/ZenModel/skins/zenmodel/viewDeviceReport.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/viewDeviceReport.pt 2007-03-16 12:13:23 UTC (rev 4290) +++ trunk/Products/ZenModel/skins/zenmodel/viewDeviceReport.pt 2007-03-16 12:36:01 UTC (rev 4291) @@ -20,7 +20,8 @@ tableName, objects, sortedHeader=here.sortedHeader, sortedSence=here.sortedSence); - tabletitle string:Device Report"> + showfilterbox python:True; + tabletitle string:Device Report"> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> <!--====Optional titlebar slots============= Modified: trunk/Products/ZenModel/skins/zenmodel/viewManufacturers.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/viewManufacturers.pt 2007-03-16 12:13:23 UTC (rev 4290) +++ trunk/Products/ZenModel/skins/zenmodel/viewManufacturers.pt 2007-03-16 12:36:01 UTC (rev 4291) @@ -4,6 +4,7 @@ <tal:block tal:define=" tableName string:manufacturers; objects python:here.objectValues(spec='Manufacturer'); + showfilterbox python:True; tabletitle string:Manufacturers; batch python:here.ZenTableManager.getBatch(tableName,objects);"> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> Modified: trunk/Products/ZenModel/skins/zenmodel/viewReportClass.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/viewReportClass.pt 2007-03-16 12:13:23 UTC (rev 4290) +++ trunk/Products/ZenModel/skins/zenmodel/viewReportClass.pt 2007-03-16 12:36:01 UTC (rev 4291) @@ -7,8 +7,10 @@ <tal:block tal:define="tableName string:reportorgs; objects here/children; + showfilterbox python:True; batch python:here.ZenTableManager.getBatch(tableName,objects); - tabletitle string:Report Organizers"> + tabletitle string:Report Organizers" + tal:condition="objects"> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> <!--====Optional titlebar slots============= @@ -72,7 +74,10 @@ <tal:block tal:define="tableName string:reportlist; objects here/reports; - batch python:here.ZenTableManager.getBatch(tableName,objects); tabletitle string:Reports"> + showfilterbox python:True; + batch python:here.ZenTableManager.getBatch(tableName,objects); + tabletitle string:Reports" + tal:condition="objects"> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> <!--====Optional titlebar slots============= Modified: trunk/Products/ZenWidgets/skins/zentablemanager/zenTableNavigation.pt =================================================================== --- trunk/Products/ZenWidgets/skins/zentablemanager/zenTableNavigation.pt 2007-03-16 12:13:23 UTC (rev 4290) +++ trunk/Products/ZenWidgets/skins/zentablemanager/zenTableNavigation.pt 2007-03-16 12:36:01 UTC (rev 4291) @@ -59,11 +59,12 @@ tal:attributes="checked ts/onlyMonitored" /> </tal:block> + <!-- Filter <input class="tableheader" type="text" name="filter" size=15 value="" onkeypress="submitViaEnter(event)" tal:attributes="value ts/filter" /> - + --> Page Size <input class="tableheader" type="text" name="batchSize" size=3 value="" onkeypress="submitViaEnter(event)" @@ -150,11 +151,12 @@ tal:define="ts python:here.ZenTableManager.getTableState(tableName); message request/SESSION/message | nothing;" style="border:0; padding-top:2px;margin-bottom:2px;"> + <!-- Filter boxes moved up into table header <div style="padding-left: 10px; float: left; text-align:left;"> Filter <input class="tableheader" type="text" name="filter" size=40 value="" onkeypress="submitViaEnter(event)" - tal:attributes="value ts/filter" /> + tal:attributes="value ts/filter" />--> <span style="height:1em;line-height:1em;padding-left:2em; color:red;font-weight:bold;" tal:content="message" Modified: trunk/Products/ZenWidgets/skins/zenui/zenuimacros.pt =================================================================== --- trunk/Products/ZenWidgets/skins/zenui/zenuimacros.pt 2007-03-16 12:13:23 UTC (rev 4290) +++ trunk/Products/ZenWidgets/skins/zenui/zenuimacros.pt 2007-03-16 12:36:01 UTC (rev 4291) @@ -165,7 +165,7 @@ Zentable macro ====================================--> <tal:block metal:define-macro="zentable"> - <table class="zentable"> + <table class=" zentable"> <tr tal:define="tabletitle tabletitle|string:"> <tal:block metal:use-macro="here/zenuimacros/macros/tabletitle"> <tal:block metal:fill-slot="filterslot"> |
From: <sv...@ze...> - 2007-03-16 12:13:24
|
Author: ian Date: 2007-03-16 08:13:23 -0400 (Fri, 16 Mar 2007) New Revision: 4290 Modified: trunk/Products/ZenModel/skins/zenmodel/zenoss.css Log: * Fixed a typo. Modified: trunk/Products/ZenModel/skins/zenmodel/zenoss.css =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/zenoss.css 2007-03-16 11:22:24 UTC (rev 4289) +++ trunk/Products/ZenModel/skins/zenmodel/zenoss.css 2007-03-16 12:13:23 UTC (rev 4290) @@ -120,7 +120,7 @@ position: absolute; top: 0px; right: 0px; - z-index: 3000px; + z-index: 3000; padding: 0pt; } |
From: <sv...@ze...> - 2007-03-16 11:22:50
|
Author: ecn Date: 2007-03-16 07:22:24 -0400 (Fri, 16 Mar 2007) New Revision: 4289 Modified: trunk/Products/ZenModel/migrate/packs.py Log: * turn on pack relations Modified: trunk/Products/ZenModel/migrate/packs.py =================================================================== --- trunk/Products/ZenModel/migrate/packs.py 2007-03-15 23:40:50 UTC (rev 4288) +++ trunk/Products/ZenModel/migrate/packs.py 2007-03-16 11:22:24 UTC (rev 4289) @@ -25,6 +25,6 @@ pass for child in obj.objectValues(): recurse(child) - # recurse(dmd) + recurse(dmd) Packs() |
From: <sv...@ze...> - 2007-03-15 23:41:17
|
Author: ahajda Date: 2007-03-15 19:40:50 -0400 (Thu, 15 Mar 2007) New Revision: 4288 Modified: trunk/wmi/README trunk/wmi/Samba/source/librpc/ndr/ndr_dcom.c trunk/wmi/Samba/source/pidl/lib/Parse/Pidl/Samba4/COM/Proxy.pm trunk/wmi/Samba/source/wmi/pywmi.i trunk/wmi/Samba/source/wmi/wbemdata.c Log: Removed memory leaks. Corrected pidl in handling output parameters. Modified: trunk/wmi/README =================================================================== --- trunk/wmi/README 2007-03-15 15:28:02 UTC (rev 4287) +++ trunk/wmi/README 2007-03-15 23:40:50 UTC (rev 4288) @@ -14,14 +14,14 @@ COMPILATION -For details follow Samba documentation from Samba/howto.txt. - Simple steps(change python path if necessary): $ cd Samba/source $ ./autogen.sh $ CPPFLAGS="-I/usr/include/python2.4" ./configure $ make proto bin/wmic bin/wmis wmi/_pywmi.so +For details check Samba documentation in Samba/howto.txt. + INSTALLATION Currently there is no install procedure. Generated binaries are located Modified: trunk/wmi/Samba/source/librpc/ndr/ndr_dcom.c =================================================================== --- trunk/wmi/Samba/source/librpc/ndr/ndr_dcom.c 2007-03-15 15:28:02 UTC (rev 4287) +++ trunk/wmi/Samba/source/librpc/ndr/ndr_dcom.c 2007-03-15 23:40:50 UTC (rev 4288) @@ -566,6 +566,9 @@ NTSTATUS ndr_pull_WbemClassObject(struct ndr_pull *ndr, int ndr_flags, struct WbemClassObject *r) { + TALLOC_CTX *tc; + + tc = NDR_PULL_GET_MEM_CTX(ndr); ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->flags)); if (r->flags & WCF_CLASS) { @@ -574,22 +577,31 @@ } if (r->flags & WCF_DECORATIONS) { r->sup_class = talloc_zero(r, struct WbemClass); + NDR_PULL_SET_MEM_CTX(ndr, r->sup_class, 0); NDR_CHECK(ndr_pull_DataWithStack(ndr, (ndr_pull_flags_fn_t)ndr_pull_WbemClass, r->sup_class)); r->sup_methods = talloc_zero(r, struct WbemMethods); + NDR_PULL_SET_MEM_CTX(ndr, r->sup_methods, 0); NDR_CHECK(ndr_pull_DataWithStack(ndr, (ndr_pull_flags_fn_t)ndr_pull_WbemMethods, r->sup_methods)); + NDR_PULL_SET_MEM_CTX(ndr, tc, 0); } else r->sup_class = NULL; if (r->flags & (WCF_CLASS | WCF_INSTANCE)) { r->obj_class = talloc_zero(r, struct WbemClass); + NDR_PULL_SET_MEM_CTX(ndr, r->obj_class, 0); NDR_CHECK(ndr_pull_DataWithStack(ndr, (ndr_pull_flags_fn_t)ndr_pull_WbemClass, r->obj_class)); + NDR_PULL_SET_MEM_CTX(ndr, tc, 0); } if (r->flags & WCF_DECORATIONS) { r->obj_methods = talloc_zero(r, struct WbemMethods); + NDR_PULL_SET_MEM_CTX(ndr, r->obj_methods, 0); NDR_CHECK(ndr_pull_DataWithStack(ndr, (ndr_pull_flags_fn_t)ndr_pull_WbemMethods, r->obj_methods)); + NDR_PULL_SET_MEM_CTX(ndr, tc, 0); } if (r->flags & WCF_INSTANCE) { r->instance = talloc_zero(r, struct WbemInstance); + NDR_PULL_SET_MEM_CTX(ndr, r->instance, 0); NDR_CHECK(ndr_pull_DataWithStack(ndr, (ndr_pull_flags_fn_t)ndr_pull_WbemInstance_priv, r)); + NDR_PULL_SET_MEM_CTX(ndr, tc, 0); } else r->instance = NULL; return NT_STATUS_OK; @@ -597,6 +609,8 @@ NTSTATUS ndr_pull_WbemClassObject_Object(struct ndr_pull *ndr, int ndr_flags, struct WbemClassObject *r) { + TALLOC_CTX *tc; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->flags)); if (r->flags & WCF_CLASS) { @@ -605,7 +619,9 @@ } if (r->flags & WCF_INSTANCE) { r->instance = talloc_zero(r, struct WbemInstance); + NDR_PULL_SET_MEM_CTX(ndr, r->instance, 0); NDR_CHECK(ndr_pull_DataWithStack(ndr, (ndr_pull_flags_fn_t)ndr_pull_WbemInstance_priv, r)); + NDR_PULL_SET_MEM_CTX(ndr, tc, 0); } else r->instance = NULL; return NT_STATUS_OK; @@ -781,10 +797,14 @@ } if (ndr_flags & NDR_BUFFERS) { if (r->__CLASS) { + TALLOC_CTX *_mem_save___CLASS_0; struct ndr_pull_save _relative_save; ndr_pull_save(ndr, &_relative_save); NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->__CLASS)); + _mem_save___CLASS_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->__CLASS, 0); NDR_CHECK(ndr_pull_CIMSTRING(ndr, NDR_SCALARS, &r->__CLASS)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save___CLASS_0, 0); ndr_pull_restore(ndr, &_relative_save); } NDR_CHECK(ndr_pull_CIMSTRINGS(ndr, NDR_BUFFERS, &r->__DERIVATION)); Modified: trunk/wmi/Samba/source/pidl/lib/Parse/Pidl/Samba4/COM/Proxy.pm =================================================================== --- trunk/wmi/Samba/source/pidl/lib/Parse/Pidl/Samba4/COM/Proxy.pm 2007-03-15 15:28:02 UTC (rev 4287) +++ trunk/wmi/Samba/source/pidl/lib/Parse/Pidl/Samba4/COM/Proxy.pm 2007-03-15 23:40:50 UTC (rev 4288) @@ -287,7 +287,7 @@ "; foreach $a (@{$fn->{ELEMENTS}}) { next unless (has_property($a, "out")); - $res.="\t*$a->{NAME} = out->$a->{NAME};\n"; + $res.="\t if ($a->{NAME}) *$a->{NAME} = out->$a->{NAME};\n"; } if ($fn->{RETURN_TYPE} ne "void") { $res.="\tresult = out->result;\n"; Modified: trunk/wmi/Samba/source/wmi/pywmi.i =================================================================== --- trunk/wmi/Samba/source/wmi/pywmi.i 2007-03-15 15:28:02 UTC (rev 4287) +++ trunk/wmi/Samba/source/wmi/pywmi.i 2007-03-15 23:40:50 UTC (rev 4288) @@ -267,9 +267,17 @@ WERROR IEnumWbemClassObject_Reset(struct IEnumWbemClassObject *d, TALLOC_CTX *mem_ctx); -%typemap(in, numinputs=0) (struct WbemClassObject **apObjects, uint32_t *puReturned) (uint32_t uReturned) { - $1 = talloc_array(NULL, struct WbemClassObject *, 10); /* FIXME:high 10 should be uCount */ - $2 = &uReturned; +%typemap(in, numinputs=1) (uint32_t uCount, struct WbemClassObject **apObjects, uint32_t *puReturned) (uint32_t uReturned) { + if (PyLong_Check($input)) + $1 = PyLong_AsUnsignedLong($input); + else if (PyInt_Check($input)) + $1 = PyInt_AsLong($input); + else { + PyErr_SetString(PyExc_TypeError,"Expected a long or an int"); + return NULL; + } + $2 = talloc_array(NULL, struct WbemClassObject *, $1); + $3 = &uReturned; } %typemap(argout) (struct WbemClassObject **apObjects, uint32_t *puReturned) { @@ -294,12 +302,19 @@ if (error) return NULL; } +%typemap(out) WERROR { + if (!W_ERROR_IS_OK($1)) { + PyErr_SetFromWERROR($1); + talloc_free(arg5); // FIXME:avg make it properly(how???) + return NULL; + } +} + WERROR IEnumWbemClassObject_SmartNext(struct IEnumWbemClassObject *d, TALLOC_CTX *mem_ctx, int32_t lTimeout, uint32_t uCount, struct WbemClassObject **apObjects, uint32_t *puReturned); %init %{ -// SambaError = PyErr_NewException("_pywmi.SambaError", PyExc_OSError, NULL); mod_win32_client = PyImport_ImportModule("win32com.client"); mod_pywintypes = PyImport_ImportModule("pywintypes"); ComError = PyObject_GetAttrString(mod_pywintypes, "com_error"); @@ -327,4 +342,4 @@ pModule = PyImport_ImportModule( "win32com.client" ); } -%} \ No newline at end of file +%} Modified: trunk/wmi/Samba/source/wmi/wbemdata.c =================================================================== --- trunk/wmi/Samba/source/wmi/wbemdata.c 2007-03-15 15:28:02 UTC (rev 4287) +++ trunk/wmi/Samba/source/wmi/wbemdata.c 2007-03-15 23:40:50 UTC (rev 4288) @@ -118,11 +118,12 @@ if (!u) { talloc_free(*pv); *pv = NULL; - return NT_STATUS_OK; + status = NT_STATUS_OK; + goto error; } NTERR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &u)); if (u + 8 > ndr->data_size) { - DEBUG(0, ("unmarshall_IWbemClassObject: Incorrect data_size")); + DEBUG(1, ("unmarshall_IWbemClassObject: Incorrect data_size")); return NT_STATUS_BUFFER_TOO_SMALL; } wco = talloc_zero(*pv, struct WbemClassObject); @@ -237,7 +238,7 @@ dst->count = src->count; for (i = 0; i < src->count; ++i) { dst->item[i] = talloc_zero(mem_ctx, struct WbemQualifier); - duplicate_WbemQualifier(mem_ctx, src->item[i], dst->item[i]); + duplicate_WbemQualifier(dst->item[i], src->item[i], dst->item[i]); } } @@ -375,7 +376,8 @@ dst->v_string = talloc_strdup(mem_ctx, src->v_string); break; case CIM_OBJECT: - duplicate_WbemClassObject(mem_ctx, src->v_object, dst->v_object); + dst->v_object = talloc_zero(mem_ctx, struct WbemClassObject); + duplicate_WbemClassObject(dst->v_object, src->v_object, dst->v_object); break; case CIM_ARR_SINT8: case CIM_ARR_UINT8: @@ -548,14 +550,18 @@ switch (datatype) { case DATATYPE_CLASSOBJECT: apObjects[i] = talloc_zero(d->ctx, struct WbemClassObject); + ndr->current_mem_ctx = apObjects[i]; NDR_CHECK(ndr_pull_WbemClassObject(ndr, NDR_SCALARS|NDR_BUFFERS, apObjects[i])); + ndr->current_mem_ctx = d->ctx; add_pair_guid_ptr(ecod, &ecod->cache, &guid, apObjects[i]->obj_class); break; case DATATYPE_OBJECT: apObjects[i] = talloc_zero(d->ctx, struct WbemClassObject); apObjects[i]->obj_class = get_ptr_by_guid(ecod->cache, &guid); (void)talloc_reference(apObjects[i], apObjects[i]->obj_class); + ndr->current_mem_ctx = apObjects[i]; NDR_CHECK(ndr_pull_WbemClassObject_Object(ndr, NDR_SCALARS|NDR_BUFFERS, apObjects[i])); + ndr->current_mem_ctx = d->ctx; break; default: DEBUG(0, ("WBEMDATA_Parse: Data type %d not supported\n", datatype)); |
From: <sv...@ze...> - 2007-03-15 15:28:07
|
Author: marc Date: 2007-03-15 11:28:02 -0400 (Thu, 15 Mar 2007) New Revision: 4287 Modified: trunk/Products/ZenRRD/RenderServer.py Log: #827 * updated urls Modified: trunk/Products/ZenRRD/RenderServer.py =================================================================== --- trunk/Products/ZenRRD/RenderServer.py 2007-03-15 12:28:08 UTC (rev 4286) +++ trunk/Products/ZenRRD/RenderServer.py 2007-03-15 15:28:02 UTC (rev 4287) @@ -139,9 +139,9 @@ tar.extract(file, destdir) tar.close() - def moveRRDFiles(self, device, user, passwd, server, REQUEST=None): + def moveRRDFiles(self, device, server, REQUEST=None): tarfilename = '%s/%s.tgz' % (self.tmpdir, device) - f=open(tarfilename) + f=open(tarfilename, 'rb') tarfilebody=f.read() f.close() # urlencode the id, title and file @@ -149,19 +149,22 @@ 'title':tarfilename, 'file':tarfilebody}) # send the file to zope - remoteUrl = '%s:%s@%s/zport/RenderServer/receiveRRDFiles' % (user, passwd, server) + port = 8080 + remoteUrl = 'http://%s:%s/zport/RenderServer/receiveRRDFiles' % (server, port) f=urllib.urlopen(remoteUrl, params) def receiveRRDFiles(self, id, title, file, REQUEST=None): - tarfilename = '%s/%s' % (self.tmpdir, id) - f=open(tarfilename, 'w') + #tarfilename = '%s/%s' % (self.tmpdir, id) + tarfilename='/tmp/renderserver/test.tgz' + f=open(tarfilename, 'wb') f.write(file) f.close() - def sendRRDFiles(self, device, user, passwd, server, REQUEST=None): + def sendRRDFiles(self, device, server, REQUEST=None): self.packageRRDFiles(device, REQUEST) - self.moveRRDFiles(device, user, passwd, server, REQUEST) - remoteUrl = '%s:%s@%s/zport/RenderServer/unpackageRRDFiles?device=%s' % (user, passwd, server, device) + self.moveRRDFiles(device, server, REQUEST) + port = 8080 + remoteUrl = 'http://%s:%s/zport/RenderServer/unpackageRRDFiles?device=%s' % (server, port, device) urllib.urlopen(remoteUrl).read() security.declareProtected('View', 'plugin') |
From: <sv...@ze...> - 2007-03-15 12:28:11
|
Author: ian Date: 2007-03-15 08:28:08 -0400 (Thu, 15 Mar 2007) New Revision: 4286 Modified: trunk/Products/ZenModel/DeviceComponent.py Log: * Removed stray character Modified: trunk/Products/ZenModel/DeviceComponent.py =================================================================== --- trunk/Products/ZenModel/DeviceComponent.py 2007-03-14 21:02:50 UTC (rev 4285) +++ trunk/Products/ZenModel/DeviceComponent.py 2007-03-15 12:28:08 UTC (rev 4286) @@ -1,4 +1,4 @@ -g################################################################# +################################################################# # # Copyright (c) 2002 Zenoss, Inc. All rights reserved. # |
From: <sv...@ze...> - 2007-03-14 21:03:04
|
Author: ecn Date: 2007-03-14 17:02:50 -0400 (Wed, 14 Mar 2007) New Revision: 4285 Modified: trunk/Products/ZenModel/Device.py trunk/Products/ZenModel/DeviceClass.py trunk/Products/ZenModel/DeviceComponent.py trunk/Products/ZenModel/Lockable.py trunk/Products/ZenModel/OSProcess.py trunk/Products/ZenModel/RRDView.py trunk/Products/ZenModel/skins/zenmodel/objRRDTemplate.pt Log: #1057 fixed: use the new zDeviceTemplate property * change all calls to getRRDTemplate() -> getRRDTemplates() * change all calls to getRRDTemplate(name) -> getRRDTemplateByName(name) * implement getRRDTemplates() to use getRRDTemplateName() and return a list of one by default * reimplement getRRDTemplates() in Device to return a possibly longer list * update objRRDTemplate to show all the templates (in a yucky way) Modified: trunk/Products/ZenModel/Device.py =================================================================== --- trunk/Products/ZenModel/Device.py 2007-03-14 20:09:17 UTC (rev 4284) +++ trunk/Products/ZenModel/Device.py 2007-03-14 21:02:50 UTC (rev 4285) @@ -335,6 +335,24 @@ self._lastChange = ZenDate('1968/1/8') + + def getRRDTemplate(self): + import warnings + warnings.warn('Device.getRRDTemplate is deprecated', + DeprecationWarning) + return ManagedEntity.getRRDTemplate(self) + + def getRRDTemplates(self): + if not self.zDeviceTemplates: + return ManagedEntity.getRRDTemplates() + result = [] + for name in self.zDeviceTemplates: + template = self.getRRDTemplateByName(name) + if template: + result.append(template) + return result + + def getRRDNames(self): return ['sysUpTime'] @@ -473,16 +491,6 @@ return (self.id, self.getXmlRpcStatus(), targets) - def getRRDTemplate(self, name=None): - """Return the closest RRDTemplate named name by walking our aq chain. - """ - if not name: name = self.getRRDTemplateName() - templ = getattr(self, name, None) - if templ is None: - templ = super(Device, self).getRRDTemplate(name) - return templ - - def getHWManufacturerName(self): """Return the hardware manufacturer name of this device. """ Modified: trunk/Products/ZenModel/DeviceClass.py =================================================================== --- trunk/Products/ZenModel/DeviceClass.py 2007-03-14 20:09:17 UTC (rev 4284) +++ trunk/Products/ZenModel/DeviceClass.py 2007-03-14 21:02:50 UTC (rev 4285) @@ -117,27 +117,6 @@ , 'action' : 'viewHistoryEvents' , 'permissions' : ( permissions.view, ) }, - #{ 'id' : 'perfConfig' - #, 'name' : 'PerfConf' - #, 'action' : 'perfConfig' - #, 'permissions' : ("Change Device",) - #}, - #{ 'id' : 'config' - #, 'name' : 'zProperties' - #, 'action' : 'zPropertyEdit' - #, 'permissions' : ("Change Device",) - #}, - #{ 'id' : 'manage' - #, 'name' : 'Manage' - #, 'action' : 'deviceOrganizerManage' - #, 'permissions' : ( - # permissions.view, ) - #}, - #{ 'id' : 'viewHistory' - #, 'name' : 'Changes' - #, 'action' : 'viewHistory' - #, 'permissions' : ( permissions.view, ) - #}, ) }, ) @@ -145,20 +124,6 @@ security = ClassSecurityInfo() - security.declareProtected('View', 'zentinelTabs') - def zentinelTabs(self, templateName): - """Return a list of hashs that define the screen tabs for this object. - [{'name':'Name','action':'template','selected':False},...] - """ - tabs = super(DeviceClass, self).zentinelTabs(templateName) - #if self.getPrimaryId() == "/zport/dmd/Devices" and self.isManager(): - # tab = {'action': 'editCustSchema', 'name':'Custom Schema'} - # if templateName == tab['action']: - # tab['selected'] = True - # tabs.insert(-1, tab) - return tabs - - def getPeerDeviceClassNames(self, pyclass=None): "Return a list of all device paths that have the python class pyclass" if pyclass == None: @@ -439,9 +404,10 @@ mychain = aq_chain(context) mychain.reverse() for obj in mychain: - if not getattr(aq_base(obj), 'rrdTemplates', False): continue - for t in obj.rrdTemplates(): - templates[t.id] = t + try: + templates.update(dict([(t.id, t) for t in obj.rrdTemplates()])) + except AttributeError: + pass return templates.values() @@ -584,6 +550,7 @@ devs._setProperty("zFileSystemMapIgnoreNames", "") devs._setProperty("zSysedgeDiskMapIgnoreNames", "") devs._setProperty("zIpServiceMapMaxPort", 1024, type="int") + devs._setProperty("zDeviceTemplates", ["Device"], type="lines") # RRD properties #FIXME - should this be added to allow for more flexability of Modified: trunk/Products/ZenModel/DeviceComponent.py =================================================================== --- trunk/Products/ZenModel/DeviceComponent.py 2007-03-14 20:09:17 UTC (rev 4284) +++ trunk/Products/ZenModel/DeviceComponent.py 2007-03-14 21:02:50 UTC (rev 4285) @@ -1,4 +1,4 @@ -################################################################# +g################################################################# # # Copyright (c) 2002 Zenoss, Inc. All rights reserved. # @@ -17,7 +17,7 @@ from Acquisition import aq_base from Lockable import Lockable -class DeviceComponent(object, Lockable): +class DeviceComponent(Lockable): """ DeviceComponent is a mix-in class for all components of a device. These include LogicalComponent, Software, and Hardware. @@ -84,24 +84,18 @@ return "" - def getRRDTemplate(self, name=None): + def getRRDTemplateByName(self, name): """Return the closest RRDTemplate named name by walking our aq chain. """ - if not name: name = self.getRRDTemplateName() - templ = getattr(self, name, None) - if templ is None: - templ = super(DeviceComponent, self).getRRDTemplate(name) - return templ + try: + return getattr(self, name) + except AttributeError: + return super(DeviceComponent, self).getRRDTemplateByName(name) def getNagiosTemplate(self, name=None): import warnings warnings.warn('anything named nagios is deprecated', DeprecationWarning) - if not name: name = self.getNagiosTemplateName() - templ = getattr(self, name+"_Nagios", None) - if templ is None: - templ = super(DeviceComponent, self).getNagiosTemplate(name) - return templ def getAqProperty(self, prop): Modified: trunk/Products/ZenModel/Lockable.py =================================================================== --- trunk/Products/ZenModel/Lockable.py 2007-03-14 20:09:17 UTC (rev 4284) +++ trunk/Products/ZenModel/Lockable.py 2007-03-14 21:02:50 UTC (rev 4285) @@ -4,7 +4,7 @@ DELETE_LOCKED = 1 UPDATE_LOCKED = 2 -class Lockable: +class Lockable(object): sendEventWhenBlockedFlag = False modelerLock = UNLOCKED @@ -86,4 +86,4 @@ return "Send event when blocked" else: return "Do not send event when blocked" - \ No newline at end of file + Modified: trunk/Products/ZenModel/OSProcess.py =================================================================== --- trunk/Products/ZenModel/OSProcess.py 2007-03-14 20:09:17 UTC (rev 4284) +++ trunk/Products/ZenModel/OSProcess.py 2007-03-14 21:02:50 UTC (rev 4285) @@ -70,13 +70,8 @@ """Return information used to monitor this process. """ thresholds = [] - try: - templ = self.getRRDTemplate(self.getRRDTemplateName()) - if templ: - threshs = self.getThresholds(templ) - thresholds = threshs.items() - except RRDObjectNotFound, e: - log.warn(e) + for templ in self.getRRDTemplates(): + thresholds.append(self.getThresholds(templ)) return (self.id, self.name(), self.osProcessClass().ignoreParameters, self.alertOnRestart(), self.getFailSeverity(), thresholds) @@ -97,12 +92,6 @@ return pClass.getPrimaryDmdId() - def getRRDTemplateName(self): - """Return list of graph urls. - """ - return "OSProcess" - - def getOSProcessClassLink(self): """Return an a link to the OSProcessClass. """ Modified: trunk/Products/ZenModel/RRDView.py =================================================================== --- trunk/Products/ZenModel/RRDView.py 2007-03-14 20:09:17 UTC (rev 4284) +++ trunk/Products/ZenModel/RRDView.py 2007-03-14 21:02:50 UTC (rev 4285) @@ -30,17 +30,23 @@ class RRDView(object): """ Mixin to provide hooks to RRD management functions - which allow targetmap management and graphing - configuration generation is in CricketDevice and CricketServer """ def getRRDGraphUrl(self, graph, drange=None, template=None): """resolve template and graph names to objects and pass to graph performance""" if not drange: drange = self.defaultDateRange - if not template: template = self.getRRDTemplate() - if type(graph) in types.StringTypes: - graph = template.graphs._getOb(graph) + templates = self.getRRDTemplates() + if template: + templates = [template] + if type(graph) in types.StringTypes: + def getGraph(templates, graphName): + for t in templates: + try: + return t, t._getOb(graphName) + except AttributeError: + pass + template, graph = getGraph(templates, graph) targetpath = self.rrdPath() objpaq = self.primaryAq() perfServer = objpaq.device().getPerformanceServer() @@ -76,7 +82,14 @@ if results: return results[dsname] + + def getRRDDataPoints(self): + result = [] + for t in self.getRRDTemplates(): + result += t.getRRDDataPoints() + return result + def getRRDValues(self, dsnames, start=None, end=None, function="LAST"): """Return a dict of key value pairs where dsnames are the keys. """ @@ -87,12 +100,10 @@ gopts = [] names = list(dsnames[:]) for dsname in dsnames: - for dp in self.getRRDTemplate().getRRDDataPoints(): + for dp in self.getRRDDataPoints(): if dp.name().find(dsname) > -1: break else: - dp = None - if not dp: names.remove(dsname) continue filename = self.getRRDFileName(dp.name()) @@ -133,7 +144,7 @@ gopts = [] names = list(points[:]) for name in points: - for dp in self.getRRDTemplate().getRRDDataPoints(): + for dp in self.getRRDDataPoints(): if dp.name().find(name) > -1: break else: @@ -163,17 +174,15 @@ def getDefaultGraphs(self, drange=None): """get the default graph list for this object""" graphs = [] - template = self.getRRDTemplate() - if not template: return graphs - for g in template.getGraphs(): - graph = {} - graph['title'] = g.getId() - try: - graph['url'] = self.getRRDGraphUrl(g,drange,template=template) - except ConfigurationError: - pass - if graph['url']: - graphs.append(graph) + for template in self.getRRDTemplates(): + for g in template.getGraphs(): + graph = {} + graph['title'] = g.getId() + try: + graph['url'] = self.getRRDGraphUrl(g, drange, template) + graphs.append(graph) + except ConfigurationError: + pass return graphs @@ -183,22 +192,10 @@ """ return self.meta_type - def _nagiosWarning(self): - import warnings - warnings.warn('nagios templates are deprecated', DeprecationWarning) - - def getNagiosTemplateName(self): - """Return the nagios temlate name of this component. - By default meta_type. Override to create custom type selection. - """ - self._nagiosWarning() - return self.meta_type - - def getRRDFileName(self, dsname): """Look up an rrd file based on its data point name""" - names = [n for n in self.getRRDTemplate().getRRDDataPointNames() - if n.endswith(dsname)] + names = [p.name() for p in self.getRRDDataPoints() + if p.name().endswith(dsname)] if names: return '%s/%s.rrd' % (self.rrdPath(), names[0]) else: @@ -216,44 +213,35 @@ """ return False + def getRRDTemplates(self): + default = self.getRRDTemplateByName(self.getRRDTemplateName()) + if not default: + return [] + return [default] - def getRRDTemplate(self, name=None): - if not name: name = self.getRRDTemplateName() - templ = self._lookupTemplate(name, 'rrdTemplates') - if not templ: + def getRRDTemplate(self): + try: + return self.getRRDTemplates()[0] + except IndexError: + return None + + def getRRDTemplateByName(self, name): + "Return the template of the given name." + for obj in aq_chain(self): + try: + return obj.rrdTemplates._getOb(name) + except AttributeError: + pass + if 0: + # I think this is a bad idea from RRDTemplate import RRDTemplate templ = RRDTemplate(name) devs = self.getDmdRoot("Devices") devs.rrdTemplates._setObject(name, templ) - templ = devs.rrdTemplates._getOb(name) - return templ + return templ + return None - def getNagiosTemplate(self, name=None): - self._nagiosWarning() - if not name: name = self.getRRDTemplateName() - templ = self._lookupTemplate(name, 'nagiosTemplates') - if not templ: - from NagiosTemplate import NagiosTemplate - templ = NagiosTemplate(name) - devs = self.getDmdRoot("Devices") - devs.nagiosTemplates._setObject(name, templ) - templ = devs.nagiosTemplates._getOb(name) - return templ - - - - def _lookupTemplate(self, name, relname): - """Return the closest RRDTemplate named name by walking our aq chain. - """ - mychain = aq_chain(self) - for obj in mychain: - if not getattr(aq_base(obj), relname, False): continue - if getattr(aq_base(getattr(obj, relname)), name, False): - return getattr(obj, relname)._getOb(name) - - - def getThresholds(self, templ): """Return a dictionary where keys are dsnames and values are thresholds. """ @@ -265,6 +253,7 @@ threshdef.append(thresh.getConfig(self)) return result + def rrdPath(self): d = self.device() if not d: return "/Devices/" + self.id @@ -277,27 +266,23 @@ oids = [] if self.snmpIgnore(): return oids basepath = self.rrdPath() - try: - templ = self.getRRDTemplate(self.getRRDTemplateName()) - if templ: - threshs = self.getThresholds(templ) - for ds in templ.getRRDDataSources("SNMP"): - if not ds.enabled: continue - oid = ds.oid - snmpindex = getattr(self, "ifindex", self.snmpindex) - if snmpindex: oid = "%s.%s" % (oid, snmpindex) - for dp in ds.getRRDDataPoints(): - cname = self.meta_type != "Device" \ - and self.viewName() or dp.id - oids.append((cname, - oid, - "/".join((basepath, dp.name())), - dp.rrdtype, - dp.createCmd, - (dp.rrdmin, dp.rrdmax), - threshs.get(dp.name(),[]))) - except RRDObjectNotFound, e: - log.warn(e) + for templ in self.getRRDTemplates(): + threshs = self.getThresholds(templ) + for ds in templ.getRRDDataSources("SNMP"): + if not ds.enabled: continue + oid = ds.oid + snmpindex = getattr(self, "ifindex", self.snmpindex) + if snmpindex: oid = "%s.%s" % (oid, snmpindex) + for dp in ds.getRRDDataPoints(): + cname = self.meta_type != "Device" \ + and self.viewName() or dp.id + oids.append((cname, + oid, + "/".join((basepath, dp.name())), + dp.rrdtype, + dp.createCmd, + (dp.rrdmin, dp.rrdmax), + threshs.get(dp.name(),[]))) return oids @@ -310,54 +295,49 @@ If pageChecks then only consider datasources of type PAGECHECK and return results that is a list of dictionaries. """ - templ = self.getRRDTemplate(self.getRRDTemplateName()) - if not templ: return () - threshs = self.getThresholds(templ) result = [] - basepath = self.rrdPath() - if pageChecks: - commandTypes = ['PAGECHECK'] - else: - commandTypes = ['COMMAND'] - dataSources = [] - [ dataSources.extend(templ.getRRDDataSources(x)) for x in commandTypes ] - for ds in dataSources: - if not ds.enabled: continue - points = [] - for dp in ds.getRRDDataPoints(): - points.append( - (dp.id, - "/".join((basepath, dp.name())), - dp.rrdtype, - dp.createCmd, - (dp.rrdmin, dp.rrdmax), - threshs.get(dp.name(),[]))) - key = ds.eventKey or ds.id + for templ in self.getRRDTemplates(): + threshs = self.getThresholds(templ) + basepath = self.rrdPath() if pageChecks: - result.append({ - 'datasource': ds.id or '', - 'datapoints': points or (), - #'datapoints': (), - 'cycletime': ds.cycletime or '', - 'component': ds.component or '', - 'eventClass': ds.eventClass or '', - 'eventKey': key or '', - 'severity': ds.severity or '', - 'userAgent': ds.userAgent or '', - 'recording': ds.recording or '', - 'initialUrl': ds.initialURL or '', - 'command': ds.getCommand(self) or '', - 'commandHash': ds.commandHash or '', - }) + dataSources = templ.getRRDDataSources('PAGECHECK') else: - result.append( (ds.usessh, ds.cycletime, ds.component, - ds.eventClass, key, ds.severity, - ds.getCommand(self), points) ) + dataSources = templ.getRRDDataSources('COMMAND') + for ds in dataSources: + if not ds.enabled: continue + points = [] + for dp in ds.getRRDDataPoints(): + points.append( + (dp.id, + "/".join((basepath, dp.name())), + dp.rrdtype, + dp.createCmd, + (dp.rrdmin, dp.rrdmax), + threshs.get(dp.name(),[]))) + key = ds.eventKey or ds.id + if pageChecks: + result.append({ + 'datasource': ds.id or '', + 'datapoints': points or (), + #'datapoints': (), + 'cycletime': ds.cycletime or '', + 'component': ds.component or '', + 'eventClass': ds.eventClass or '', + 'eventKey': key or '', + 'severity': ds.severity or '', + 'userAgent': ds.userAgent or '', + 'recording': ds.recording or '', + 'initialUrl': ds.initialURL or '', + 'command': ds.getCommand(self) or '', + 'commandHash': ds.commandHash or '', + }) + else: + result.append( (ds.usessh, ds.cycletime, ds.component, + ds.eventClass, key, ds.severity, + ds.getCommand(self), points) ) return result - - def getXmlRpcTargets(self): """Return a list of XMLRPC targets in the form [(name, url, methodName, methodParameters, path, type, @@ -371,8 +351,7 @@ if self.snmpIgnore(): return targets basepath = self.rrdPath() try: - templ = self.getRRDTemplate(self.getRRDTemplateName()) - if templ: + for templ in self.getRRDTemplates(): threshs = self.getThresholds(templ) for ds in templ.getRRDDataSources("XMLRPC"): if not ds.enabled: continue @@ -406,25 +385,10 @@ def copyRRDTemplate(self, REQUEST=None): """Make a local copy of our RRDTemplate if one doesn't exist. """ - return self._copyTemplate(self.getRRDTemplate, - self.getRRDTemplateName(), REQUEST) - - - def copyNagiosTemplate(self, REQUEST=None): - """Make a local copy of our Nagios Template if one doesn't exist. - """ - self._nagiosWarning() - name = self.getNagiosTemplateName() + "_Nagios" - return self._copyTemplate(self.getNagiosTemplate, name, REQUEST) - - - def _copyTemplate(self, templGet, templName, REQUEST=None): - """Make a local copy of our RRDTemplate if one doesn't exist. - """ - templ = templGet() - if not self.isLocalName(templName): - ct = templ._getCopy(self) - ct.id = templName + templname = self.getRRDTemplateName() + if not self.isLocalName(templname): + ct = self.getRRDTemplate()._getCopy(self) + ct.id = self.getRRDTemplateName() self._setObject(ct.id, ct) if REQUEST: return self.callZenScreen(REQUEST) @@ -432,20 +396,7 @@ def deleteRRDTemplate(self, REQUEST=None): """Make a local delete of our RRDTemplate if one doesn't exist. """ - return self._deleteTemplate(self.getRRDTemplateName(), REQUEST) - - - def deleteNagiosTemplate(self, REQUEST=None): - """Make a local delete of our Nagios Template if one doesn't exist. - """ - self._nagiosWarning() - name = self.getNagiosTemplateName() + "_Nagios" - return self._deleteTemplate(name, REQUEST) - - - def _deleteTemplate(self, tname, REQUEST=None): - """Delete our local RRDTemplate if it exists. - """ + tname = self.getRRDTemplateName() if self.isLocalName(tname): self._delObject(tname) if REQUEST: return self.callZenScreen(REQUEST) Modified: trunk/Products/ZenModel/skins/zenmodel/objRRDTemplate.pt =================================================================== --- trunk/Products/ZenModel/skins/zenmodel/objRRDTemplate.pt 2007-03-14 20:09:17 UTC (rev 4284) +++ trunk/Products/ZenModel/skins/zenmodel/objRRDTemplate.pt 2007-03-14 21:02:50 UTC (rev 4285) @@ -1,12 +1,10 @@ <tal:block metal:use-macro="here/templates/macros/page2"> -<tal:block metal:fill-slot="contentPane" - tal:define="templ here/getRRDTemplate; - editable python:templ.isEditable(here)"> +<tal:block metal:fill-slot="contentPane"> +<tal:block tal:repeat="templ here/getRRDTemplates"> +<tal:block tal:define="editable python:templ.isEditable(here)"> <form method="post" tal:attributes="action here/absolute_url_path"> <input type="hidden" name="zenScreenName" tal:attributes="value template/id"/> - - <tal:block tal:define=" tabletitle string:"> <tal:block metal:use-macro="here/zenuimacros/macros/zentable"> @@ -22,7 +20,8 @@ <tal:block metal:fill-slot="zentablecontents"> <!-- BEGIN TABLE CONTENTS --> - + + <tr class="tableheader"> <td> RRDTemplate @ <a tal:attributes="href templ/getPrimaryUrlPath" @@ -46,7 +45,6 @@ </tal:block> </tal:block> </tal:block> - </form> <br/> @@ -108,6 +106,8 @@ </tal:block> </form> +</tal:block> +</tal:block> </tal:block> </tal:block> |
From: <sv...@ze...> - 2007-03-14 20:09:16
|
Author: ecn Date: 2007-03-14 16:09:17 -0400 (Wed, 14 Mar 2007) New Revision: 4284 Added: trunk/Products/ZenModel/migrate/deviceTemplatesProperty.py Modified: trunk/Products/ZenModel/migrate/__init__.py Log: * add zDeviceTemplates property Modified: trunk/Products/ZenModel/migrate/__init__.py =================================================================== --- trunk/Products/ZenModel/migrate/__init__.py 2007-03-14 20:08:50 UTC (rev 4283) +++ trunk/Products/ZenModel/migrate/__init__.py 2007-03-14 20:09:17 UTC (rev 4284) @@ -67,3 +67,4 @@ import zenuilayer import packs import menus +import deviceTemplatesProperty Added: trunk/Products/ZenModel/migrate/deviceTemplatesProperty.py |
From: <sv...@ze...> - 2007-03-14 20:08:58
|
Author: ecn Date: 2007-03-14 16:08:50 -0400 (Wed, 14 Mar 2007) New Revision: 4283 Modified: trunk/Products/ZenUtils/patches/ Log: * ignore *.pyc in directories Property changes on: trunk/Products/ZenUtils/patches ___________________________________________________________________ Name: svn:ignore + *.pyc |
From: <sv...@ze...> - 2007-03-14 20:07:38
|
Author: ecn Date: 2007-03-14 16:07:11 -0400 (Wed, 14 Mar 2007) New Revision: 4282 Modified: trunk/Products/ZenModel/PerformanceConf.py Log: * remove debugging print Modified: trunk/Products/ZenModel/PerformanceConf.py =================================================================== --- trunk/Products/ZenModel/PerformanceConf.py 2007-03-14 16:23:03 UTC (rev 4281) +++ trunk/Products/ZenModel/PerformanceConf.py 2007-03-14 20:07:11 UTC (rev 4282) @@ -158,7 +158,6 @@ if dev.snmpMonitorDevice(): all.add(dev.id) if lastChanged.get(dev.id, 0) < float(dev.getLastChange()): - print dev.id new.add(dev.id) deleted = Set(lastChanged.keys()) - all return list(new | deleted) |
From: <sv...@ze...> - 2007-03-14 16:23:09
|
Author: ecn Date: 2007-03-14 12:23:03 -0400 (Wed, 14 Mar 2007) New Revision: 4281 Modified: trunk/Products/ZenModel/ZenossInfo.py Log: * fix copy-pasted typo (8 times!) Modified: trunk/Products/ZenModel/ZenossInfo.py =================================================================== --- trunk/Products/ZenModel/ZenossInfo.py 2007-03-13 22:49:10 UTC (rev 4280) +++ trunk/Products/ZenModel/ZenossInfo.py 2007-03-14 16:23:03 UTC (rev 4281) @@ -79,7 +79,7 @@ def getOSVersion(self): """ This function returns a Version-ready tuple. For use with the Version - object, use exteneded call syntax: + object, use extended call syntax: v = Version(*getOSVersion()) v.full() @@ -102,7 +102,7 @@ def getPythonVersion(self): """ This function returns a Version-ready tuple. For use with the Version - object, use exteneded call syntax: + object, use extended call syntax: v = Version(*getPythonVersion()) v.full() @@ -115,7 +115,7 @@ def getMySQLVersion(self): """ This function returns a Version-ready tuple. For use with the Version - object, use exteneded call syntax: + object, use extended call syntax: v = Version(*getMySQLVersion()) v.full() @@ -146,7 +146,7 @@ def getRRDToolVersion(self): """ This function returns a Version-ready tuple. For use with the Version - object, use exteneded call syntax: + object, use extended call syntax: v = Version(*getRRDToolVersion()) v.full() @@ -165,7 +165,7 @@ def getTwistedVersion(self): """ This function returns a Version-ready tuple. For use with the Version - object, use exteneded call syntax: + object, use extended call syntax: v = Version(*getTwistedVersion()) v.full() @@ -178,7 +178,7 @@ def getPySNMPVersion(self): """ This function returns a Version-ready tuple. For use with the Version - object, use exteneded call syntax: + object, use extended call syntax: v = Version(*getpySNMPVersion()) v.full() @@ -190,7 +190,7 @@ def getTwistedSNMPVersion(self): """ This function returns a Version-ready tuple. For use with the Version - object, use exteneded call syntax: + object, use extended call syntax: v = Version(*getTwistedSNMPVersion()) v.full() @@ -202,7 +202,7 @@ def getZopeVersion(self): """ This function returns a Version-ready tuple. For use with the Version - object, use exteneded call syntax: + object, use extended call syntax: v = Version(*getZopeVersion()) v.full() |
From: <sv...@ze...> - 2007-03-13 22:49:12
|
Author: chris Date: 2007-03-13 18:49:10 -0400 (Tue, 13 Mar 2007) New Revision: 4280 Modified: trunk/Products/ZenModel/data/devices.xml Log: fixes #1001. also fixed a few other thresholds that referenced datasource_datapoint entities that do not exist Modified: trunk/Products/ZenModel/data/devices.xml =================================================================== --- trunk/Products/ZenModel/data/devices.xml 2007-03-13 22:45:32 UTC (rev 4279) +++ trunk/Products/ZenModel/data/devices.xml 2007-03-13 22:49:10 UTC (rev 4280) @@ -1488,7 +1488,7 @@ <tomanycont id='thresholds'> <object id='CPU' module='Products.ZenModel.RRDThreshold' class='RRDThreshold'> <property type="lines" id="dsnames" mode="w" > -['cpmCPUTotal5min'] +['cpu5min_cpuPercentProcessorTime'] </property> <property type="string" id="maxval" mode="w" > 90 @@ -1724,7 +1724,7 @@ <tomanycont id='thresholds'> <object id='CPU' module='Products.ZenModel.RRDThreshold' class='RRDThreshold'> <property type="lines" id="dsnames" mode="w" > -['cpmCPUTotal5min'] +['cpu5min_cpu5min'] </property> <property type="string" id="maxval" mode="w" > 90 @@ -3154,7 +3154,7 @@ <tomanycont id='thresholds'> <object id='CPU Utilization' module='Products.ZenModel.RRDThreshold' class='RRDThreshold'> <property type="lines" id="dsnames" mode="w" > -['ssCpuRawIdle'] +['ssCpuRawIdle_ssCpuRawIdle'] </property> <property type="string" id="minval" mode="w" > 2 |
From: <sv...@ze...> - 2007-03-13 22:45:32
|
Author: ecn Date: 2007-03-13 18:45:32 -0400 (Tue, 13 Mar 2007) New Revision: 4279 Modified: branches/zenoss-1.1.x/Products/ZenRRD/zenprocess.py Log: * avoid a traceback on bad values Modified: branches/zenoss-1.1.x/Products/ZenRRD/zenprocess.py =================================================================== --- branches/zenoss-1.1.x/Products/ZenRRD/zenprocess.py 2007-03-13 22:23:28 UTC (rev 4278) +++ branches/zenoss-1.1.x/Products/ZenRRD/zenprocess.py 2007-03-13 22:45:32 UTC (rev 4279) @@ -82,6 +82,7 @@ n = int(n) except ValueError, er: log.error("Bad value for CPU: '%s'", n) + return None if self.cpu is None or n is None: self.cpu = n |
From: <sv...@ze...> - 2007-03-13 22:23:29
|
Author: chris Date: 2007-03-13 18:23:28 -0400 (Tue, 13 Mar 2007) New Revision: 4278 Added: trunk/Products/DataCollector/plugins/zenoss/cmd/linux/process.py Log: refs #602. now collects process information when this plugin is used. we still need to write daemon that will monitor these things (or rather update zencommand to do it\?) Added: trunk/Products/DataCollector/plugins/zenoss/cmd/linux/process.py |
From: <sv...@ze...> - 2007-03-13 21:48:53
|
Author: chris Date: 2007-03-13 17:48:48 -0400 (Tue, 13 Mar 2007) New Revision: 4277 Added: trunk/Products/DataCollector/plugins/zenoss/cmd/linux/memory.py Log: fixes #704. read total memory and swap from /proc/meminfo and land it in the object model Added: trunk/Products/DataCollector/plugins/zenoss/cmd/linux/memory.py |
From: <sv...@ze...> - 2007-03-13 20:45:57
|
Author: chris Date: 2007-03-13 16:45:57 -0400 (Tue, 13 Mar 2007) New Revision: 4276 Modified: trunk/inst/install-functions.sh Log: --password instead of -p Modified: trunk/inst/install-functions.sh =================================================================== --- trunk/inst/install-functions.sh 2007-03-13 20:22:07 UTC (rev 4275) +++ trunk/inst/install-functions.sh 2007-03-13 20:45:57 UTC (rev 4276) @@ -65,7 +65,7 @@ MYSQL_HOST_PERM="%" fi - mysql -h ${MYSQLHOST} -u ${MYSQLROOTUSER} -p"${MYSQLROOTPASSWD}" <<EOF + mysql -h ${MYSQLHOST} -u ${MYSQLROOTUSER} --password="${MYSQLROOTPASSWD}" <<EOF grant all on $MYSQLEVENTDB.* to '$MYSQLUSER'@'${MYSQL_HOST_PERM}' identified by '$MYSQLPASS'; grant super, file on *.* to '$MYSQLUSER'@'${MYSQL_HOST_PERM}'; flush privileges; |
From: <sv...@ze...> - 2007-03-13 20:22:08
|
Author: marc Date: 2007-03-13 16:22:07 -0400 (Tue, 13 Mar 2007) New Revision: 4275 Added: trunk/inst/zenUsers2dump.py Log: #1065 Added: trunk/inst/zenUsers2dump.py Property changes on: trunk/inst/zenUsers2dump.py ___________________________________________________________________ Name: svn:executable + * |
From: <sv...@ze...> - 2007-03-13 20:12:12
|
Author: chris Date: 2007-03-13 16:12:08 -0400 (Tue, 13 Mar 2007) New Revision: 4274 Modified: trunk/Products/ZenEvents/EventManagerBase.py trunk/Products/ZenEvents/MySqlEventManager.py trunk/Products/ZenModel/DmdBuilder.py trunk/Products/ZenModel/zenbuild.py trunk/bin/zeneventbuild trunk/inst/build-functions.sh trunk/inst/install-functions.sh Log: fixes #551: permit a remote mysql database Modified: trunk/Products/ZenEvents/EventManagerBase.py =================================================================== --- trunk/Products/ZenEvents/EventManagerBase.py 2007-03-13 20:08:26 UTC (rev 4273) +++ trunk/Products/ZenEvents/EventManagerBase.py 2007-03-13 20:12:08 UTC (rev 4274) @@ -230,15 +230,15 @@ security = ClassSecurityInfo() - def __init__(self, id, title='', username='root', - password='', database='events', host='127.0.0.1', port=3306, + def __init__(self, id, title='', hostname='localhost', username='root', + password='', database='events', port=3306, defaultWhere='',defaultOrderby='',defaultResultFields=[]): self.id = id self.title = title self.username=username self.password=password self.database=database - self.host=host + self.host=hostname self.port=port DbAccessBase.__init__(self) Modified: trunk/Products/ZenEvents/MySqlEventManager.py =================================================================== --- trunk/Products/ZenEvents/MySqlEventManager.py 2007-03-13 20:08:26 UTC (rev 4273) +++ trunk/Products/ZenEvents/MySqlEventManager.py 2007-03-13 20:12:08 UTC (rev 4274) @@ -10,13 +10,15 @@ from MySqlSendEvent import MySqlSendEventMixin from Exceptions import * -def manage_addMySqlEventManager(context, id=None, evtuser="root", evtpass="", - evtdb="events", history=False, REQUEST=None): +def manage_addMySqlEventManager(context, id=None, evthost="localhost", + evtuser="root", evtpass="", evtdb="events", + history=False, REQUEST=None): '''make an MySqlEventManager''' if not id: id = "ZenEventManager" if history: id = "ZenEventHistory" - evtmgr = MySqlEventManager(id,username=evtuser,password=evtpass,database=evtdb) + evtmgr = MySqlEventManager(id, hostname=evthost, username=evtuser, + password=evtpass, database=evtdb) context._setObject(id, evtmgr) evtmgr = context._getOb(id) evtmgr.buildRelations() Modified: trunk/Products/ZenModel/DmdBuilder.py =================================================================== --- trunk/Products/ZenModel/DmdBuilder.py 2007-03-13 20:08:26 UTC (rev 4273) +++ trunk/Products/ZenModel/DmdBuilder.py 2007-03-13 20:12:08 UTC (rev 4274) @@ -87,9 +87,10 @@ monRoots = ('StatusMonitors','Performance') - def __init__(self, portal, evtuser, evtpass, evtdb, + def __init__(self, portal, evthost, evtuser, evtpass, evtdb, smtphost, smtpport, snpphost, snppport): self.portal = portal + self.evthost = evthost self.evtuser = evtuser self.evtpass = evtpass self.evtdb = evtdb @@ -153,10 +154,12 @@ manage_addDirectoryView(self.portal,'ZenUtils/js', 'js') manage_addRenderServer(self.portal, "RenderServer") manage_addReportServer(self.portal, "ReportServer") - manage_addMySqlEventManager(self.dmd, evtuser=self.evtuser, - evtpass=self.evtpass, evtdb=self.evtdb) - manage_addMySqlEventManager(self.dmd, evtuser=self.evtuser, - evtpass=self.evtpass, evtdb=self.evtdb, + manage_addMySqlEventManager(self.dmd, evthost=self.evthost, + evtuser=self.evtuser, evtpass=self.evtpass, + evtdb=self.evtdb) + manage_addMySqlEventManager(self.dmd, evthost=self.evthost, + evtuser=self.evtuser, evtpass=self.evtpass, + evtdb=self.evtdb, history=True) manage_addUserSettingsManager(self.dmd) manage_addIpNetwork(self.dmd, "Networks") Modified: trunk/Products/ZenModel/zenbuild.py =================================================================== --- trunk/Products/ZenModel/zenbuild.py 2007-03-13 20:08:26 UTC (rev 4273) +++ trunk/Products/ZenModel/zenbuild.py 2007-03-13 20:12:08 UTC (rev 4274) @@ -46,6 +46,8 @@ def buildOptions(self): CmdBase.buildOptions(self) + self.parser.add_option('-s','--evthost', dest="evthost", default="root", + help="events database hostname") self.parser.add_option('-u','--evtuser', dest="evtuser", default="root", help="username used to connect to the events database") self.parser.add_option('-p','--evtpass', dest="evtpass", default="", @@ -105,10 +107,15 @@ # build dmd from Products.ZenModel.DmdBuilder import DmdBuilder - dmdBuilder = DmdBuilder(site, self.options.evtuser, - self.options.evtpass,self.options.evtdb, - self.options.smtphost, self.options.smtpport, - self.options.snpphost, self.options.snppport) + dmdBuilder = DmdBuilder(site, + self.options.evthost, + self.options.evtuser, + self.options.evtpass, + self.options.evtdb, + self.options.smtphost, + self.options.smtpport, + self.options.snpphost, + self.options.snppport) dmdBuilder.build() # Set smtp and snpp values Modified: trunk/bin/zeneventbuild =================================================================== --- trunk/bin/zeneventbuild 2007-03-13 20:08:26 UTC (rev 4273) +++ trunk/bin/zeneventbuild 2007-03-13 20:12:08 UTC (rev 4274) @@ -14,17 +14,22 @@ exit 1 fi +MYSQLHOST=$1 +MYSQLUSER=$2 +MYSQLPASS=$3 +MYSQLDB=$4 + # Create the database echo "creating database" >&2 -mysql -u $1 --password=$2 << EOF - CREATE DATABASE IF NOT EXISTS $3; +mysql -h $MYSQLHOST -u $MYSQLUSER --password=$MYSQLPASS << EOF + CREATE DATABASE IF NOT EXISTS $MYSQLDB; EOF # Load schema echo "loading schema" >&2 -mysql -u $1 --password=$2 $3 < zenevents.sql +mysql -h $MYSQLHOST -u $MYSQLUSER --password=$MYSQLPASS $MYSQLDB < zenevents.sql # Load stored procedures echo "loading stored procedures" >&2 -mysql -u $1 --password=$2 $3 < zenprocs.sql +mysql -h $MYSQLHOST -u $MYSQLUSER --password=$MYSQLPASS $MYSQLDB < zenprocs.sql echo "events database created and loaded" >&2 Modified: trunk/inst/build-functions.sh =================================================================== --- trunk/inst/build-functions.sh 2007-03-13 20:08:26 UTC (rev 4273) +++ trunk/inst/build-functions.sh 2007-03-13 20:12:08 UTC (rev 4274) @@ -36,6 +36,13 @@ # the mysql password for $MYSQLUSER export MYSQLPASS="zenoss" + + # the mysql server + export MYSQLHOST="localhost" + + # the mysql root username and password + export MYSQLROOTUSER="root" + export MYSQLROOTPASSWD="" # password for user "admin" in Zope export ZOPEPASSWORD="zenoss" @@ -157,6 +164,18 @@ set_mysql() { if [ "$MIGRATE" = "n" ]; then + echo -n "MySQL server hostname [$MYSQLHOST]: " + read response + if [ ! -z "$response" ] ; then MYSQLHOST=$response ; fi + + echo -n "MySQL server root username [$MYSQLROOTUSER]: " + read response + if [ ! -z "$response" ] ; then MYSQLROOTUSER=$response ; fi + + echo -n "MySQL server root password [$MYSQLROOTPASSWD]: " + read response + if [ ! -z "$response" ] ; then MYSQLROOTPASSWD=$response ; fi + echo -n "MySQL event database name [$MYSQLEVENTDB]: " read response if [ ! -z "$response" ] ; then MYSQLEVENTDB=$response ; fi @@ -195,6 +214,10 @@ # make sure all mysql environment variables are set and a devel version exists check_mysql() { + if [ -z "$MYSQLHOST" ] ; then + fail "You must set the MySQL hostname" + fi + if [ -z "$MYSQLUSER" ] ; then fail 'You must set the name of a MySQL user who has trigger and database create permissions (try "root")' fi Modified: trunk/inst/install-functions.sh =================================================================== --- trunk/inst/install-functions.sh 2007-03-13 20:08:26 UTC (rev 4273) +++ trunk/inst/install-functions.sh 2007-03-13 20:12:08 UTC (rev 4274) @@ -59,25 +59,20 @@ # attempt to create the events database and login to it. fail if unsuccessful create_database() { - # if we can login as root w/out a password, try to create - # the $MYSQLUSER permissions - if mysql -u root </dev/null >/dev/null 2>/dev/null ; then - PASSWD_ARGS="" + if [ "${MYSQLHOST}" = "localhost" ]; then + MYSQL_HOST_PERM="localhost" else - echo -n "MySQL root passwd: " - read response - if [ ! -z "$response" ] ; then PASSWD_ARGS="--password=$response"; fi + MYSQL_HOST_PERM="%" fi - - mysql -u root ${PASSWD_ARGS} <<EOF - grant all on $MYSQLEVENTDB.* to '$MYSQLUSER'@'localhost' identified by '$MYSQLPASS'; - grant super, file on *.* to '$MYSQLUSER'@'localhost'; + mysql -h ${MYSQLHOST} -u ${MYSQLROOTUSER} -p"${MYSQLROOTPASSWD}" <<EOF + grant all on $MYSQLEVENTDB.* to '$MYSQLUSER'@'${MYSQL_HOST_PERM}' identified by '$MYSQLPASS'; + grant super, file on *.* to '$MYSQLUSER'@'${MYSQL_HOST_PERM}'; flush privileges; EOF # attempt to login to the database using the mysql user - mysql -u $MYSQLUSER -p"$MYSQLPASS" < /dev/null >/dev/null || \ + mysql -h ${MYSQLHOST} -u ${MYSQLUSER} -p"${MYSQLPASS}" < /dev/null >/dev/null || \ fail mysql install, user or password is incorrect } @@ -91,7 +86,7 @@ fi echo "creating events database using zenevent build..." >> zenbuild.log - $ZENHOME/bin/zeneventbuild $MYSQLUSER $MYSQLPASS $MYSQLEVENTDB 2>>zenbuild.log || fail "failed to install event tables into MySQL" + $ZENHOME/bin/zeneventbuild $MYSQLHOST $MYSQLUSER $MYSQLPASS $MYSQLEVENTDB 2>>zenbuild.log || fail "failed to install event tables into MySQL" } # create a zope instance @@ -136,7 +131,7 @@ if [ ! -f backup.tar ] ; then echo Loading initial Zenoss objects into the Zeo database echo '(this can take a few minutes)' - $ZENHOME/bin/zenbuild -u $MYSQLUSER -p "$MYSQLPASS" -d $MYSQLEVENTDB 2>>zenbuild.log || \ + $ZENHOME/bin/zenbuild -s $MYSQLHOST -u $MYSQLUSER -p "$MYSQLPASS" -d $MYSQLEVENTDB 2>>zenbuild.log || \ fail unable to create the initial Zenoss object database fi |
From: <sv...@ze...> - 2007-03-13 20:08:31
|
Author: chris Date: 2007-03-13 16:08:26 -0400 (Tue, 13 Mar 2007) New Revision: 4273 Modified: trunk/Products/ZenEvents/DbAccessBase.py Log: formatting Modified: trunk/Products/ZenEvents/DbAccessBase.py =================================================================== --- trunk/Products/ZenEvents/DbAccessBase.py 2007-03-13 20:03:48 UTC (rev 4272) +++ trunk/Products/ZenEvents/DbAccessBase.py 2007-03-13 20:08:26 UTC (rev 4273) @@ -15,11 +15,11 @@ def connect(self): """Load our database driver and connect to the database.""" return self._cpool.get(backend=self.backend, - host=self.host, - port=self.port, - username=self.username, - password=self.password, - database=self.database) + host=self.host, + port=self.port, + username=self.username, + password=self.password, + database=self.database) def cleanstring(self, value): """Remove the trailing \x00 off the end of a string.""" |
From: <sv...@ze...> - 2007-03-13 20:03:48
|
Author: chris Date: 2007-03-13 16:03:48 -0400 (Tue, 13 Mar 2007) New Revision: 4272 Modified: trunk/inst/docs/INSTALL_CentOS43.txt Log: added line to restart mysql as well as snmpd Modified: trunk/inst/docs/INSTALL_CentOS43.txt =================================================================== --- trunk/inst/docs/INSTALL_CentOS43.txt 2007-03-13 19:16:56 UTC (rev 4271) +++ trunk/inst/docs/INSTALL_CentOS43.txt 2007-03-13 20:03:48 UTC (rev 4272) @@ -54,9 +54,10 @@ # setenforce 0 -6. Start the snmp daemon using the command: +6. Restart external daemons using the command: - # /etc/init.d/snmpd start + # /etc/init.d/snmpd restart + # /etc/init.d/mysql restart 7. Start Zenoss using the command: |
From: <sv...@ze...> - 2007-03-13 19:16:56
|
Author: edahl Date: 2007-03-13 15:16:56 -0400 (Tue, 13 Mar 2007) New Revision: 4271 Added: trunk/inst/zen2dump.py Log: * dumper program to begin migration from 1.1 to 2.0 Added: trunk/inst/zen2dump.py |