Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introduction


The current state of monitored services and hosts is determined by two components:

...

There are two state types in Shinken Enterprise  - SOFT states and HARD states. These state types are a crucial part of the monitoring logic, as they are used to determine when event handlers  are 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.

Service and Host Check Retries


In order to prevent false alarms from transient problems, Shinken Enterprise 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.

 

Soft States


Soft states occurs in the following situations...

...

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 :ref:`here <advanced/eventhandlers>`.

Hard States


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

...

The $HOSTSTATETYPE$ or$SERVICESTATETYPE$ data 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.

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 check over time. The check has a max_check_attempts value of 3.

...