- edited description
Add an unique Identifier per alert
Hi all,
While sending alerts and recovery messages (success states) via mail or to an API using curl, there is no assignment between alerts and recoveries.
A unique identifier within an alert message could do the trick. This alert message ID could be stored in an environment variable f.e. $MONIT_ALERT_ID. Based on this ID you could use this to get the assignment between the alert and the recovery.
Is it possible to create such a functionality?
Comments (6)
-
reporter -
reporter - marked as minor
-
Hello Julian,
a nice idea, to get a useful event id I use the data from the “Event_Table” (from event.c) to get an id. An environment variable to get this id is a good idea and more easy.I use the “MONIT_EVENT” and a list to use the id from “Event_Table” in my scripts.
A suggestion only,
Lutz
-
Hello Julian,
have a look to the monit archive file monit-5.28.0-suse12eventid-x64.tar.gz on https://bitbucket.org/lutzmad/monit/downloads/This is a test version only.
I added my code to get the internal used event id (in a textual format) in the new environment variable MONIT_EVENT_ID to monit 5.28.0.
The MONIT_EVENT_ID is a textual form of the internal used event id, I use this event id in the past in addition to the service name and the system name to correlate the error and the succeed events.You can do some more/additional tests.
I will make a pull request as soon as possible.With regards,
Lutz -
p.s.
For a list of the used ids, the values from the first column are used, see https://mmonit.com/monit/documentation/monit.html#Setting-an-event-filter -
I removed my code changes, I got no feedback, this seems not the solution Julian is interesting in.
With regards,
Lutz - Log in to comment