Archived community.zenoss.org | full text search
Skip navigation
2669 Views 3 Replies Latest reply: Sep 28, 2011 12:53 PM by luizzmizz RSS
luizzmizz Rank: White Belt 58 posts since
May 30, 2011
Currently Being Moderated

Sep 26, 2011 5:45 AM

Trouble moving devices between deviceClasses via zendmd moveObject

Hi,

 

   recently i had about 400 discovered devices, and wanted to move them all to a new deviceClass /Devices/ToIP.

 

   i wrongly remembered some time ago I did it via device.moveObject(device, dmd.Devices.ToIP), but it seems it wasn't like that...

 

   Now i have a Discovered with 400 elements on its device counter, but with the original ten devices (before the discovery).

 

   I tried also to delete the devices under the new deviceClass /Devices/ToIP (for d in dmd.Devices.ToIP.getSubDevices(): if (condition): d.deleteDevice()), and it worked.

 

   Now for trying to take out those 400 counted devices under discovered, i'm trying to add a device with the same IP as the old (which is done without errors), the intention is to delete the device again, but the device does not appear via GUI. Via zendmd i can see it, but the deleteDevice() is yelling that the object has not a primaryAq:

 

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'

 

    The only thing i'm trying to get is to clean this mess... tried to do the deviceSearch, componentSearch and layer3_catalog repairs. But i'm still in the same place.

 

    The new (and tried to be deleted) devices don't get listed on dmd.Devices.Discovered.getSubDevices() nor dmd.Devices.ToIP.getSubDevices().

 

    Any hint? I promise i will never use moveObject if I don't understand completely its use :S.

 

 

Thanks!

More Like This

  • Retrieving data ...

Legend

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