设为首页 收藏本站
查看: 1211|回复: 0

Icinga State Types

[复制链接]

尚未签到

发表于 2015-9-9 13:34:56 | 显示全部楼层 |阅读模式
5.8. State Types

5.8.1. Introduction5.8.2. Service and Host Check Retries5.8.3. Soft States5.8.4. Hard States5.8.5. Example
5.8.1. Introduction
  The current state of monitored services and hosts is determined by two components:


  •   The status of the service or host (i.e. OK, WARNING, UP, DOWN, etc.)
  •   Tye type of state the service or host is in
  There are two state types in Icinga - SOFT states and HARD states. These state types are a crucial part of the monitoring logic, as they are used to determine when event handlersare executed and when notifications are initially sent out.
  This document describes the difference between SOFT and HARD states, how they occur, and what happens when they occur.

5.8.2. Service and Host Check Retries
  In order to prevent false alarms from transient problems, Icinga allows you to define how many times a service or host should be (re)checked before it is considered to have a "real" problem. This is controlled by the max_check_attempts option in the host and service definitions. Understanding how hosts and services are (re)checked in order to determine if a real problem exists is important in understanding how state types work.

5.8.3. Soft States
  Soft states occur in the following situations...


  •   When a service or host check results in a non-OK or non-UP state and the service check has not yet been (re)checked the number of times specified by themax_check_attempts directive in the service or host definition. This is called a soft error.
  •   When a service or host recovers from a soft error. This is considered a soft recovery.
  The following things occur when hosts or services experience SOFT state changes:


  •   The SOFT state is logged.
  •   Event handlers are executed to handle the SOFT state.
  SOFT states are only logged if you enabled the log_service_retries or log_host_retries options in your main configuration file.
  The only important thing that really happens during a soft state is the execution of event handlers. Using event handlers can be particularly useful if you want to try and proactively fix a problem before it turns into a HARD state. The $HOSTSTATETYPE$ or $SERVICESTATETYPE$ macros will have a value of "SOFT" when event handlers are executed, which allows your event handler scripts to know when they should take corrective action. More information on event handlers can be found here.

5.8.4. Hard States
  Hard states occur for hosts and services in the following situations:


  •   When a host or service check results in a non-UP or non-OK state and it has been (re)checked the number of times specified by the max_check_attempts option in the host or service definition. This is a hard error state.
  •   When a host or service transitions from one hard error state to another error state (e.g. WARNING to CRITICAL).
  •   When a service check results in a non-OK state and its corresponding host is either DOWN or UNREACHABLE.
  •   When a host or service recovers from a hard error state. This is considered to be a hard recovery.
  •   When a passive host check is received. Passive host checks are treated as HARD unless the passive_host_checks_are_soft option is enabled.
  The following things occur when hosts or services experience HARD state changes:


  •   The HARD state is logged.
  •   Event handlers are executed to handle the HARD state.
  •   Contacts are notifified of the host or service problem or recovery.
  The $HOSTSTATETYPE$ or $SERVICESTATETYPE$ macros will have a value of "HARD" when event handlers are executed, which allows your event handler scripts to know when they should take corrective action. More information on event handlers can be found here.

5.8.5. Example
  Here's an example of how state types are determined, when state changes occur, and when event handlers and notifications are sent out. The table below shows consecutive checks of a service over time. The service has a max_check_attempts value of 3.

  Time
  Check #
  State
  State Type
  State Change
  Notes
  0
  1
  OK
  HARD
  No
  Initial state of the service
  1
  1
  CRITICAL
  SOFT
  Yes
  First detection of a non-OK state. Event handlers execute.
  2
  2
  WARNING
  SOFT
  Yes
  Service continues to be in a non-OK state. Event handlers execute.
  3
  3
  CRITICAL
  HARD
  Yes
  Max check attempts has been reached, so service goes into a HARD state. Event handlers execute and a problem notification is sent out. Check # is reset to 1 immediately after this happens.
  4
  1
  WARNING
  HARD
  Yes
  Service changes to a HARD WARNING state. Event handlers execute and a problem notification is sent out.
  5
  1
  WARNING
  HARD
  No
  Service stabilizes in a HARD problem state. Depending on what the notification interval for the service is, another notification might be sent out.
  6
  1
  OK
  HARD
  Yes
  Service experiences a HARD recovery. Event handlers execute and a recovery notification is sent out.
  7
  1
  OK
  HARD
  No
  Service is still OK.
  8
  1
  UNKNOWN
  SOFT
  Yes
  Service is detected as changing to a SOFT non-OK state. Event handlers execute.
  9
  2
  OK
  SOFT
  Yes
  Service experiences a SOFT recovery. Event handlers execute, but notification are not sent, as this wasn't a "real" problem. State type is set HARD and check # is reset to 1 immediately after this happens.
  10
  1
  OK
  HARD
  No
  Service stabilizes in an OK state.
  

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-111538-1-1.html 上篇帖子: Linux下配置Icinga 下篇帖子: icinga 被动模式 nsca 安装
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表