Linux监控和安全运维 2.0 zabbix配置邮件告警
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Linux监控和安全运维 2.0 zabbix配置邮件告警相关的知识,希望对你有一定的参考价值。
1.发邮件启动postfix
/etc/init.d/postfix start
mail -s "test" 836503270@qq.com < /etc/inittab
mailq
查看发送结果
2.配置发邮件文件
mkdir -p /home/zabbix/bin
vim /home/zabbix/bin/baojing.sh
#! /bin/bash echo "$3" |/bin/mail -s "$2" $1
chmod +x /home/zabbix/bin/baojing.sh
修改zabbix服务器配置文件
vim /etc/zabbix/zabbix_server.conf
AlertScriptsPath=/var/lib/zabbixsrv/alertscripts 改为 AlertScriptsPath=/home/zabbix/bin ExternalScripts=/var/lib/zabbixsrv/externalscripts 改为 ExternalScripts=/home/zabbix/bin
3.web
Administration - Media types - create media type
Type script
script name baojing.sh
save
4.创建用户
Administration - users - user - create user
alias test1
name denny
surname admin
passwd admin
paddwd admin
groups Zabbix administrators
media - add
type baojing
send to [email protected]
add
save
5.
Configuration - Actions - create action
name baojing
operations - new
Send to Users - add - test1 -select
Send to User groups - add - Zabbix administrators
Send only to - baojing
Operation details -add
save
以上是关于Linux监控和安全运维 2.0 zabbix配置邮件告警的主要内容,如果未能解决你的问题,请参考以下文章