TECHZEN Zenoss User Community ARCHIVE  

Looking for pointers to tutorials on adding buttons or menu items to Zenoss Core ...

Subject: Looking for pointers to tutorials on adding buttons or menu items to Zenoss Core interface
Author: Larry Virden
Posted: 2016-04-11 06:45

We have a requirement to provide either buttons or menu items on the event display window that allow the user to highlight an alert, click one of the two buttons, and as a result, execute a command line with information from that alert.

I am brand new to Zenoss, python, JSON, etc. and would appreciate any pointers to introductory tutorials, discussions, videos, whatever to assist us in implementing such a requirement.

Thank you



Subject: Good question! I'd suggest
Author: Andrew Kirch
Posted: 2016-04-12 09:32

Good question! I'd suggest adding a transform to the event to createclickable tags in evt.summary() or as appropriate for you. This should allow you to create context based solutions based on what caused the event to be generated.

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: Thanks for the tip
Author: Larry Virden
Posted: 2016-04-14 12:12

I've been working hard to understand things - I feel like a high school freshman with no medical experience walking into a surgery room and trying to understand everything well enough to perform the appropriate operation.

I really appreciate the help of the community. Iappreciate any help that can be offered.

Right now I'm trying to figure out how to use transform to get all the necessary bits from the alert into a format that I can then pass along to a shell command/cgi/something which then can do its own transformation into the format needed to be sent to the external system.

Are you aware of any tutorials, articles, etc. that talk in basic terms of such things

Thank you for your kind help.



Subject: This doesn't require a
Author: Andrew Kirch
Posted: 2016-04-18 13:53

This doesn't require a transform, it does require a command notification. Create a trigger that matches the events you want to run the command for, then create a notification of type "Command".

I'd have the BASH script accept command line args ($1 $2 etc). From there almost everything in an Event's Details can be passed with ${evt.foo}
eg:
Device: ${evt/device}
Component: ${evt/component}
Severity: ${evt/severity}
Time: ${evt/lastTime}
Message:${evt/message}

so for the "Command" field of the Command Notification something like:
./shellscript.sh ${evt/device} ${evt/component} #continue adding these for each event detail you need to pass to your shellscript.

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: That sounds pretty easy!
Author: Larry Virden
Posted: 2016-04-18 13:57

I really appreciate your help. I've been looking for doc that talks about this but so far my searches and that doc do not seem to be existing in the same space/time continumn.

Thank you so much!



Subject: There isn't really a doc for
Author: Andrew Kirch
Posted: 2016-04-18 16:39

There isn't really a doc for this one, it's combining the command notification with a BASH function to take command line arguments and use them. It's one of many things you'll learn over time as you discover just how truly powerful the Linux Command Line is.

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: So I am still trying to figure out how to set this up
Author: Larry Virden
Posted: 2016-04-27 06:28

So, what I am struggling with is this.

We have 2 different and unrelated shell command scripts already written to perform the actions we need. They need to be passed arguments from the appropriate alert.

However, these commands should not be executed automatically. They only are to be executed upon request from the person watching the event screen.

The expectation is that via a button, menu item, or something else, the user selects a specific alert then clicks on one of two actions. The click on the first "button" passes the alert info to the first script, which goes off and executes. The user deals with the results of the execution. Then, if necessary, the user clicks on the second "button" to cause the second script to run.

So from what I have read, this isn't exactly the way that command notification works. And I'm not certain whether it fits the "transform that creates a hyperlink" model either.

I'm trying to read the admin guides and Ms. Curry's event document to figure out how to perform this action.

If any reader happens to know of specific code that performs this type of function, I would really appreciate a pointer to something I could look at.

Thank you



Subject: One down - one to go!
Author: Larry Virden
Posted: 2016-05-04 09:25

so an A tag with HREF and target attributes is now being stored within the summary column, with the description of the alert itself going into the description message column.

This gives our users the ability to click on the hyperlink displayed in the column to open a new tab containing extended documentation for the alert.

We have another user requirement that I am struggling to resolve.

The requirement is that a user interface widget (button, menu item, ) is needed that allows a user to specifically indicate that a selected alert's details need to be passed to a command line shell.

This is not something that can automatically execute every time an alert appears - it needs to occur when a user takes some specific non-state changing action.

I see very little Core 5 documentation that discusses taking actions on alerts - other than some fixed actions like close, reopen, etc.

The docs for the user command menu seem to indicate that only details relating to devices can be accessed by command line calls there.

Is there a similar menu available for events Is there anyone who has written a zenpack to create a similar menu for events

Most of the zenpacks descriptions seem to focus on monitoring specific devices rather than adding stuff like this.



Subject: You can add buttons anywhere.
Author: Jay Stanley
Posted: 2016-05-31 09:54

You can add buttons anywhere.

A good example is Jane Curry'shttps://github.com/jcurry/ZenPacks.skills1st.MenuExamples

and examples from the new dev guide

https://github.com/ZenossDevGuide



Subject: Thank you very much
Author: Larry Virden
Posted: 2016-05-31 10:17

Thank you very much for your pointers. I hope to eventually learn enough about Zenoss's environment that I will be able to make use of these resources.



< Previous
zenoss virtual appliance help
  Next
unknown dmp file in /tmp folder
>