After installing the Zabbix, set the mail script alarm, the sent alarm content becomes tcmime.1278.1278.1724.bin or att00001.bin.
Yum-y Install MAILX Dos2unix//Installation MAILX tools and Dos2unix conversion tools
Here is the script content:
[email protected] alertscripts]# cat sendmail.sh
#!/bin/bash
#export LANG=ZH_CN. UTF-8 //solve the problem of sending the Chinese into garbled
File=/tmp/mailtmp.txt
echo "$ $" > $FILE
dos2unix-k $FILE //Resolves an issue where the content of the sent message becomes an attachment.
/bin/mail-s "$" $ < $FILE
---------------------------
In reference to the online treatment of many great gods, eventually formed the above script, solve the problem.
This article is from the "Mountain Road 18 Bend" blog, please be sure to keep this source http://kongzi68.blog.51cto.com/1432619/1637505
Linux bash mailx send mail content to an attachment Tcmime.1278.1278.1724.bin or Att00001.bin