TECHZEN Zenoss User Community ARCHIVE  

Deleting device properties that cause poskeyerrors

Subject: Deleting device properties that cause poskeyerrors
Author: Jane Curry
Posted: 2017-10-11 07:10

There has been an IRC discussion recently where a device's macaddresses attribute could not be deleted.  It first showed up as a poskeyerror that none of the toolbox tools could fix.  Problem, in this case, was to do with the macaddresses attrribute of the device.  Tried various things in zendmd to delete the device and its interfaces, none of which worked.   See http://zenpackers.readthedocs.io/en/latest/bad_relations.html   for some suggestions.

In the end, cluther provided the right trick. In zendmd:
device = find('<id of device>')
device.macaddresses                                   (Gave the poskeyerror)

device.macaddresses = None ; commit()
for i in device.os.interfaces(): i.index_object() ; commit()

cluther comments:
"device.macaddresses is only there as a way to quickly lookup all of the MAC addresses on all of a device's interfaces without having to look at each interface. When the interfaces are indexed, they add their MAC address to their device's macaddresses property. In your case it seems that ZODB has lost track of that property (POSKeyError). Hopefully we can just replace it. "

Cheers,
Jane

------------------------------
Jane Curry
Skills 1st United Kingdom
jane.curry@skills-1st.co.uk
------------------------------


Subject: RE: Deleting device properties that cause poskeyerrors
Author: Theodore Trubetskoy
Posted: 2019-02-04 11:33

Thank you, this helped me to fix a very stubborn poskeyerror, I didn't know what to do with for a long time.

------------------------------
Theodore Trubetskoy
Skycreek Corp
------------------------------


Subject: RE: Deleting device properties that cause poskeyerrors
Author: Jane Curry
Posted: 2019-02-05 05:08

You are very welcome!

Just a general heads-up to everyone, "cluther" doesn't often post here or on IRC but if he does - trust me - his posts are gold dust!

Thanks "cluther".

Cheers,
Jane

------------------------------
Jane Curry
Skills 1st United Kingdom
jane.curry@skills-1st.co.uk
------------------------------


< Previous
Broken Device - Completely unable to remove and cannot install zenpack
  Next
Functional logs in zenoss
>