[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mon
Subject:    Re: Using the get() client function
From:       Jim Trocki <trockij () transmeta ! com>
Date:       2004-06-18 17:07:45
Message-ID: Pine.LNX.4.44.0406180956060.18059-100000 () dp ! transmeta ! com
[Download RAW message or body]

On Fri, 18 Jun 2004, Tim Klein wrote:

> watch Traps
>      service testtrap
>          MY_KEYWORD=Hello

this syntax will set the environment variable MY_KEYWORD to "Hello" for
monitors and alerts in that service.

> $kwd = $session->get("Traps", "testtrap", "MY_KEYWORD");
> 
> I expect the value of $kwd to be "Hello", but instead it's
> always the empty string (not undefined, as would be expected
> if the get() command failed for some reason).

the function of "get" is to retrieve settings which were parsed by
the config file, and also "internal" variables kept by mon while it is
running, such as the time until the next monitor invocation, alert counts,
etc. technically the "get" command will retrieve any scalar value stored
in %{$watch->{$group}->{$service}}. the environment vars are stored there,
but it's stored as a hash, not a scalar.

maybe the right thing to do here would be to add another command called
"getenv" or something which will return the list of env variables defined
for a service.


_______________________________________________
mon mailing list
mon@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/mon
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic