网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

Nagios自定义报警时间-创新互联

Nagios自定义报警时间

遇到需要自定义检查和报警时间的,总结一下。大家集思广益,不断完善。

创新互联长期为上1000家客户提供的网站建设服务,团队从业经验10年,关注不同地域、不同群体,并针对不同对象提供差异化的产品和服务;打造开放共赢平台,与合作伙伴共同营造健康的互联网生态环境。为新安企业提供专业的成都做网站、成都网站建设,新安网站改版等技术服务。拥有十载丰富建站经验和众多成功案例,为您定制开发。
常调用的模板配置文件:

efine service{

   name              generic-service     ; 定义一个服务名称

   active_checks_enabled      1            ; Activeservice checks are enabled

   passive_checks_enabled     1            ; Passiveservice checks are enabled/accepted

   parallelize_check        1            ; Activeservice checks should be parallelized;
                               ; (disabling this can lead to major performance problems)

   obsess_over_service       1            ; Weshould obsess over this service (if necessary)

   check_freshness         0            ; Defaultis to NOT check service 'freshness'

   notifications_enabled      1            ; Servicenotifications are enabled

   event_handler_enabled      1            ; Serviceevent handler is enabled

   flap_detection_enabled     1            ; Flapdetection is enabled

   failure_prediction_enabled   1            ; Failureprediction is enabled

   process_perf_data        1            ; Processperformance data

   retain_status_information    1            ; Retainstatus information across program restarts

   retain_nonstatus_information  1            ; Retainnon-status information across program restarts

   is_volatile           0            ; Theservice is not volatile

check_period           24x7       ; 这里的check_period告诉nagios检查服务的时间段。

   max_check_attempts       3         ; nagios对服务的大检查次数。

   normal_check_interval      5         ; 此选项是用来设置服务检查时间间隔,也就是说,nagios这一次检查和下一次检查之间所隔的时间;
                            ; 这里是5分钟。

   retry_check_interval      2         ; 重试检查时间间隔,单位是分钟。

   contact_groups          admin       ; 指定联系人组

   notification_options      w,u,c,r      ; 这个定义的是“通知可以被发出的情况”。w即warn,表示警告状态;
                            ; u即unknown,表示不明状态;
                            ; c即criticle,表示紧急状态,r即recover,表示恢复状态;
                            ; 也就是在服务出现警告状态、未知状态、紧急状态和重新恢复后都发送通知给使用者。

   notification_interval      10        ; Re-notify aboutservice problems every hour

notification_period       24x7       ; 指定“发送通知”的时间段,也就是可以在什么时候发送通知给使用者。

   register            0         ; DONT REGISTERTHIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!

   }

define service{

   name               local-service      ; The name of this service template

   use               generic-service     ; Inherit default values from thegeneric-service definition

   max_check_attempts       4       ; Re-check theservice up to 4 times in order to determine its final (hard) state

   normal_check_interval      5       ; Check the service every 5 minutes undernormal conditions

   retry_check_interval      1       ; Re-check theservice every minute until a hard state can be determined

   register            0       ; DONT REGISTER THISDEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!

   }

[root@SHUBEI-34-223 objects]# cattimeperiods.cfg

………………….

define timeperiod{

   timeperiod_name 24x7

   alias      24 Hours A Day, 7Days A Week

   sunday      00:00-24:00

   monday      00:00-24:00

   tuesday     00:00-24:00

   wednesday    00:00-24:00

   thursday     00:00-24:00

   friday      00:00-24:00

   saturday     00:00-24:00

   }

自定义检查和报警时间:

define timeperiod{

   timeperiod_name rd_bus_engine_time

   alias      rd_bus_engine_time

   monday      07:55-08:05

   tuesday      07:55-08:05

   wednesday    07:55-08:05

   thursday     07:55-08:05

   friday      07:55-08:05

    saturday     07:55-08:05

    sunday     07:55-08:05

   }

defineservice{

  use               local-service

  host_name           10.19.190.22_bus_engine

   service_description      compile_critical_log

  contact_groups       rd-bus-engine-group

check_period         rd_bus_engine_time

notification_period       rd_bus_engine_time

  notification_options      w,u,c,r

  check_command       check_nrpe!check_log

}

检查重启。

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


分享文章:Nagios自定义报警时间-创新互联
转载源于:http://bjjierui.cn/article/cedcsi.html

其他资讯