Mailing lists for ALL events (above a given threshold)?
-
I can assign a user to receive alerts for ALL events above a certain threshold (e.g. "urgent"). Is there a practical way to accomplish this for a mailing list? I realize I can create an event handler that sends to the mailing list , but rather than having to create an event handler for all possible events, I would prefer to similarly send all alerts for urgent (or greater) events to the given mailing list.
On the same line of thought, is there a way to create a general purpose event handler for any and all "urgent" events?
-
The answer to both questions is currently no. You could achieve getting all events above a threshold through a user account that forwards to all your users, i.e. alerts@mydomain. I can see the benefit of having this in the mailing list, though.
There is no way to handle all urgent events in a single handler. This one I'm not so sure i understand the wisdom in, unless you've been really exacting in what can produce events and at what levels. Can you elaborate on what you were hoping to do with it?
-
To the mailing lists question, perhaps use the user's setting on all users you wish to receive events at a threshold?
-
We have been currently accomplishing this with a user account ("operator"), but the customer desires more granularity, the kind of control that the mailing list provides.
The idea was to have all events alert the "operators" mailing list, or possibly all the "day operators", "night operators", "weekend operators", configured for appropriate schedules, etc.
The primary reason for the catch-all option is to avoid having to create event handlers for each and every possible event, when the current approach is to just alert all "urgent" or higher events to the operator. More than just the time-consuming practice of creating event handlers for all potential events, this kind of repetitive task invites mistakes, e.g. forgetting to create an EH for a new DP/event. A catch-all like the users get gives the warm fuzzy that we're not going to accidentally miss an alert.
Part of my thinking in asking this question is whether it is possible to catch all "urgent" events in the API, and possibly executing some script as a result. Any thoughts on that?
-
Yeah, I will raise the idea for that to be a feature of the mailing lists: the situation you describe is exactly why I said I could see the benefit.
I understand what you're saying about event detectors, and possibly such a thing could be added. I guess it would 99% of the time be an email saying "Hey, an uncaught event!" I will bring this up and see what people think. I believe it is possible to register for an events websocket, but it would take @terrypacker or @Jared-Wiltshire to give you a great answer about that.
I personally prefer to validate things using scripts (since it is pro-active, as opposed to waiting for this catch-all handler to show something amiss). For instance, here's a simple script that identifies point event detectors that have no handler. You could expand it to also work for Data Sources if you feel up to it, by using a mix of the keys in a data source's alarmLevel property with the data source's xid. If you export a handler for a data source event, you will see this is enough information to do the same thing I'm doing in this python script.
import json configFile = open("mango/backup/Mango-Configuration.json") config = json.load(configFile) configFile.close() eventDetectorToHandlerDict = {} for eh in config["eventHandlers"] : if eh["eventType"]["sourceType"] == "DATA_POINT" : eventDetectorToHandlerDict[eh["eventType"]["detectorXID"]] = eh for dp in config["dataPoints"] : for ed in dp["eventDetectors"] : if ed["xid"] not in eventDetectorToHandlerDict : print "I found you on '%s' your xid is '%s'!" % (dp["xid"], ed["xid"])
-
Awesome, that is very interesting and I shall devour it eagerly!
And yes, it is both proactive AND allows for automagically addressing the concern.
Thanks!
-
Most welcome. Also, I had to edit my script... tis "detectorXID" in the point event handler object.