TECHZEN Zenoss User Community ARCHIVE  

Event Mappings from Command Line

Subject: Event Mappings from Command Line
Author: Matt Danielson
Posted: 2018-09-04 16:20

Hello,

I am new to using Zenoss and am working to map my SNMP traps to events. This is straightforward to do from the ZenossCore GUI, but is there a way to create an event mapping from the command line or some other code? I would like to be able to start a new Zenoss instance and load in a bunch of event mappings without having to click through the GUI for each one.
I have not been able to find any documentation online, any help would be greatly appreciated!

Thanks,

------------------------------
Matt
------------------------------


Subject: RE: Event Mappings from Command Line
Author: Pheripheral Pheripheral
Posted: 2018-09-05 04:29

Hi,

To 'save' all the event mappings you've setup you can save these to a zenpack and then export the zenpack and load it into other zenoss instances to recreate the mappings.

Create a new blank zenpack via the advanced, zenpacks page and the Create a Zenpack option under the cog icon at the top of the page.
Then navigate to your event mappings or the event class that they are under and in the cog menu at the bottom left of the screen you should find an 'Add to ZenPack...' option. Click this will give you a list of zenpacks to add to. 

Once you've done all the mappings you want, go back to the zenpacks page and you should see the added mapping objects listed in the zenpack )(towards the bnottom of the zenpack page)
You can then export the zenpack to an egg file via the Export Zenpack... option in the cog menu bottom left.
Then you can load this zenpack into other zenoss and not have to recreate the mappings.

(the exported egg file is really a zip, so if you examine the contents you'll see an objects directory (Zenpacks\<name>\<othername>objects) which contains a file called objects.xml and its in here that zneoss actually saves the event mappings in xml format.)


------------------------------
Pheripheral
------------------------------


Subject: RE: Event Mappings from Command Line
Author: Matt Danielson
Posted: 2018-09-05 11:51

Thank you that's exactly what I needed!

------------------------------
Matt
------------------------------


< Previous
Use Zenoss to run SQL Query
  Next
Zenoss 6 Core notifications
>