Jim Trocki writes:
> 
> unfortunately i neglected to add it to the man page, but there is already
> a similar capability. for example:
> 
> watch something
>     service ftp
>       interval 5m
>       monitor ftp.monitor
>       MON_VAR=this is the value
> 
> when the monitor or alert for that service is called it sets 
> the environment variable "MON_VAR" to "this is the value".
[...]
> is that what you're asking for?

Almost, though not quite.  This will work great for customizing
the alert messages (and I will start using it today, methinks).

What I was thinking of would work for adjunct programs that
aren't started by mon, and thus can't inherit environment variables.
So, imagine again a mon.cf:

  watch something
    service ftp
    interval 5m
    monitor ftp.monitor
    var url2fix "http://www.example.com/network/doc/helpdesk/ftp.fix.html";

And then an external program, like mon.cgi, could fetch this value:

   $c = new Mon::Client ( host => $monhost, port => $monport, );
   my   %opstatus = $c->list_failures();

   if (exists($opstatus{'something'}{'ftp'}{'url2fix'}))
   {
       print "Read this to fix the problem: ";
       print $opstatus{'something}{'ftp'}{'url2fix'};
   }


        -- Ed

Reply via email to