On Fri, 15 Jun 2007, Ben Ragg wrote:

> Hi Guys,
>
> I've been running mon with warnings on, and cleaning up some of the code
> (also modifying it to do add a few features we need). I'm a little bit
> stumped with this line in sub depend { }
>
> my $e = eval("$DEP_EVAL_SANDBOX $depend");
>
> $DEP_EVAL_SANDBOX seems to be the cause of the message "Use of
> uninitialized value in concatenation (.) or string" does anyone know
> what it's actually there for?

The purpose is to provide a separate namespace for the eval'd dependency code,
which comes from the "depend" entries in the configuration file. This is so one
does not inadvertently modify the state of the data structures with the
depend expression.

However, I added the $DEP_EVAL_SANDBOX but didn't give it a value yet.
It should be something like:

     package MonDep;
     $sref = \%{$main::watch{$group}->{$service}};

...and whatever other initialization should be done for the eval. The
initialization of this var should be set right before the eval so that
the MonDep namespace can get the current data from main::.

In its current state you could safely remove it from the eval, or you could
experiment with the "package" namespace setting and let us know how you make
out.

> If anyone knows the purpose of $sref->{"dep_memory"} it'd also be
> greatly appreciated.

There's an entry in the man page for it.

_______________________________________________
mon mailing list
mon@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/mon

Reply via email to