[Xymon] change alert email text?
John Tullis
john at executech.com
Thu May 7 07:32:46 CEST 2015
I do it with a custom script. It took me a while to get it exactly right but I love how clean my alerts look now.
I created a script that pulls whatever data in that I want to send in the email. You can add any of the fields in the alerts.cfg<http://xymon.sourceforge.net/xymon/help/manpages/man5/alerts.cfg.5.html> man page. (Side note, unless you're looking at CONN, so far the IP address isn't listed in the variable $BBALPHAMSG for the hosts I'm monitoring)
#!/bin/sh
n=$RECOVERED
if test $n -eq 0
then
<br />
<font color=#01396f size="6">Xymon Monitoring System</font>
<br />
<br />
Here are the details of your problem:
<br />
<pre>
___________________________________________________________________________________
$BBALPHAMSG
___________________________________________________________________________________
</pre>
<br />
Please log onto $BBHOSTNAME and check the $BBSVCNAME." | mail -a "Content-type: text/html;" -s "ALERT: $BBHOSTSVC is $BBCOLORLEVEL" --append=FROM:"Zymon Monitoring System <alert at company.com>" $RCPT
else
<br />
<font color=#01396f size="6">Xymon Monitoring System</font>
<br />
<br />
It looks like $BBHOSTNAME has recovered.
<br />
<pre>
___________________________________________________________________________________
$BBALPHAMSG
__________________________________________________________________________________
</pre>
<br />
$BBSVCNAME on $BBHOSTNAME has recovered." | mail -a "Content-type: text/html;" -s "NOTE:$BBSVCNAME on $BBHOSTNAME recovered" --append=FROM:"Xymon Monitoring System <alert at company.com>" $RCPT
fi
Then in your alerts file<http://xymon.sourceforge.net/xymon/help/manpages/man5/alerts.cfg.5.html>, change the second line to look like this instead of the default:
PAGE=%.*servername*
SCRIPT=/location/to/custom-alerts/alert.sh user at company.com RECOVERED REPEAT=1440 DURATION>3
Hope that helps!
John Tullis
-----Original Message-----
From: William Sanders [mailto:lts1809 at yahoo.com]
Sent: Monday, May 04, 2015 8:54 AM
To: xymon at xymon.com
Subject: change alert email text?
I'm wondering if there is a quick answer on how to change the email alert text that Xymon generates.
Specifically it is required that I remove the IP address from the email.
Example:
---
red Fri Apr 3 17:54:18 2015 conn NOT ok
Service conn on 4ai1gub4x9 is not OK : Host does not respond to ping
System unreachable for 223 poll periods (7274 seconds)
&red 10.0.0.10 is unreachable
---
would become:
---
red Fri Apr 3 17:54:18 2015 conn NOT ok
Service conn on 4ai1gub4x9 is not OK : Host does not respond to ping
System unreachable for 223 poll periods (7274 seconds)
&red 4ai1gub4x9 is unreachable
---
I can list the IPs in the hosts.cfg (will have to actually, since no DNS server is available), but before I'll be allowed to submit Xymon to our security office for testing/approval to be added to our network management has tasked me with removing the IPs from the emails.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20150507/86a449c7/attachment.html>
More information about the Xymon
mailing list