1
2
3
4
5
6
|
#!/bin/bash
file
=
/tmp/zabbix_mail
.txt
echo
"$3"
> $
file
dos2unix -k $
file
/bin/mail
-s
"$2"
$1 < $
file
# echo "$3" | mail -s "$2" $1 #如果发送邮件完全是英文的,可以只使用这一条
|
1
2
3
4
5
6
7
|
Host: {HOSTNAME1}
Date: {EVENT.DATE} {EVENT.TIME}
Level: {TRIGGER.SEVERITY}
Problem: {ITEM.NAME}:{ITEM.VALUE}
Item: {TRIGGER.KEY1}
CurrentStatus: {TRIGGER.STATUS}:{ITEM.VALUE1}
EventID: {EVENT.ID}
|