<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">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">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">Xymon@xymon.com</a><br>
<a href="http://lists.xymon.com/mailman/listinfo/xymon" rel="noreferrer" target="_blank">http://lists.xymon.com/mailman/listinfo/xymon</a><br>
</blockquote></div>
_______________________________________________<br>
Xymon mailing list<br>
<a href="mailto:Xymon@xymon.com" target="_blank">Xymon@xymon.com</a><br>
<a href="http://lists.xymon.com/mailman/listinfo/xymon" rel="noreferrer" target="_blank">http://lists.xymon.com/mailman/listinfo/xymon</a><br>
</blockquote></div></div>