zabbix配置了邮件报警,发现不能发送邮件。检查了脚本没有问题,可以通过脚本直接发送邮件,脚本的权限也给了全部可执行;动作的设置也对照官方文档检查了一遍没有问题。
参考了以下两个博主的解决方法,已解决:
https://www.e-learn.cn/content/qita/2363235
https://blog.csdn.net/bacteriumX/article/details/83046595
1.检查用户组是否给了对应的主机组读写权限
2.在/etc/zabbix/zabbix_server.conf配置文件中修改执行脚本的用户
# will try to switch to the user specified by the User configuration option instead.
# Has no effect if started under a regular user.
# 0 - do not allow
# 1 - allow
#
# Mandatory: no
# Default:
AllowRoot=1
### Option: User
# Drop privileges to a specific, existing user on the system.
# Only has effect if run as 'root' and AllowRoot is disabled.
#
# Mandatory: no
# Default:
User=root