Archived community.zenoss.org | full text search
Skip navigation
3515 Views 6 Replies Latest reply: Sep 30, 2011 7:39 AM by luizzmizz RSS
luizzmizz Rank: White Belt 58 posts since
May 30, 2011
Currently Being Moderated

Sep 27, 2011 5:32 AM

Trying to clean mess with devices corrupted (corrupted by me)

I did a discovery of about 350 ToIP devices, and then tried to move them from Discovered to ToIP, via moveObject (EPIC FAIL, some minutes later i saw changeDeviceClass ).

Instead of coming back to the normal situation doing moveObject to Discovered, tried to delete the devices from there, it couldn’t... Then did some zenchkrels via CLI and zendmd, with its repairs...

Well, the thing is... i left a mess. And in some point I got to move the objects back via moveObjects, but it seems it didn’t feel alright, cause, as you can see on the screenshot, those devices are now at dmd/Devices/Discovered instead of the relationship dmd/Devices/Discovered/devices. Every device is now kind of a container or Device class (at least is represented as that on zope).

The devices are not listed on Discovered.getSubDevices(), but they are listed on Discovered.getSubObjects(). The Device is also accessible via getattr(dmd.Devices.Discovered,<deviceip>).

>>> find('w.x.y.z')

>>> dev=getattr(dmd.Devices.Discovered,'w.x.y.z')

>>> dev

<Device at /zport/dmd/Devices/Discovered/w.x.y.z>

>>> dev.deviceClass()

>>> dmd.Devices.Discovered.devices()

[<Device at /zport/dmd/Devices/Discovered/devices/awelo>]

>>> #awelo is a test Device for comparing attributes

>>> dmd.Devices.Discovered.devices._add(dev)

>>> dev.deviceClass._add(dmd.Devices.Discovered)

>>> dmd.Devices.Discovered.devices()

[<Device at /zport/dmd/Devices/Discovered/devices/w.x.y.z>, <Device at /zport/dmd/Devices/Discovered/devices/awelo>]

>>> commit()

>>> dev.deleteDevice()

Traceback (most recent call last):

  File "<console>", line 1, in <module>

  File "/opt/zenoss/Products/ZenModel/Device.py", line 1842, in deleteDevice

    parent = self.getPrimaryParent()

  File "/opt/zenoss/Products/ZenRelations/PrimaryPathObjectManager.py", line 85, in getPrimaryParent

    return self.__primary_parent__.primaryAq()

AttributeError: 'NoneType' object has no attribute 'primaryAq'

>>> dev.__primary_parent__

>>> dmd.Devices.Discovered.getSubDevices()

[<Device at /zport/dmd/Devices/Discovered/devices/awelo>]

>>> dmd.Devices.Discovered.devices()

[<Device at /zport/dmd/Devices/Discovered/devices/w.x.y.z>, <Device at /zport/dmd/Devices/Discovered/devices/awelo>]

>>>

I wish i could delete all this phantom elements... any hint, please?

Attachments:
  • jcurry ZenossMaster 1,021 posts since
    Apr 15, 2008

    I would also check with ZMI (Zenoss Management Interface).  Point your browser at <your zenoss>:8080/zport/manage and navigate around that way.

     

    If you have a backup (hopefully), then you can move some stuff with the ZMI - but your mileage may vary with this

     

    Cheers,

    Jane

  • TitoOrtega Rank: White Belt 50 posts since
    Jul 14, 2011

    I feel your pain luizz. Alot of methods in zenoss are a oneway street to despair. A better backup and roll back system would really help alleviate much of these problems. I too lost an installation to this type of thing.

  • Shane Scott ZenossMaster 1,373 posts since
    Jul 6, 2009

    Luizzmizz:

     

    Ignore Tito, he's a troll.

     

    I'd be happy to try to help you delete these objects. You could try using the ._delOb method on them. If you don't have success with that, jump on to the #zenoss channel on freenode and I'll help you out interactively.

     

    Best,
    --Shane

More Like This

  • Retrieving data ...

Legend

  • Correct Answers - 4 points
  • Helpful Answers - 2 points