码迷,mamicode.com
首页 > 系统相关 > 详细

Linux监控和安全运维 2.0 zabbix配置邮件告警

时间:2016-01-28 00:39:38      阅读:257      评论:0      收藏:0      [点我收藏+]

标签:

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 836503270@qq.com

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配置邮件告警

标签:

原文地址:http://www.cnblogs.com/wangshaojun/p/5164960.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!