[Top][All Lists]

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

How do you set different e-mail subjects per alert?

From: Adam Nielsen
Subject: How do you set different e-mail subjects per alert?
Date: Tue, 21 Aug 2012 13:07:34 +1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1

Hi all,

I have a bunch of tests which do somewhat cryptic things (like checking timestamps of log files), so because a check failure doesn't immediately explain what the problem is I would like to include a more descriptive message in the e-mail subject of the alert.

Looking at the Monit documentation, I should be able to do something like this:

check file import.lastrun with path /var/lib/import.lastrun
  if timestamp > 28 hours then
    alert address@hidden with mail-format { subject: "XYZ import error" }

Unfortunately this gives me the following error:

  /etc/monit/monitrc:3: Error: syntax error 'address@hidden'

I'm not sure why it's rejecting the e-mail address, as that's the way the command is listed in the documentation. I don't really want to specify the e-mail address anyway, as I want all alerts to go to the same place, as specified by the "set alert" command.

So if I leave the address off, hoping it will use the default, I then get this error:

  /etc/monit/monitrc:3: Error: syntax error 'mail-format'

I'm a bit confused as I can't see what I am doing differently to the examples in the docs.

Can anyone advise how to change the e-mail subject for specific alert messages?

Many thanks,

reply via email to

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