Add an unique Identifier per alert

Issue #964 new
Julian Retzbach created an issue

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)

  1. Lutz Mader

    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

  2. Lutz Mader

    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

  3. Lutz Mader

    I removed my code changes, I got no feedback, this seems not the solution Julian is interesting in.

    With regards,
    Lutz

  4. Log in to comment