定义Media:

Administration--Media types--Create Media types or Edit

注:smtp email选项框里@后面需要写域名,不能写IP,如:zabbix@mail.com而不是zabbix@172.24.17.130

wKioL1cg3NCC087cAABiWUvoxMk719.png

添加用户和组:

Administration--Users--User groups--Create user group

wKiom1cg3FbiqrOkAACXSH8WGdg212.png

可以点击组给组添加权限,在该组的用户也会拥有相应的权限

Administration--Users--Users---Create User


wKiom1cg3IKSjJe7AABmQe0WJlk950.png

添加用户的Media(Administration--Users--Users--tom--Media

Use if severity是该用户关心的事件级别

wKioL1cg3XHjkrTvAAAsth4Y3Kw740.png

wKiom1cg3Lvw8jsdAAA5AFaMiVE922.pngwKioL1cg3cDwWRGIAACGh9EQ2zU805.png

创建Action:

Configuration--Actions--Create Action:

wKiom1cg3X6yea_OAAB6X8oPc4A625.png

wKioL1cg3kmQP-dcAABR1BI4ce4298.png

wKioL1cg3krTnq7LAAClUWLbPF8477.png

做告警升级功能:

wKiom1cg3dzys1J-AABINtfcgt8658.png

wKiom1cg3dyi7DicAAByhtPVG4Q719.png

下面看看效果:

wKiom1cg3jqhzoiPAABZYnvMIDs749.png

wKioL1cg3wnxzb0MAARWcECWEWY536.png

wKiom1cg3kLQLK4WAAQ761l6Xd0596.png

wKioL1cg3xLQpHXCAARjQVGVkIQ898.png


zabbix给外网发送邮件(QQ邮箱):

[root@CentOS ~]# mkdir -p /usr/local/zabbix/share/zabbix/alertscripts

[root@CentOS ~]# cat /usr/local/zabbix/share/zabbix/alertscripts/alertscripts.sh

#!/bin/bash

echo "$3" | mutt -s "$2" "$1"

[root@CentOS ~]#

注:其中$3为邮件内容,$2为邮件标题,$1为邮件地址

Administration---Media Types---Create Media Type

wKioL1cg31nRHbjPAAA9euv0pwA964.png

wKiom1cg3o6QiqCCAABCNygQG0c555.png

Administration---Users---Media---Edit

wKioL1cg332A_IzdAAAtvHtXOng395.png

wKioL1cg333D-4RCAAAwMbHnnRE324.png

编辑Action的邮件发送方式:

wKiom1cg3uLR2XezAAA2HFX_e6g230.png

触发告警:

wKiom1cg3xWjrYSWAAKqkAHC48s592.png

wKioL1cg3-GSLWUjAAFmDbV2iF4649.png

wKiom1cg3xfjoh2BAAFgfme4pf0231.png

zabbix先执行远程命令再发送告警邮件

wKioL1cg4BWSRYWRAABYGYN_4Z0323.png

wKiom1cg30vD0-KsAACtt_7bpKw591.png

wKiom1cg30vC4j_tAAAsyvlJYxE657.png

zabbix ALL=NOPASSWD: ALL
zabbix ALL=NOPASSWD: /etc/init.d/vsftpd restart

这样也行的。。

wKioL1cg4ELRvyYkAACPTEc8JLU386.png

wKioL1cg4EKRX0mOAAAeNfu3T_Q816.png