Zenoss ToolBox

58 views
Skip to first unread message

Satay Epic

unread,
Oct 22, 2022, 11:55:40 AM10/22/22
to Zenoss Core
Hello,

The Official Zenoss ToolBox Git link isn't working anymore.  Searching online, I came across a reference of 2.1.0dev version. I guess it may be the latest one. 

Does anyone have this version and can share it?

I've had 0.9.0dev version but I can't find the zip file anymore either.

Thanks 

Jane Curry

unread,
Oct 22, 2022, 2:15:28 PM10/22/22
to Zenoss Core
You are quite correct - it's gone!  I wonder if they know?  I wonder if they care? 

I have a zip file whose setup.py suggests the toolbox is version is 2.3.1, apparently downloaded in May 2021.

I have created a github repository at https://github.com/jcurry/Zenoss-Toolbox .  It's a bit clunky but if you use the "Code" button you should be able to download a zip file which is the little repository.  Inside that you should find the  zenoss_toolbox.zip file that you can unzip.

Don't really know the history of this file so caveat emptor as ever ;)

Cheers,
Jane

Satay Epic

unread,
Oct 25, 2022, 12:33:12 PM10/25/22
to Zenoss Core
Thank you Jane for sharing it!

Rob Dearing

unread,
Dec 21, 2022, 7:20:46 AM12/21/22
to Zenoss Core

I just get the following when I run zodbscan:

Traceback (most recent call last):
  File "/usr/bin/zodbscan", line 9, in <module>
    load_entry_point('zenoss.toolbox==2.3.1', 'console_scripts', 'zodbscan')()
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 299, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 2229, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 1948, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/lib/python2.6/site-packages/zenoss.toolbox-2.3.1-py2.6.egg/zenoss/toolbox/zodbscan.py", line 18, in <module>
    import Globals
ImportError: No module named Globals

Jane Curry

unread,
Dec 21, 2022, 7:37:20 AM12/21/22
to Zenoss Core
Any chance you are running the zodbscan as the root user, rather than the zenoss user???
Cheers,
Jane

Rob Dearing

unread,
Dec 21, 2022, 7:39:39 AM12/21/22
to Zenoss Core
Good shout however when I run as su zenoss:

Traceback (most recent call last):
  File "/usr/bin/zodbscan", line 9, in <module>
    load_entry_point('zenoss.toolbox==2.3.1', 'console_scripts', 'zodbscan')()
  File "/opt/zenoss/lib/python/pkg_resources.py", line 318, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/opt/zenoss/lib/python/pkg_resources.py", line 2221, in load_entry_point
    return ep.load()
  File "/opt/zenoss/lib/python/pkg_resources.py", line 1954, in load

    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/lib/python2.6/site-packages/zenoss.toolbox-2.3.1-py2.6.egg/zenoss/toolbox/zodbscan.py", line 28, in <module>
    from zodbpickle.pickle import Unpickler as UnpicklerBase
ImportError: No module named zodbpickle.pickle


Jane Curry

unread,
Dec 21, 2022, 7:55:32 AM12/21/22
to Zenoss Core
Hmmm. What version of Zenoss are you running?  I am intrigued by it looking in /usr/lib/python2.6/site-packages/zenoss.toolbox-2.3.1-py2.6.egg - I would have expected it to be using a py2.7 version though toolbox-2.3.1 is relatively up-to-date.  Stuff to do with pickle is very old.

Can you do :
zodbscan -v

to get the version or does it barf on that?

You definitely need to run as the zenoss user, not the root user.

Cheers,
Jane

Rob Dearing

unread,
Dec 21, 2022, 7:57:58 AM12/21/22
to Zenoss Core
zodbscan gives the same guff.  Version:


Zenoss
Zenoss 4.2.5
OS
Linux (x86_64) 2.6.32 (Linux bc-as-zen-01.bc.local 2.6.32-754.12.1.el6.x86_64 #1 SMP Tue Apr 9 14:52:26 UTC 2019 x86_64)
Zope
Zope 2.13.13
Python
Python 2.7.2
Database
MySQL 5.5.37 (5.5.37)
RRD
RRDtool 1.4.7
Twisted
Twisted 11.0.0
RabbitMQ
RabbitMQ 2.8.7
Erlang
Erlang 5.8.5
NetSnmp
NetSnmp 5.5.0
PyNetSnmp
PyNetSnmp 0.30.7

Rob Dearing

unread,
Dec 21, 2022, 8:30:09 AM12/21/22
to Zenoss Core
Having run an easy_install against the toolbox from your link I now get the following from zodbscan (pickle is still there but python version is correct):

Traceback (most recent call last):
  File "/opt/zenoss/bin/zodbscan", line 8, in <module>

    load_entry_point('zenoss.toolbox==2.3.1', 'console_scripts', 'zodbscan')()
  File "/opt/zenoss/lib/python/pkg_resources.py", line 318, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/opt/zenoss/lib/python/pkg_resources.py", line 2221, in load_entry_point
    return ep.load()
  File "/opt/zenoss/lib/python/pkg_resources.py", line 1954, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/opt/zenoss/lib/python2.7/site-packages/zenoss.toolbox-2.3.1-py2.7.egg/zenoss/toolbox/zodbscan.py", line 28, in <module>

    from zodbpickle.pickle import Unpickler as UnpicklerBase
ImportError: No module named zodbpickle.pickle

Jane Curry

unread,
Dec 21, 2022, 9:52:28 AM12/21/22
to Zenoss Core
Hmmm.  Delightful. It looks like the 2.3.1 version of the toolbox has moved the pickle tools from pickle to zodbpickle.pickle and (at least my) Zenoss 4.2.5 doesn't have a zodbpickle module
 Do you know how to run zendmd??  It is the command-line tool for exploring the Zenoss object database, zodb.  As the zenoss user, type:
zendmd
Then try these commands to check that you have the same as me (the >>> is the zendmdprompt):

>>> from zodbpickle.pickle import Unpickler as UnpicklerBase
Traceback (most recent call last):
  File "<console>", line 1, in <module>

ImportError: No module named zodbpickle.pickle
>>> from pickle import Unpickler as UnpicklerBase
>>>  quit()

This shows that the Zenoss environment cannot find zodbpickle.pickle but can find pickle.  Make sure you get yourself out of zendmd with a quit() - you can cause lots of damage with incautious commands in here!

I am running Zenoss 4.2.5 with the sup (patch) 743.

Cheers,
Jane

Rob Dearing

unread,
Dec 21, 2022, 10:49:19 AM12/21/22
to Zenoss Core
Welcome to the Zenoss dmd command shell!
'dmd' is bound to the DataRoot. 'zhelp()' to get a list of commands.
Use TAB-TAB to see a list of zendmd related commands.
Tab completion also works for objects -- hit tab after an object name and '.'
 (eg dmd. + tab-key).

>>> from zodbpickle.pickle import Unpickler as UnpicklerBase
Traceback (most recent call last):
  File "<console>", line 1, in <module>
ImportError: No module named zodbpickle.pickle
>>> from pickle import Unpickler as UnpicklerBase
>>> quit()

Jane Curry

unread,
Dec 21, 2022, 11:24:13 AM12/21/22
to Zenoss Core
OK you have the same situation as me.
I have tried reinstalling the 2.0.0 version of the toolbox tools and it seems to fix the problem.
I have updated the github repositoryfor the toolbox tools at https://github.com/jcurry/Zenoss-Toolbox   and explicitly
included a 2.0.0 and a 2.0.3 version of the zip file.  I have also added a README to explain what we have seen.

I made sure I had a VMware snapshot of my Zenoss environment before messing about back-levelling the tools and I would suggest anyone
else ensures they also have a backup position.  That said, it worked for me.

Cheers,
Jane

Rob Dearing

unread,
Dec 22, 2022, 3:20:12 AM12/22/22
to Zenoss Core
2..0.0 is running zodbscan - 2.0.3 still had the pickle problem.  Hopefully running through the tools will resolve.

Rob Dearing

unread,
Dec 22, 2022, 3:24:54 AM12/22/22
to Zenoss Core
zodbscan found errors (as expected given that I'm trying to get this working) - findposkeyerror repaired all 17 errors and the two objects I couldn't work with are working fine again.  Thank you so much for your time and help with this.

Rob Dearing

unread,
Dec 22, 2022, 3:59:27 AM12/22/22
to Zenoss Core
Not quite as happy as I thought - I've got one rogue device to delete - I'm at the point in the troubleshooting of removing from the class but the class name has spaces in it - couldn't find a guide covering how to trap spaces - sorry!

Jane Curry

unread,
Dec 22, 2022, 5:25:00 AM12/22/22
to Zenoss Core
How are you doing your class removal?  Via a command-line script or zendmd???  Anything that has white space in a string, put quotes around it - either single quote or double quote will work equally well (obviously, provided they are paired).

Sounds like you are getting there though :)
Cheers,
Jane
Message has been deleted

Rob Dearing

unread,
Dec 22, 2022, 5:35:59 AM12/22/22
to Zenoss Core
dmd.Devices.Network.Switch.Edge Switches.devices._objects.clear()

Can't work out where the quotes go - every combination I try gives a syntax error...



Jane Curry

unread,
Dec 22, 2022, 6:00:11 AM12/22/22
to Zenoss Core
Are you just down to 1 offending device which is in this Edge Switches class??  If so, have a look at this zendmd snippet and hopefully it will get you there.  Basically you specify the class you want as a string variable and then use the variable:

>>> c = dmd.Devices.Network.Switch
>>> c
<DeviceClass at /zport/dmd/Devices/Network/Switch>
>>> for sc in c.getSubOrganizers():
...   print sc
...
<DeviceClass at Edge Switches>
>>> for sc in c.getSubOrganizers():
...   if sc.id == 'Edge Switches':
...     print sc.id
...     for d in sc.devices._objects:
...       print d
...   else:
...       print "Not Edge Switches"
...
Edge Switches
10.74.201.8
>>>

Cheers,
Jane

Rob Dearing

unread,
Dec 22, 2022, 7:57:20 AM12/22/22
to Zenoss Core
All but there now - certainly tidier!  Merry Christmas!
Reply all
Reply to author
Forward
0 new messages