Replace mail subject "Resource limit (matched|succeeded) ..." with more specific one

Issue #364 on hold
Ulrich Windl created an issue

Currently monit messgaes have a subject like this pattern: "Resource limit (succeeded|matched) $hostname". I'm not very happy with it because: 1) The hostname seems somewhat redundant, as it should be obvious from the "From" address of the message where the message originated. 2) If you have several messages from one host, the only thing you see is a set of "matched|succeeded" subjects, without any clue what happened before you read the actual messages. Also sorting by subject is not very helpful in this case.

In the "Description" however you see (for example) "cpu system usage ...". I can imagine the following improvements: 1) Replace "Resource limit" with "cpu system usage" (or corresponding) in the subject 2) If you leave out the actual value in the subject, sorting by subject may be more helpful, but if you include the current reading (the cpu usage), one could get a quick overview what happened from the subjects. 3) I don't think adding the trigger condition to the subject is really helpful (the user either knows it, or can look it up easily)

If you read your messages as soon as they arrive the change request seems to have little benefit, but if you have 40 messages from monit after the weekend, one may appreciate more specific subjects.

Comments (3)

  1. Tildeslash repo owner

    Currently resource usage tests like CPU, memory, space usage, etc. share the same event type ("resource"). The problem is, that the service state is currently described by a signed 32-bit events bitmap, where the available event types are already almost exhausted. We will extend it and use specific event types for each test as part of work on next M/Monit release, which needs to be updated too, to be able to work with these new event types.

  2. Ulrich Windl reporter

    I don't understand why a new event type is needed to change the text of the EMail subject.

  3. Tildeslash repo owner

    The default subject template is: "monit alert -- $EVENT $SERVICE". The $EVENT is expanded into the event description, which in the case of "resource" event type is "Resource limit ...". More fine-grained event types will allow to describe the event better.

    You can also override the default subject using a "set mail-format" statement, for example to place event description to it:

    set mail-format {
        subject: monit alert --  $SERVICE $DESCRIPTION
    }
    

    See monit manual for more details about the mail-format: https://mmonit.com/monit/documentation/monit.html#Message-format

  4. Log in to comment