TECHZEN Zenoss User Community ARCHIVE  

adding manufacturers and products programaticaly

Subject: adding manufacturers and products programaticaly
Author: Charles Bueche
Posted: 2015-01-29 04:03

Hi all,

I'm running many instances of Zenoss Core 4.x on CentOS. Our network team keep adding Cisco gear to our networks before the device paint has dried. As Cisco keeps adding new models to its product line, keeping all our Zenoss instances up-to-date in regards to the product key --> product name is a task I would like to automate.

So my question is, how can I read existing mappings from the manufacturer/product table and add the missing ones using dmd
I know how to script with dmd & Python, the question is what are the correct objects I should read and manipulate.

TIA,
Charles



Subject: you're asking a pretty
Author: Andrew Kirch
Posted: 2015-01-29 13:31

you're asking a pretty specific development question, I'd recommend joining us for Developer's Hours to get one of our devs to answer it for you. Dev Hours are found on IRC twice a week, and you can refer to the schedule here: http://www.zenoss.org/blog/201501/q1-dev-hours

Andrew Kirch

akirch@gvit.com

Need Zenoss support, consulting or custom development Look no further. Email or PM me!

Ready for Distributed Topology (collectors) for Zenoss 5 Coming May 1st from GoVanguard



Subject: Get the JSON API kit from
Author: [Not Specified]
Posted: 2015-01-29 14:08

Get the JSON API kit from here: http://wiki.zenoss.org/Working_with_the_JSON_API

then:

zenoss_api device_router Device_Router getManufacturerNames ''

zenoss_api device_router DeviceRouter getHardwareProductNames '{"manufacturer":"Cisco"}'

I don't see a JSON method to load them. Firebug shows how it the GUI does it, it POSTs into the manufacturer URL e.g.

http://yerzenoss:8080/zport/dmd/Manufacturers/Cisco

a string like:

filter=&tableName=manufacturerproducts&zenScreenName=viewManufacturerOverview.pt&start%3Aint=0&batchSize=40&prodName=davetesthw2&manage_addHardware%3Amethod=OK

You could automate that with a bunch of 'curl' POSTs

Hope this helps,

Dave

p.s. themost useful tools for working with Zenoss: the JSON API i listed above and the Firebug plugin for Firefox. Oh, and Perl module Parse::JSON.

Dave



Subject: Ah sorry this doesn't get you
Author: [Not Specified]
Posted: 2015-01-29 14:17

Sorry I misread the part about the keys. I don't see that in the API, but I could figure out how to screen scrape it from a CURL. So this doesn't get you the keys in/out but maybe it points you in the right direction...



Subject: ok thanks for your answers, I
Author: Charles Bueche
Posted: 2015-02-27 02:18

ok thanks for your answers, I will try to do something around them.



< Previous
Error in event.log
  Next
How to create multi-metric event or trigger alert
>