]> granicus.if.org Git - icinga2/blob - doc/3.01-hosts-and-services.md
Remove the 'Icinga' prefix for global constants.
[icinga2] / doc / 3.01-hosts-and-services.md
1 ## <a id="hosts-services"></a> Hosts and Services
2
3 Icinga 2 can be used to monitor the availability of hosts and services. Services
4 can be virtually anything which can be checked in some way:
5
6 * Network services (HTTP, SMTP, SNMP, SSH, etc.)
7 * Printers
8 * Switches / Routers
9 * Temperature Sensors
10 * Other local or network-accessible services
11
12 Host objects provide a mechanism to group services that are running
13 on the same physical device.
14
15 Here is an example of a host object which defines two child services:
16
17     object Host "my-server1" {
18       vars.address = "10.0.0.1"
19       check_command = "hostalive"
20     }
21
22     object Service "ping4" {
23       host_name = "localhost"
24       check_command = "ping4"
25     }
26
27     object Service "http" {
28       host_name = "localhost"
29       check_command = "http_ip"
30     }
31
32 The example creates two services `ping4` and `http` which belong to the
33 host `my-server1`.
34
35 It also specifies that the host should perform its own check using the `hostalive`
36 check command.
37
38 The `address` custom attribute is used by check commands to determine which network
39 address is associated with the host object.
40
41 ### <a id="host-states"></a> Host States
42
43 Hosts inherit their state from the host check service that is specified using
44 the `check` attribute.
45
46 Hosts can be in any of the following states:
47
48   Name        | Description
49   ------------|--------------
50   UP          | The host is available.
51   DOWN        | The host is unavailable.
52   UNREACHABLE | At least one of the host's dependencies (e.g. its upstream router) is unavailable causing the host to be unreachable.
53
54 ### <a id="service-states"></a> Service States
55
56 Services can be in any of the following states:
57
58   Name        | Description
59   ------------|--------------
60   OK          | The service is working properly.
61   WARNING     | The service is experiencing some problems but is still considered to be in working condition.
62   CRITICAL    | The service is in a critical state.
63   UNKNOWN     | The check could not determine the service's state.
64
65 ### <a id="hard-soft-states"></a> Hard and Soft States
66
67 When detecting a problem with a service Icinga re-checks the service a number of
68 times (based on the `max_check_attempts` and `retry_interval` settings) before sending
69 notifications. This ensures that no unnecessary notifications are sent for
70 transient failures. During this time the service is in a `SOFT` state.
71
72 After all re-checks have been executed and the service is still in a non-OK
73 state the service switches to a `HARD` state and notifications are sent.
74
75   Name        | Description
76   ------------|--------------
77   HARD        | The host/service's state hasn't recently changed.
78   SOFT        | The host/service has recently changed state and is being re-checked.