<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
Thanks Ralph, I got the 'Recovered' emails working now. On to the
'Info' emails! I've tried added an elif line to look for the word
INFO in the message content, but it doesn't seem to work. Any
thoughts? Here's the line I'm using.<br>
<br>
elif [[ $BBALPHAMSG = *INFO* ]];<br>
then<br>
echo "Info found"<br>
<br>
<pre class="moz-signature" cols="72">Kris Springer
</pre>
<div class="moz-cite-prefix">On 8/25/20 7:32 PM, Ralph M wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAAEjoCWR-xWwvmLSQ=WJcKOq-8wnho8+kDPxqyETdjgjBf9pDQ@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div dir="ltr">Call me crazy if you like, but in the alerts.cfg
file, in the list of environment variables passed to the
script, it says:
<div><br>
</div>
<div> # BBCOLORLEVEL - The color of the alert: "red",
"yellow" or "purple"<br>
</div>
<div> ... [snip] ...</div>
<div> # RECOVERED - Is "1" if the service has
recovered.<br>
</div>
<div><br>
</div>
<div>So, um, just check $RECOVERED ??</div>
<div><br>
</div>
<div> if [ $RECOVERED -eq 1 ]; then</div>
<div> # send recovery email</div>
<div> fi<br>
</div>
<div><br>
</div>
<div>Ralph Mitchell</div>
<div><br>
</div>
<div><br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Tue, Aug 25, 2020 at 8:04
PM Jeremy Laidman <<a href="mailto:jeremy@laidman.org"
moz-do-not-send="true">jeremy@laidman.org</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div dir="ltr">Kris
<div><br>
</div>
<div>I suspect $BBCOLORLEVEL is set to the color of the
original condition.</div>
<div><br>
</div>
<div>According to the man page for alerts.cfg, if the word
&COLOR& is in the recipient parameter, it is
replaced by the colour of the alert. This might give the
updated colour after the alert recovered, instead of the
alert colour.</div>
<div><br>
</div>
<div>Or, you can use something like this:</div>
<div><br>
</div>
<div><font face="monospace">NEWCOL=`$XYMON $XYMSRV
"xymondboard host=$BBHOSTNAME test=$BBSVCNAME
fields=color"`</font></div>
<div><br>
</div>
<div>Cheers</div>
<div>Jeremy</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed, 26 Aug 2020 at
08:38, Kris Springer <<a
href="mailto:kspringer@innovateteam.com"
target="_blank" moz-do-not-send="true">kspringer@innovateteam.com</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">I know this is old,
but it's still an issue. I have a script that uses <br>
$BBCOLORLEVEL that works great, except the RECOVERED
messages come in as <br>
Red. They don't say 'Recovered', they say 'Red'. I'm
not much of a <br>
coder, but is there perhaps some way to have my bash
script figure out <br>
if the message is a 'recovered' message and print that
as the <br>
BBCOLORLEVEL instead of printing Red?<br>
<br>
-- <br>
<br>
Kris Springer<br>
<br>
<br>
_______________________________________________<br>
Xymon mailing list<br>
<a href="mailto:Xymon@xymon.com" target="_blank"
moz-do-not-send="true">Xymon@xymon.com</a><br>
<a href="http://lists.xymon.com/mailman/listinfo/xymon"
rel="noreferrer" target="_blank"
moz-do-not-send="true">http://lists.xymon.com/mailman/listinfo/xymon</a><br>
</blockquote>
</div>
_______________________________________________<br>
Xymon mailing list<br>
<a href="mailto:Xymon@xymon.com" target="_blank"
moz-do-not-send="true">Xymon@xymon.com</a><br>
<a href="http://lists.xymon.com/mailman/listinfo/xymon"
rel="noreferrer" target="_blank" moz-do-not-send="true">http://lists.xymon.com/mailman/listinfo/xymon</a><br>
</blockquote>
</div>
</div>
</blockquote>
<br>
</body>
</html>