[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Problem with using multiple mail-format

From: Mancillas, Paul
Subject: RE: Problem with using multiple mail-format
Date: Wed, 15 Nov 2017 14:03:12 +0000


You are correct. I am trying to make the email subject line more descriptive 
(CPU, memory, etc.) instead of all of the emails saying "Resource limit 
matched". When are you planning on extending the event types? Will the new 
event types make the $EVENT more descriptive? In other words, when the CPU 
usage exceeds the threshold is $EVENT going to say something like "CPU limit 
matched" or maybe "CPU limit exceeded"? If not then will there be a way for me 
to customize the value of $EVENT for each resource type?


-----Original Message-----
From: monit-general [mailto:address@hidden On Behalf Of address@hidden
Sent: Wednesday, November 15, 2017 2:27 AM
To: This is the general mailing list for monit <address@hidden>
Subject: Re: Problem with using multiple mail-format


the "set mail-format" statement can be used only once - if you use it multiple 
times, only the last one of them will be used. Also one "check system" can be 
used only once.

It is possible to override the mail-format for each recipient in the service 
context (however in this case in won't help because of multiple "check system" 

check system $HOST
        if cpu usage > 50% for 1 cycles then alert
        alert address@hidden with mail-format {
                From: address@hidden
                Subject: [$HOST] CPU $EVENT
                Message: $DESCRIPTION
It seems to me that the reason for your configuration is to differentiate the 
catch-all "resource" type event, which is used for cpu, memory and other 
resource usage tests. We plan to extend the event types (cpu will have its own 
event, ditto for memory, space usage, etc) - i think this change will solve 
your problem as well (no need to override the mailformat - the event type will 
be more specific).

Best regards,

> On 14 Nov 2017, at 16:09, Mancillas, Paul <address@hidden> wrote:
> I am trying to setup system performance alerts using Monit 5.14. I have 
> created several configuration files in /etc/monit.d like “cpu_alert” and 
> “mem_alert”. Each of these files has a different mail-format section because 
> I want the subject of the alert mail to show which resource is being 
> overloaded. So the cpu_alert file looks like this:
> set mail-format {
>     From: address@hidden
>     Subject: [$HOST] CPU $EVENT
>     Message: $DESCRIPTION
>              $DATE
> }
> check system $HOST
>   if cpu usage > 50% for 1 cycles then alert
> And the mem_alert file looks like this:
> set mail-format {
>     From: address@hidden
>     Subject: [$HOST] Memory $EVENT
>     Message: $DESCRIPTION
>              $DATE
> }
> check system dvoellab01corp
>   if memory usage > 20% for 1 cycles then alert
> But when I tested this configuration by putting a high CPU and memory load on 
> the server all of the email alerts say that they are “CPU” alerts. It’s like 
> monit is using only the mail-format definition from the cpu_alert file and 
> ignoring the mail-format from the mem_alert file. Has anyone seen this 
> before? How can I fix this? The reason that I am using multiple configuration 
> files is because I want to be able to use a different subject line and email 
> destination for each type of resource bottleneck.
> This message (including any attachments) is confidential and intended for a 
> specific individual and purpose. If you are not the intended recipient, 
> please notify the sender immediately and delete this message.
> -- 
> To unsubscribe:

To unsubscribe:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]