monit-general
[Top][All Lists]
Advanced

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

Re: [Patch] Revised resource-support [aka. "proc"-support]


From: Jan-Henrik Haukeland
Subject: Re: [Patch] Revised resource-support [aka. "proc"-support]
Date: 13 Aug 2002 17:26:13 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Civil Service)

Christian Hopp <address@hidden> writes:

> > Well it's going to look like: IF(expr) ? While this is a better syntax
> > IMHO: IF(expr) THEN action. And it's really not that much more text.
> 
> Puny c-like programmer. (-: Who needs nowadays brackets for
> expression. 

Actually this wasn't the point I was trying to make. It was more that
the statement: 
  <resource> [<operator>] <limit> [<cycles>] [ACTION <action>]
without an action at the end would look like a single IF expr. I would
like to change it to:

  <resource> <operator> <limit> [<cycles>] ACTION 

Assuming [] denotes optional statement. This way you will have the
following abstract statement. IF expr THEN ACTION instead of IF expr
which implies IF expr THEN ALERT. The same with operator; it's should
be required to make a statement explicitly clear. cycles on the other
hand are optional and means that the test is done for every cycles
(but this is probably allready taken care of if I know you).

> Somebody has made it a whitespace. 

That would be me :)

> I know, it's there to express, e.g.
> 
>    start program = "/bin/true"

Just to make it look nicer.

> Whether we...
> 
> 1) disallow "=" as whitespace completely
> 2) allow "=" only in certain positions, like
>     [set|start|stop] <options> [[=|] <value>]
> 3) disable "mathematical" operator short cuts "<,>,=,!=".
> 
> 1) is easy, but not nice,  users might have to change config files
> 3) is easy, but comparison looks much nicer with "<,>,=,!="
> 2) a pile of work but enables 1&3.

The simplest solution is to introduce a new operator for equality,
namely '=='. This is well known in C.

> Right now it's something in between. "<,>,!=" do work, "=" doesn't.

We should really have an operator for equality. Either you use '==' or
you will have to change all production rules in the grammer. For instance:

start           : START PATH { current->start= $2; }
                | START EQUAL PATH { current->start= $2; }
                ;

Or maybe we can get away with (probably)

start           : START EQUAL PATH { current->start= $2; }
                ;

But again I suggest that EQUAL is set to '==' it's easier that way.

> [udp test]
> I think thats okay.  Maybe a note in the readme would be nice, in case
> someone has trouble with it.

Sure.

-- 
Jan-Henrik Haukeland




reply via email to

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