The topic for #zenoss is: Zenoss Developers will be here Thursday 11am EST: http://bit.ly/d3Gljh (9:44:39 AM)
10:01:50 AM mrayzenoss: jcausey and I are here for any questions
10:02:34 AM mrayzenoss: everyone checked out the 2.5.2 RC builds? http://alpha.zenoss.com/files/2.5.2-beta/
10:04:15 AM chudler: did a successful install, testing some stuff out today..
10:04:20 AM ckrough: Where is my global desktop?
10:04:23 AM ckrough:
10:04:54 AM mistich: +1000 on the global desktop
10:06:35 AM rmatte: mrayzenoss: performancewise and bug-wise it's looking good
10:07:18 AM mistich: ok a zenpack question I'm trying to create a zenpack that adds a custom tab to ever device at the /device class I've came across chet's monkey patch but when I use it twice only one shows up
10:07:20 AM mrayzenoss: I'm sure bbibeault and the rest of QA likes to hear that
10:07:32 AM mistich: what is the correct way to add a tab to all devices?
10:08:34 AM meatwad64: Is there a way to edit the availability built-in report?
10:09:16 AM bbibeault: @rmatte, @chudler - great to hear that it is working; feel free to join #zenoss-testing and offer any feedback.
10:09:46 AM rmatte: k
10:10:33 AM rmatte: meatwad64: http://your.server:8080/zport/dmd/Reports/Performance%20Reports/Availability%20Report/manage
10:10:40 AM rmatte: but be careful
10:11:09 AM mrayzenoss: mistich: if you're doing a new page, take a look at Jane Curry's Bridge MIB ZenPack (and the ZenPack paper she wrote), it's got an example of that docs/DOC-3583
10:11:32 AM mrayzenoss: Speaking of the Bridge MIB ZenPack, it got updated last night: docs/DOC-3583
10:12:31 AM meatwad64: we love zenoss don't get me wrong but the lack of availability reporting in the core edition has led us to start looking at other options such as opennms that does better availability reporting so I would hope there can be some compromise between the enterprise reports in enterprise and what is given in the core oss edition
10:12:39 AM mistich: mrayzenoss: the problem with that I'm not trying to do it for a specify class I'm doing it for all classes
10:13:16 AM mrayzenoss: meatwad64: we hear that, we plan on doing more to address it after the next release
10:13:22 AM mistich: opennms has it but the has major issues in other areas we moved away from it 3 years agao
10:14:02 AM meatwad64: mistich: i agree but we have to use it for reporting only because in other areas zenoss is superior
10:14:42 AM mistich: trust me I understand your pain in the reporting
10:14:51 AM mistich: but there are ways around it
10:15:32 AM mistich: rrdserver is a great way to get data from rrds when doing reports
10:17:01 AM jcausey: mistich: Here is an example (for Location screens instead of Devices -- you probably just need to change the import and classes): http://pastebin.com/m8184e50
10:17:42 AM mistich: and that goes in the __init__.py
10:17:47 AM jcausey: mistich: this would ordinarily live in the zenpack's __init__.py
10:18:00 AM jcausey: mistich: right
10:20:20 AM meatwad64: Is it hard to enable a new zproperty? I like the sql 2005 zenpack but right now I think it can only monitor one sql instance per server
10:23:02 AM mrayzenoss: meatwad64: really simple
10:23:18 AM mrayzenoss: let me dig up an example
10:23:43 AM mrayzenoss: in the WMI MSSQL ZenPack: http://zenpacks.zenoss.org/trac-zenpacks/browser/zenpacks/ZenPacks.community.WMIPerf_MSSQL/ZenPacks/community/WMIPerf_MSSQL/__init__.py
10:23:51 AM mrayzenoss: see the zSQLInstance?
10:24:05 AM mrayzenoss: I believe it's zProperty, default and type
10:24:22 AM jcausey: mistich: You will probably also need to assign " __call__.id = 'tab1' " (or whatever you name each tab) in the BrowserView for each tab's page, so Zope will know which tab to highlight
10:26:20 AM meatwad64: so what is the best way to do it editing the __init__.py ? and re-importing it? or is this something that can be done in the zenoss gui?
10:27:07 AM theacolyte: mrayzenoss: If you figure it out - let me know
10:27:12 AM theacolyte: errr sorry meatwad64
10:27:20 AM theacolyte: It only does once instance which makes it somewhat limited
10:27:53 AM mrayzenoss: theacolyte: he's talking about fixing it
10:27:59 AM theacolyte: you can build your own template though
10:30:19 AM meatwad64: my thought was to copy the template and point the second one to a new zproperty called like zSQLInstanceTesting that points to another instance would that work?
10:30:21 AM mistich: jcausey: thats got it thanks
10:30:49 AM mistich: I came across that example but none worked but all missing this line Location.factory_type_information = (local_factory,)
10:32:01 AM theacolyte: meatwad64: I would just create your own WMI template - forget about the zenpack
10:32:12 AM mrayzenoss: meatwad64: your best bet is to probably bump the version in the setup.py and modify the _init.py, then upgrade your existing zenpack
10:32:13 AM theacolyte: and just query the X amounts of instances
10:32:33 AM theacolyte: it doesn't do anything special beyond put that instance name in the WMI query
10:32:34 AM mrayzenoss: meatwad64: that way you'll be sure to get the new zProperty
10:33:11 AM meatwad64: hmm ok thanks
10:40:41 AM mistich: jcausey: when I change the code to do one tab I get a error
10:40:50 AM mistich: Module Products.PageTemplates.ZRPythonExpr, line 47, in __call__
10:40:50 AM mistich: __traceback_info__: here.zentinelTabs(template.id) Module Python expression "here.zentinelTabs(template.id)", line 1, in <expression> Module Products.ZenModel.ZenModelBase, line 348, in zentinelTabs TypeError: string indices must be integers
10:41:34 AM mistich: http://pastebin.com/m7966cacc
10:43:24 AM mistich: full error http://pastebin.com/d2e7a6e4b
10:44:43 AM jcausey: mistich: hmmm, what does your configure.zcml look like?
10:45:20 AM mistich: which one?
10:45:58 AM jcausey: mistich: the one in the zenpack (should be in the same dir as the __init__.py)
10:46:34 AM mistich: there is none
10:46:38 AM jcausey: mistich: or just the one that defines the page for that action (viewInterfaceGraphs)
10:47:07 AM mistich: viewInterfaceGraphs.pt
10:47:24 AM jplouis: mistich: I believe "tuple(tab)" where tab is a dictionary will just make a tuple of the keys
10:48:44 AM mistich: but if I remove tuple I get
10:48:46 AM mistich: File "/opt/zenoss/ZenPacks/ZenPacks.Rackspace.InterfaceGraphs/ZenPacks/Rackspace/InterfaceGraphs/__init__.py", line 20, in ?
10:48:46 AM mistich: local_factory['actions'] += tab
10:48:46 AM mistich: TypeError: can only concatenate tuple (not "dict") to tuple
10:49:02 AM jplouis: instead of "local_factory['actions'] += tuple(tab)" try "local_factory['actions'] += (tab,)"
10:51:14 AM jcausey: jplouis: great catch. Python automatically pulls a tuple of just the dict keys when invoked that way
10:51:35 AM mistich: very nice
10:51:50 AM mistich: ok so that works
10:52:02 AM mistich: is it possible to place it before the edit tab?
10:53:04 AM jcausey: mistich: awesome. yes, the order of local_factory['actions'] tuple is the order displayed, so you'll need to insert your tab in the middle of it instead of just appending to the end
10:53:22 AM mistich: ok
10:55:28 AM mistich: so next question why would this not work when I tried it the 1st time http://pastebin.com/dc6a7878
10:57:35 AM mistich: sorry wrong one http://pastebin.com/d6059ded7
10:58:15 AM mistich: does it only run the register code on install and removed
10:59:07 AM mistich: this code was in the __init__.py
10:59:56 AM jcausey: mistich: deep copying the factory_type_information is needed -- otherwise there's are referencing problems
11:01:20 AM jcausey: mistich: and of course, the ln:32 tuple(dict) problem from before
11:01:21 AM mistich: s**t
11:01:41 AM mistich: yeah and the wrong class that was a old copy let me fix it and try again
11:02:14 AM jcausey: mistich: yeppers
11:06:14 AM mistich: should that code be in __init__.py or CoreData.py
11:10:06 AM jcausey: mistich: __init__.py is probably the best place -- that way you know its put there before anything else is run (and at zope startup), but there's no reason you can't put it into CoreData (or whatever other class you want) if you want the tabs to be more dynamic
11:12:09 AM mistich: ok new code http://pastebin.com/d390db2f2
11:12:17 AM mistich: but no tabs or errors
11:13:28 AM jcausey: no tabs at all or no new tabs?
11:13:36 AM mistich: no new tabs
11:15:44 AM mistich: just restarting zope will this load the zenpack and run install or do I have to uninstall and install the zenpack
11:16:21 AM jcausey: shouldn't need to reinstall, since we're not touching the zeo or anything
11:16:24 AM jcausey: oh
11:16:45 AM mistich: see something do tell
11:16:52 AM jcausey: finfo[0] should just be finfo, since you're already dereferencing at the deepcopy
11:17:05 AM jcausey: on line 29, and 34
11:17:11 AM mistich: so whats deepcopy
11:20:27 AM jcausey: your doing a full copy of Devices.factory_type_information, and then getting just the first element of the copy with line 28. Which is what you want (the copied factory)
11:21:11 AM jcausey: but no reason to deref finfo again on lines 29 and 34 (and 41 and 45)
11:22:43 AM jcausey: additionally, line 35 (and 46) -- should be dmdloc.factory_type_information = (finfo,)
11:24:13 AM jcausey: If I'm being to opaque (and I think I am the reason you need to pull the first element is that the factory is stored in a tuple -- you need the first (and only) element, and then you put it back as a tuple
11:25:48 AM jcausey: and I unfortunatley have to go. please send me an email if you need further debugging help with this prob (jcausey (at) zenoss.com)
11:26:51 AM mistich: thanks again
11:27:27 AM jcausey: no prob
mrayzenoss has changed the topic to: Zenoss 2.5.2 RC Needs Testing: http://tinyurl.com/y85wuod (11:28:05 AM)