Kris Springer's Tech Blog - Xymon Custom Email Alerts
Xymon Custom Email Alerts
7-9-20 Kris Springer
I have been using Xymon Monitoring for many years. The default email alerts have always felt a bit clunky and some are too verbose for mobile devices. Xymon has a built-in 'sms' style of messages, but that stripped away too much information. I wanted something clean and concise, but I still needed the content visible in the email body. So after some web searching and Xymon Mailing List assistance I landed on a simple solution. I made my own alert script that allows me to theme it however I wish.
Here's the steps to accomplish the goal.
Use the following commands to create the email_script.sh file.
NOTE: my Xymon server is located in /home/xymon/server/ Make adjustments to your path if yours is located somewhere else.
Copy this content into the file and save it. Most of it is basic html so you can change it however you want. I added my server's logo since I have multiple company's systems, and made it clickable to take me directly to the hosts status page.
NOTICE=`echo "$BBALPHAMSG" | grep -c INFO`
if [ $RECOVERED -eq 1 ];
" | mailx -a 'Content-Type: text/html' -s "$BBHOSTSVC (Recovered)" $RCPT
elif [ $NOTICE -gt 0 ];