免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 5772 | 回复: 9
打印 上一主题 下一主题

nagios 发邮件的一个问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-09-23 16:04 |只看该作者 |倒序浏览
20可用积分
最近我修改了一下我的nagios配置
也不知道哪儿修改错了
碰到服务停止的话就不发送邮件了。只有在主机DOWN的时候发送
请教答案啊


添加的内容如下:

host:



define host{
        use                     generic-host            ; Name of host template to use
        host_name               192.168.3.247
        alias                   WEB TEST
        address                 192.168.3.247
        check_command           check-host-alive
        max_check_attempts      10
        check_period            24x7
        notification_interval   5
        notification_period     24x7
        notification_options    d,r
        contact_groups          admins
        }
        



service:

###############################################
#
#
#  192.168.3.247   WEB
#
#
################################################
define service{
        use                             generic-service         ; Name of service template to use
        host_name                       192.168.3.247
        service_description             WEB TEST
        is_volatile                     0
        check_period                    24x7
        max_check_attempts              60
        normal_check_interval           2
        retry_check_interval            1
        contact_groups                  admins
        notification_options            w,u,c,r
        notification_interval           10
        notification_period             24x7
        check_command                   check_http
        }


当service的状态是红色的时候就不发送邮件,
service的报错时候,nagios的状态图是这样的:


是soft的

[ 本帖最后由 ppiqq 于 2008-9-25 11:48 编辑 ]

最佳答案

查看完整内容

max_check_attempts 60这个次数太大了,改小一点吧~

论坛徽章:
4
白银圣斗士
日期:2015-11-24 10:40:40技术图书徽章
日期:2015-11-26 13:47:47平安夜徽章
日期:2015-12-26 00:06:30技术图书徽章
日期:2016-07-19 13:54:03
2 [报告]
发表于 2008-09-23 16:04 |只看该作者
max_check_attempts              60
这个次数太大了,改小一点吧~

论坛徽章:
0
3 [报告]
发表于 2008-09-23 16:42 |只看该作者
你改了什么?那么不专业怎么帮你解决呢?

论坛徽章:
0
4 [报告]
发表于 2008-09-23 16:47 |只看该作者
就是增加了一个service 和 host的定义
结果就发现 当服务DOWN的时候就不能发MAIL了

添加的内容如下:

host:



define host{
        use                     generic-host            ; Name of host template to use
        host_name               192.168.3.247
        alias                   WEB TEST
        address                 192.168.3.247
        check_command           check-host-alive
        max_check_attempts      10
        check_period            24x7
        notification_interval   5
        notification_period     24x7
        notification_options    d,r
        contact_groups          admins
        }
        



service:

###############################################
#
#
#  192.168.3.247   WEB
#
#
################################################
define service{
        use                             generic-service         ; Name of service template to use
        host_name                       192.168.3.247
        service_description             WEB TEST
        is_volatile                     0
        check_period                    24x7
        max_check_attempts              60
        normal_check_interval           2
        retry_check_interval            1
        contact_groups                  admins
        notification_options            w,u,c,r
        notification_interval           10
        notification_period             24x7
        check_command                   check_http
        }

论坛徽章:
4
白银圣斗士
日期:2015-11-24 10:40:40技术图书徽章
日期:2015-11-26 13:47:47平安夜徽章
日期:2015-12-26 00:06:30技术图书徽章
日期:2016-07-19 13:54:03
5 [报告]
发表于 2008-09-24 09:41 |只看该作者
notification_options            w,u,c,r

w代表warning告警;
u代表unknown未知;
c代表critical严重;
r代表recover恢复;
d代表down奔溃。
按理说应该是警告就会报警啊
楼主再检查下

论坛徽章:
0
6 [报告]
发表于 2008-09-25 09:35 |只看该作者
原帖由 虫虫猫 于 2008-9-24 09:41 发表
notification_options            w,u,c,r

w代表warning告警;
u代表unknown未知;
c代表critical严重;
r代表recover恢复;
d代表down奔溃。
按理说应该是警告就会报警啊
楼主再检查下



谢谢你的提醒 我再查查看看啊

论坛徽章:
0
7 [报告]
发表于 2008-09-25 10:18 |只看该作者
你修改的这块跟不能发邮件好像没多大关系阿。

论坛徽章:
0
8 [报告]
发表于 2008-09-25 11:12 |只看该作者
原帖由 hotsnow 于 2008-9-25 10:18 发表
你修改的这块跟不能发邮件好像没多大关系阿。


请大哥们指教啊!!!



define contact{
        contact_name                    nagios-admin
        alias                           Nagios Admin
        service_notification_period     24x7
        host_notification_period        24x7
        service_notification_options    w,u,c,r
        host_notification_options       d,r
        service_notification_commands   notify-by-email
        host_notification_commands      host-notify-by-email
        email                           ppiqq@test.com
     }

[ 本帖最后由 ppiqq 于 2008-9-25 11:19 编辑 ]

论坛徽章:
0
9 [报告]
发表于 2008-09-25 11:58 |只看该作者
偶了 谢谢虫虫猫了

论坛徽章:
0
10 [报告]
发表于 2014-09-05 14:38 |只看该作者

啥原因啊,求解释!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP