/usr/local/share/zabbix/alertscripts/zabbix-mail
that sends an eMail using my already established mail infrastructure. The script uses the 3 parameters provided to as input for the mail send. In addition, I can use sendmail parameters to make the eMail appear from a zabbix user.
#!/bin/sh
export zabbixemailto="$1"
export zabbixsubject="$2"
export zabbixbody="$3"echo "$zabbixbody" > /tmp/mymailinput_$$
mail -E -s "$zabbixsubject" $zabbixemailto -- -rzabbix@codingmerc.com -FZabbix < /tmp/mymailinput_$$ rm /tmp/mymailinput_$$
Next up, all you need to do is to define your custom script as a media type like so:
06/17/2012