[Xymon] Alert script "BBCOLORLEVEL" is red when recovered

Kris Springer kspringer at innovateteam.com
Wed Aug 26 17:48:17 CEST 2020


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.

elif [[ $BBALPHAMSG = *INFO* ]];
then
echo "Info found"

Kris Springer


On 8/25/20 7:32 PM, Ralph M wrote:
> Call me crazy if you like, but in the alerts.cfg file, in the list of 
> environment variables passed to the script, it says:
>
>      #    BBCOLORLEVEL  - The color of the alert: "red", "yellow" or 
> "purple"
>      ... [snip] ...
>      #    RECOVERED     - Is "1" if the service has recovered.
>
> So, um, just check $RECOVERED ??
>
>      if [ $RECOVERED -eq 1 ]; then
>           # send recovery email
>      fi
>
> Ralph Mitchell
>
>
>
> On Tue, Aug 25, 2020 at 8:04 PM Jeremy Laidman <jeremy at laidman.org 
> <mailto:jeremy at laidman.org>> wrote:
>
>     Kris
>
>     I suspect $BBCOLORLEVEL is set to the color of the original condition.
>
>     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.
>
>     Or, you can use something like this:
>
>     NEWCOL=`$XYMON $XYMSRV "xymondboard host=$BBHOSTNAME
>     test=$BBSVCNAME fields=color"`
>
>     Cheers
>     Jeremy
>
>     On Wed, 26 Aug 2020 at 08:38, Kris Springer
>     <kspringer at innovateteam.com <mailto:kspringer at innovateteam.com>>
>     wrote:
>
>         I know this is old, but it's still an issue.  I have a script
>         that uses
>         $BBCOLORLEVEL that works great, except the RECOVERED messages
>         come in as
>         Red.  They don't say 'Recovered', they say 'Red'.  I'm not
>         much of a
>         coder, but is there perhaps some way to have my bash script
>         figure out
>         if the message is a 'recovered' message and print that as the
>         BBCOLORLEVEL instead of printing Red?
>
>         -- 
>
>         Kris Springer
>
>
>         _______________________________________________
>         Xymon mailing list
>         Xymon at xymon.com <mailto:Xymon at xymon.com>
>         http://lists.xymon.com/mailman/listinfo/xymon
>
>     _______________________________________________
>     Xymon mailing list
>     Xymon at xymon.com <mailto:Xymon at xymon.com>
>     http://lists.xymon.com/mailman/listinfo/xymon
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20200826/e72cd0d1/attachment.htm>


More information about the Xymon mailing list