<div dir="ltr">Kris<div><br></div><div>On rare occasions, we enable an SMS alerting script, using the SMS format. We added to alerts.cfg:</div><div><br></div><div>$SendSms=/usr/local/sbin/xymon-sendsms.sh<br></div><div>$Mobile1=0123456789</div><div>$Mobile1=0123456798</div><div><br></div><div>Then:</div><div><br></div><div>HOST=%^hostname00[0-3].<a href="http://example.com">example.com</a> SERVICE=conn</div><div>    SCRIPT $SendSMS $Mobile1 FORMAT=SMS COLOR=red REPEAT=60 DURATION>10 RECOVERED</div><div><div>    SCRIPT $SendSMS $Mobile2 FORMAT=SMS COLOR=red REPEAT=60 DURATION>10 RECOVERED</div><div><br></div><div>The script:</div><div><br></div><div>#!/bin/sh<br><br># This script is called by the xymon alerts sub-system (see /etc/xymon/alerts.cfg)<br># and simply sends an email to an Email -> SMS gateway.<br># The email is sent using the smtp-source program due to mail being disabled on the<br># Xymon server for security and reliability reasons.<br># This script expects the following environmental variables to be set when called:<br># BBALPHAMSG   - The full text of the status log triggering the alert<br># RCPT         - The recipient mobile number.<br><br>LogFile="/var/log/xymon/xymon-sendsms.log"<br><br>Sender="xymon@`/bin/hostname -f`"<br>Recipient="$<a href="mailto:RCPT@sms.example.org">RCPT@sms.example.org</a>"<br>Server="<a href="http://smtp.example.org">smtp.example.org</a>"<br>Subject="Xymon Alert"<br><br>Date="`/bin/date`"<br>Smtp="/usr/sbin/smtp-source"<br><br>{<br>        echo "Subject: $Subject"<br>        echo "Date: $Date"<br>        echo "To: $Recipient"<br>        echo ""<br>        echo "$BBALPHAMSG"<br>} | $Smtp -M `hostname -f` -f "$Sender" -t "$Recipient" -F /dev/stdin $Server<br><br>echo "$Date" >> $LogFile<br>echo "$Recipient" >> $LogFile<br>echo "$BBALPHAMSG" >> $LogFile<br>echo "" >> $LogFile<br></div><div><br></div><div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 19 May 2020 at 07:06, Kris Springer <<a href="mailto:kspringer@innovateteam.com">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">Hi, I've been looking into customizing the email alerts that get sent <br>
from our xymon server.  I've played with the SMS option and like the <br>
minimal content of the body of the email, but I still want a customized <br>
Subject and I want the alert URL included in the email body.  I assume <br>
the SCRIPT option will accomplish this.  Does anyone have a simple <br>
script that they can share?<br>
Thanks.<br>
<br>
Kris Springer<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>