Centos系统下载大全 | Redhat系统下载大全 | Windows2012系统下载大全 | Windows2008系统下载大全| CMS教程 | 网站地图 51运维网-专注Linux/Unix系统安全运维!
当前位置:51运维网 > 监控 > Nagios > 正文

nagios 邮箱报警 六

时间:2014-08-26 21:50 来源:未知 作者:www.51ou.com 阅读:

1  下载和安装sendEmail-v1.56.tar.gz

1
2
unzip sendEmail-v156.zip
cp sendEmail /usr/local/bin/

2 定义命令

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# 'notify-host-by-email' command definition
 
define command{
        command_name    notify-host-by-email
        command_line    /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/local/bin/sendEmail  -f yoyobj@163.com -t $CONTACTEMAIL$ -s smtp.163.com -u "** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" -xu  yoyobj@163.com -xp xxxx
        }
 
 
 
 
# 'notify-service-by-email' command definition
define command{
        command_name    notify-service-by-email
        command_line    /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n" | /usr/local/bin/sendEmail  -f yoyobj@163.com -t $CONTACTEMAIL$ -s smtp.163.com -u "** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" -xu yoyobj@163.com -xp xxxx
        }

 

3 修改联系人

1
2
3
4
5
[root@localhost objects]# cat contacts.cfg |grep email
        email                           282490146@qq.com        ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
 
 
4 重启下nagios即可

感谢您对【51运维网 http://www.51ou.com/】的支持,我们为您免费提供《nagios 邮箱报警 六》技术文章,《nagios 邮箱报警 六》详细使用和说明,有时《nagios 邮箱报警 六》可能不完善、敬请谅解!如果《nagios 邮箱报警 六》有错误请给我们留言,我们将尽快修复文章错误,如果您觉得本站不错,请分享给周围的朋友!谢谢!

顶一下
(0)
0%
踩一下
(0)
0%
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
验证码:点击我更换图片