<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Note that lots of network check ( the ones defined in bb-services )
will not report statuses on a line starting with &color, they start
with "Service..." . The following perl snippet is what I use to pick
out statuses in my custom notification script. <br>
<br>
<br>
        $subject="$ENV{BBHOSTSVC}: $ENV{BBCOLORLEVEL} ";<br>
<br>
        foreach( split('\n',$ENV{BBALPHAMSG}) ) {<br>
                if ( /^\&(yellow|red|purple)/ ){<br>
                        $message .= $_;<br>
                }<br>
                if ( /^Service.* not OK/ ){<br>
                        $message = $_;<br>
                }<br>
        }<br>
<br>
<br>
Then use smtp mail to send out an email, you can concatenate $subject
and $message togheter to if you whish to send out a message with no
subject, nice for phones and pagers.<br>
<br>
Enjoy<br>
<br>
<br>
<pre class="moz-signature" cols="72">Daniel Bourque
Systems/Network Administrator
Weather Data Inc

Office (316) 266-8013
Office (316) 265-9127 ext. 3013
Mobile (316) 640-1024
</pre>
<br>
<br>
Henrik Stoerner wrote:
<blockquote cite="mid20070621072222.GB18338@hswn.dk" type="cite">
  <pre wrap="">On Thu, Jun 21, 2007 at 03:05:28PM +0800, case wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Mail message would include specific information about related process or
service' name  if we use MAIL in hobbit-alerts.cfg, e.g. "&red Cisco
Systems, Inc. VPN Service - Stopped".

How can we display similar messages in alert script while a process or
service triggers the alert?
    </pre>
  </blockquote>
  <pre wrap=""><!---->
The full status message text is passed in the BBALPHAMSG env. variable.
Process that to pick out lines with "&red", "&yellow" and so on. E.g.

   echo "$BBALPHAMSG" | egrep "^&red|&yellow"


Regards,
Henrik


To unsubscribe from the hobbit list, send an e-mail to
<a class="moz-txt-link-abbreviated" href="mailto:hobbit-unsubscribe@hswn.dk">hobbit-unsubscribe@hswn.dk</a>


  </pre>
</blockquote>
</body>
</html>