<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
To close the loop on this topic, here's the final solution I came up
with. This includes instructions.<br>
<a href="https://krisspringer.com/posts/xymon-email-alerts.php">https://krisspringer.com/posts/xymon-email-alerts.php</a><br>
<br>
<pre class="moz-signature" cols="72">Thank You,
Systems Admin
I/O Network Administration
<a class="moz-txt-link-freetext" href="https://www.ionetworkadmin.com">https://www.ionetworkadmin.com</a>
</pre>
<div class="moz-cite-prefix">On 7/5/20 7:52 PM, Jeremy Laidman
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CACO=ejz7dvqBgOUU_kkQOh4qcS+xV9LH5ZUC4R62TPb17tOaHw@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<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"
moz-do-not-send="true">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"
moz-do-not-send="true">RCPT@sms.example.org</a>"<br>
Server="<a href="http://smtp.example.org"
moz-do-not-send="true">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>
<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"
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">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"
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>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Xymon mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Xymon@xymon.com">Xymon@xymon.com</a>
<a class="moz-txt-link-freetext" href="http://lists.xymon.com/mailman/listinfo/xymon">http://lists.xymon.com/mailman/listinfo/xymon</a>
</pre>
</blockquote>
<br>
</body>
</html>