腳本的位置在vim /etc/zabbix/zabbix_server.confvim
AlertScriptsPath=/usr/lib/zabbix/alertscripts 腳本放在這個文件夾下bash
給腳本zabbix權限ide
然後chmod +x 腳本server
#!/bin/bash
mail=$1
title=$2
message=$3ip
echo "${message}" | /usr/bin/iconv -t GB2312 -f UTF-8 | mailx -s "${title}" ${mail} >> /tmp/mailx.log 2>&1it
exit $?class