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.
On 5/4/2015 6:54 AM, William Sanders wrote:
- snip -
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.
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
I think you will find that the text of the mail message is just the contents of the message as was generated by xymonnet in response to the failure. Look at: /xymon-cgi/svcstatus.sh?HOST=4ai1gub4x9.foo.com&SERVICE=conn
I think you'll have to write your own email generator if you want to send something else. It could be as simple as a filter which grep'd out ip addresses.
<un-solicited opinion> The members of your security office are being simple-minded drones. "OMG, it contains an ip address, it must be stopped!"
To whom are you sending these messages? Presumably they will be sent to someone who cares and who can do something to correct the problem. In both of these cases, the IP address of the system should already be known. If you are sending messages of this sort to someone who doesn't care or who can't affect a resolution, the messages are spam and should not be sent. </on-solicited opinion>
-- Do things because you should, not just because you can.
John Thurston 907-465-8591 John.Thurston at alaska.gov Enterprise Technology Services Department of Administration State of Alaska
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.
participants (3)
-
john.thurston@alaska.gov
-
john@executech.com
-
lts1809@yahoo.com