monit-general
[Top][All Lists]
Advanced

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

Re: [Q] Alert string


From: Jan-Henrik Haukeland
Subject: Re: [Q] Alert string
Date: 30 Apr 2003 19:21:54 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Civil Service)

Christian Hopp <address@hidden> writes:

> On Wed, 30 Apr 2003, Jan-Henrik Haukeland wrote:
> 
> >
> > Does anyone use the alert statement with a single username instead of
> > a full email address? Like "alert foobar" instead of "alert
> > address@hidden" If the former is used monit adds the hostname to the
> > username to compose a "real" email address, as shown in this excerpt
> > from the parser:
> 
> Not me... but user who do not read the list might use it.

Well, we could write a notice in the changelog. It's a little known
feature (it's not documented AFAIK) and I doubt it's in use.

> > alertmail       : ALERT MAILADDR { $<string>$= $2; }
> >                 | ALERT STRING { $<string>$= append_hostname($2); }
*
> what about something like
> 
>   alert "/bin/program --foo @ALERT@ @SERVICE@ @REPORT@ --bar " on {
>       checksum }
> 
> with @FOO@ being subsituted accordingly?

Substitution is not the biggest problem, the problem is the semantics
of the ALERT STRING statement. The meaning of ALERT STRING now is that
STRING denote a user name which should be prepended to @hostname to
build an email address, i.e. it's a shortcut for those who do not have
the energy to add the full email address like "ALERT address@hidden"
but instead can write "ALERT user" and monit will add @hostname
automatically.

The lexer says that a STRING is any char without whitespace and/or
chars enclosed by " or '.  E.g. this_is_a_string or "this is a string"
are both parsed to the STRING token. I need the second variant and
don't care to change the lexer/parser for this. In other words I want
to change the semantics of ALERT STRING and say that the ALERT STRING
statement should be interpreted as an ALERT STRING where STRING is a
command to run.

What do you think?

-- 
Jan-Henrik Haukeland




reply via email to

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