![]() |
![]() |
Subject: | Duplicate/Splintered Devices via ZenDMD - Help! |
Author: | [Not Specified] |
Posted: | 2014-03-12 15:57 |
I've been poking at zendmd lately and cleaning up my mess of a Zenoss db.
Unsurprisingly I've managed to screw something up! Doh.
I ran this little snippet below. The intention was to fix the id to match our deviceTitle... making it easier to for the techs to recognize the device when doing searches via the web ui.
for dclass in [dmd.Devices.Network.Router] + dmd.Devices.Network.Router.getSubOrganizers():
if dclass.getPrimaryId() == "/zport/dmd/Devices/Network/Router/Firewall/Juniper":
for d in dclass.devices():
if d.id != d.title:
d.id = d.title
print "{0} changed to {1}".format(d.id,d.title)
else:
print "Device {0} matches title".format(d.id)
This seemed to work at first however I later noticed that the devices I ran it on didn't show graphs in zenoss.
Eventually after a lot of experimenting I found this while browsing my devices via the Zope interface.
http://i.imgur.com/hBT3GMZ.png
You can ignore the top few. Look at the ones where the device is repeated with two names.
///////////////////////
Update:
I got some help in IRC with what I did wrong at least... I was changing the ID and in turn pointing some refs like my perf dir to places that didn't wholly exist.
I should have used something like:
d.renameDevice(d.title)
..instead of the d.id = d.title
Subject: | I gave up on restoring the |
Author: | [Not Specified] |
Posted: | 2014-03-13 11:34 |
I gave up on restoring the devices back to working. At this point I'd just like to delete them outright and recreate them using zenbatchload.
Even that's proving difficult though.
I went through all the methods described in this guide: http://fpaste.org/84498/13945709/
to try deleting the devices.
I can't find the devices anymore in ZOPE or zenoss itself but zenbatchload complains when I try to add them:
[zenoss@hydrus ~]$ zenbatchload juniper_batch2.txt
2014-03-12 15:22:20,054 INFO zen.BatchDeviceLoader: Creating device 10.201.248.11
2014-03-12 15:22:20,054 INFO zen.Device: device name '10.201.248.11' for ip '10.201.248.11'
2014-03-12 15:22:20,080 INFO zen.DeviceLoader: Ip 10.201.248.11 exists on HAIR-X37 HAIRFS04A
2014-03-12 15:22:20,080 ERROR zen.DeviceLoader: Unable to add the device 10.201.248.11
2014-03-12 15:22:20,081 ERROR zen.BatchDeviceLoader: Unable to find newly created device 10.201.248.11 -- skipping
2014-03-12 15:22:20,081 INFO zen.BatchDeviceLoader: Modeled 0 of 1 devices, with 0 errors
2014-03-12 15:22:20,082 INFO zen.BatchDeviceLoader: Unable to process 0 entries
Subject: | Used this guide along with |
Author: | [Not Specified] |
Posted: | 2014-03-13 12:27 |
Used this guide along with some help from IRC:
http://wiki.zenoss.org/PosKey_Error_Fixture
That fixed some poskey errors.. devices are still stuck in existence somewhere though.
Subject: | ... |
Author: | [Not Specified] |
Posted: | 2014-03-17 10:04 |
Perhaps these steps that I've documented will help, I use these to clean up broken devices all the time (replace DEVICE with the device name and the example path with the path to the broken device)...
< |
Previous Notifications not emailing.. |
Next Updated 4.2.4 Core to SP405 using Zenup - events broken/disappeared!!! |
> |