TECHZEN Zenoss User Community ARCHIVE  

How to automate the closing of an alert?

Subject: How to automate the closing of an alert?
Author: Larry Virden
Posted: 2016-04-06 05:55

We have cases where applications detect issues and send out alerts so someone can investigate. Reading over the documentation, the Zenoss way to do that is something called zensendevent.

What do we use when we want to close that event There are times when the events are transient and the application should indicate "never mind, the problem has been resolved", etc.

Is there a command for sending a "close event" How would the application indicate what alarm needs closed



Subject: The JSON API will be of great
Author: [Not Specified]
Posted: 2016-04-06 10:47

The JSON API will be of great usefulness in this case; there are API calls to list events, close events etc. Basically you'll need to know the event UID then use that UID to close the event.

I think I put some examples of this in the Wiki Working with the JSON API.



Subject: We need the ability to close
Author: Larry Virden
Posted: 2016-04-06 11:04

We need the ability to close externally created events.

I would presume that JSON requires one to be using the browser to execute the code

I have no experience with JSON, but my minimal exposure to it in articles seemed to indicate that the code goes into web pages.

That doesn't seem like it would work for us - our events are coming in from external sourcesvia zensendevent.

Does anyone have a tutorial on how one would write a command external to Zenoss's docker to cause a Zenoss alert to close



Subject: The JSON API doesn't require
Author: [Not Specified]
Posted: 2016-04-06 13:02

The JSON API doesn't require you to use the web browser - but it is "web" calls with JSON input.



Subject: Lvirden:
Author: [Not Specified]
Posted: 2016-04-06 21:38

Lvirden:

I hope you're well!

I would reccomend using Zensendevent to send the clear / close events. You can submit these events externally in the same way. The idea is that events can be cleared or closed by associating the clear event to the origional event using a combination of the device field and eventKey field.Here's an example:

Create the problem event:

zensendevent -c /App/MyApp-p myapp -d myAppServerHostname-s Critical -o timeout=300 y myapp_latency_exceeded "MyApp average latencyis greater than 100ms." --server=myZenossServerHostname --port=8100 --auth="admin:zenoss"

Create a 'Clear' event to close the previous event:

zensendevent -c /App/MyApp-p myapp-d myAppServerHostname-s Clear -o timeout=300 y myapp_latency_exceeded "MyApp average latencyis OK."--server=myZenossServerHostname --port=8100 --auth="admin:zenoss"

The key is the addition of that "-y" flag to ensure the problem event and clear event get associated.

--
ZenMaster Shane William Scott (Hackman238)
CTO
GoVanguard Inc.
sscott@gvit.com

ZenMaster Shane William Scott (Hackman238)

CTO

GoVanguard Inc.

sscott@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: Lvirden,
Author: [Not Specified]
Posted: 2016-04-21 02:31

Lvirden,

Excellent. Don't hesitate to reach out if you need guidanceor consulting.

ZenMaster Shane William Scott (Hackman238)

CTO

GoVanguard Inc.

sscott@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



< Previous
How to add additional SMTP host in Zenoss 4.2.4
  Next
Problem with graphs
>