Icinga State Types

5.8. State Types

5.8.1. Introduction
5.8.2. Service and Host Check Retries
5.8.3. Soft States
5.8.4. Hard States
5.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.

Icinga State Types

时间: 2024-08-05 02:08:40

Icinga State Types的相关文章

Asp.Net Core 项目实战之权限管理系统(6) 功能管理

0 Asp.Net Core 项目实战之权限管理系统(0) 无中生有 1 Asp.Net Core 项目实战之权限管理系统(1) 使用AdminLTE搭建前端 2 Asp.Net Core 项目实战之权限管理系统(2) 功能及实体设计 3 Asp.Net Core 项目实战之权限管理系统(3) 通过EntityFramework Core使用PostgreSQL 4 Asp.Net Core 项目实战之权限管理系统(4) 依赖注入.仓储.服务的多项目分层实现 5 Asp.Net Core 项目实

Gen_server行为分析与实践

1.简介 Gen_server实现了通用服务器client_server原理,几个不同的客户端去分享服务端管理的资源(如图),gen_server提供标准的接口函数和包含追踪功能以及错误报告来实现通用的服务器,同时可以作为OTP监控树的一部分. Gen_server函数与回调函数之间的关系: 1 gen_server module Callback module 2 ----------------- --------------- 3 gen_server:start_link ----->

jstree用法小结

jstree是一款功能强大的插件.官网地址http://www.jstree.com/ $('#jstree').jstree({ "core" : { "animation" : 0, "themes" : { "dots": true,"icons":true ,"stripes":false}, "check_callback" : true, "mu

jorgchart,帮助你生成组织结构图的

下载地址: http://yunpan.cn/c6pfenkmmFV2q  访问密码 8e29 演示链接: http://www.gbtags.com/gb/share/546.htm jstree.js 也是一种层级机构的js控件例子: var contextualMenuSample = function() { $("#tree_3").jstree({ "core" : { "themes" : { "responsive&qu

ngRx 官方示例分析 - 3. reducers

上一篇:ngRx 官方示例分析 - 2. Action 管理 这里我们讨论 reducer. 如果你注意的化,会看到再不同的 Action 定义文件中,导出的 String Literal Type 名称都是 Actions ,在导入的时候,同时导入同名的类型就是问题了.这里首先使用了 import as 语法进行重命名. import * as book from '../actions/book'; import * as collection from '../actions/collec

无限分级和tree结构数据增删改【提供Demo下载】

无限分级 很多时候我们不确定等级关系的层级,这个时候就需要用到无限分级了. 说到无限分级,又要扯到递归调用了.(据说频繁递归是很耗性能的),在此我们需要先设计好表机构,用来存储无限分级的数据.当然,以下都是自己捣鼓的结果,非标准.谁有更好的设计望不吝啬赐教. 说来其实也简单,就是一个ID和父ID的关系. 以此类推,Id需要是唯一的,ParenId需要是Id列里面存在即可.这样我们就实现无限分级了,如果再加一列Sort排序就更完美了. jstree插件 官方地址:https://www.jstre

jstree使用小结(一)

项目中用到tree结构,使用了jstree做个笔记如下: 1. 官网: http://www.jstree.com/    有时候打不开,那就只能等打得开的时候再看了...O(∩_∩)O [PS: 一些灰常基本的我可能就略过了...] 2. 先看看效果: (1)去官网下载jstree包,然后引入; 额外的样式文件(font-awesome.css):  到这个网址去下载  然后引入 http://fontawesome.io/license (2)添加jstree的容器 <div id="

vue全家桶实现笔记本功能

一个通过vue实现的练手小项目,数据保存和导出通过node进行处理 成品截图: 安装vue-cli,webpack: cnpm install webpack -g cnpm install vue-cli -g 通过vue-cli搭建项目: 需要使用vuex管理数据,添加store文件夹,最终目录结构: ----vue_notes |--components |--router |--store 编辑入口文件 main.js //引入Vue import Vue from 'vue' //引入

React Native NavigationExperimental

Overview NavigationExperimental是react native的一个新的导航系统,重点是改进<Navigator/>组件. 单向数据流, 它使用reducers 来操作最顶层的state 对像,而在<Navigator/>中,当你在子导航页中,不可能操作到app最初打开页面时的state对像,除非,一级级的通过props传递过方法名或函数名,然后在子页面中调用这些方法或者函数,来修改某个顶层的数据. 为了允许存在本地和基于 js的导航视图,导航的逻辑和路由