How to Attach Files to Zabbix Alert Emails

       A few days ago, I set up a Zabbix instance to monitor server information. However, when configuring email alerts, the alert subject line displayed correctly, but the email body content kept being sent as an attachment, as shown below:

After searching online for a long time, I finally found the solution. Here it is for your reference:

#!/bin/bash
to=$1
subject=$2
body=$3
body=`echo $body|tr ‘/r’ ‘/n’`
cat < $body
EOF

The above is the format for the mail script. Personally, I’m using mailx in my environment; I haven’t tested sendmail yet. If you have any questions, feel free to leave a comment below.

Attachment Download https://www.cnop.net/uploadfile/2016/0331/20160331040120658.zip

Leave a Comment

Your email address will not be published.