File: freshness.html

package info (click to toggle)
icinga 1.0.2-2%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 33,952 kB
  • ctags: 13,294
  • sloc: xml: 154,821; ansic: 99,198; sh: 14,585; sql: 5,852; php: 5,126; perl: 2,838; makefile: 1,268
file content (181 lines) | stat: -rw-r--r-- 10,167 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Service and Host Freshness Checks</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
<meta name="keywords" content="Supervision, Icinga, Nagios, Linux">
<link rel="home" href="index.html" title="Icinga Version 1.0.2 Documentation">
<link rel="up" href="ch06.html" title="Chapter 6. Advanced Topics">
<link rel="prev" href="volatileservices.html" title="Volatile Services">
<link rel="next" href="distributed.html" title="Distributed Monitoring">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<CENTER><IMG src="../images/logofullsize.png" border="0" alt="Icinga" title="Icinga"></CENTER>
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr><th colspan="3" align="center">Service and Host Freshness Checks</th></tr>
<tr>
<td width="20%" align="left">
<a accesskey="p" href="volatileservices.html">Prev</a> </td>
<th width="60%" align="center">Chapter 6. Advanced Topics</th>
<td width="20%" align="right"> <a accesskey="n" href="distributed.html">Next</a>
</td>
</tr>
</table>
<hr>
</div>
<div class="section" title="Service and Host Freshness Checks">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="freshness"></a><a name="freshness_checks"></a>Service and Host Freshness Checks</h2></div></div></div>
  

  <p><span class="bold"><strong>Introduction</strong></span></p>

  <p>Icinga supports a feature that does "freshness" checking on the results of host and service checks. The purpose of
  freshness checking is to ensure that host and service checks are being provided passively by external applications on a regular
  basis.</p>

  <p>Freshness checking is useful when you want to ensure that <a class="link" href="passivechecks.html" title="Passive Checks">passive checks</a> are being
  received as frequently as you want. This can be very useful in <a class="link" href="distributed.html" title="Distributed Monitoring">distributed</a> and <a class="link" href="redundancy.html" title="Redundant and Failover Network Monitoring">failover</a> monitoring environments.</p>

  <p><span class="inlinemediaobject"><img src="../images/freshness.png"></span></p>

  <p><span class="bold"><strong>How Does Freshness Checking Work?</strong></span></p>

  <p>Icinga periodically checks the freshness of the results for all hosts services that have freshness checking
  enabled.</p>

  <div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
      <p>A freshness threshold is calculated for each host or service.</p>
    </li>
<li class="listitem">
      <p>For each host/service, the age of its last check result is compared with the freshness threshold.</p>
    </li>
<li class="listitem">
      <p>If the age of the last check result is greater than the freshness threshold, the check result is considered
      "stale".</p>
    </li>
<li class="listitem">
      <p>If the check results is found to be stale, Icinga will force an <a class="link" href="activechecks.html" title="Active Checks">active
      check</a> of the host or service by executing the command specified by in the host or service definition.</p>
    </li>
</ul></div>

  <div class="tip" title="Tip" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Tip">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Tip]" src="../images/tip.png"></td>
<th align="left">Tip</th>
</tr>
<tr><td align="left" valign="top">
    <p>An active check is executed even if active checks are disabled on a program-wide or host- or service-specific
    basis.</p>
  </td></tr>
</table></div>

  <p>For example, if you have a freshness threshold of 60 for one of your services, Icinga will consider that service to
  be stale if its last check result is older than 60 seconds.</p>

  <p><span class="bold"><strong>Enabling Freshness Checking</strong></span></p>

  <p>Here's what you need to do to enable freshness checking...</p>

  <div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
      <p>Enable freshness checking on a program-wide basis with the <a class="link" href="configmain.html#configmain-check_service_freshness">check_service_freshness</a> and <a class="link" href="configmain.html#configmain-check_host_freshness">check_host_freshness</a> directives.</p>
    </li>
<li class="listitem">
      <p>Use <a class="link" href="configmain.html#configmain-service_freshness_check_interval">service_freshness_check_interval</a> and <a class="link" href="configmain.html#configmain-host_freshness_check_interval">host_freshness_check_interval</a> options to tell Icinga how
      often in should check the freshness of service and host results.</p>
    </li>
<li class="listitem">
      <p>Enable freshness checking on a host- and service-specific basis by setting the <span class="emphasis"><em>check_freshness</em></span>
      option in your host and service definitions to a value of 1.</p>
    </li>
<li class="listitem">
      <p>Configure freshness thresholds by setting the <span class="emphasis"><em>freshness_threshold</em></span> option in your host and service
      definitions.</p>
    </li>
<li class="listitem">
      <p>Configure the <span class="emphasis"><em>check_command</em></span> option in your host or service definitions to reflect a valid command
      that should be used to actively check the host or service when it is detected as stale.</p>
    </li>
<li class="listitem">
      <p>The <span class="emphasis"><em>check_period</em></span> option in your host and service definitions is used when Icinga
      determines when a host or service can be checked for freshness, so make sure it is set to a valid timeperiod.</p>
    </li>
</ul></div>

  <div class="tip" title="Tip" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Tip">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Tip]" src="../images/tip.png"></td>
<th align="left">Tip</th>
</tr>
<tr><td align="left" valign="top">
    <p>If you do not specify a host- or service-specific <span class="emphasis"><em>freshness_threshold</em></span> value (or you set it to
    zero), Icinga will automatically calculate a threshold automatically, based on a how often you monitor that particular
    host or service. We would recommend that you explicitly specify a freshness threshold, rather than let Icinga pick one
    for you.</p>
  </td></tr>
</table></div>

  <p><span class="bold"><strong>Example</strong></span></p>

  <p>An example of a service that might require freshness checking might be one that reports the status of your nightly backup
  jobs. Perhaps you have a external script that submit the results of the backup job to Icinga once the backup is
  completed. In this case, all of the checks/results for the service are provided by an external application using passive checks.
  In order to ensure that the status of the backup job gets reported every day, you may want to enable freshness checking for the
  service. If the external script doesn't submit the results of the backup job, you can have Icinga fake a critical result
  by doing something like this...</p>

  <p>Here's what the definition for the service might look like (some required options are omitted)...</p>

  <pre class="screen"> define service{
        host_name               backup-server
        service_description     ArcServe Backup Job
        active_checks_enabled   0               ; active checks are NOT enabled
        passive_checks_enabled  1               ; passive checks are enabled (this is how results are reported)
        check_freshness         1
        freshness_threshold     93600           ; 26 hour threshold, since backups may not always finish at the same time
        check_command           no-backup-report        ; this command is run only if the service results are "stale"
        ...other options...
        }</pre>

  <p>Notice that active checks are disabled for the service. This is because the results for the service are only made by an
  external application using passive checks. Freshness checking is enabled and the freshness threshold has been set to 26 hours.
  This is a bit longer than 24 hours because backup jobs sometimes run late from day to day (depending on how much data there is
  to backup, how much network traffic is present, etc.). The <span class="emphasis"><em>no-backup-report</em></span> command is executed only if the
  results of the service are determined to be stale. The definition of the <span class="emphasis"><em>no-backup-report</em></span> command might
  look like this...</p>

  <pre class="screen"> define command{
        command_name    no-backup-report
        command_line    /usr/local/icinga/libexec/check_dummy 2 "CRITICAL: Results of backup job were not reported!"
        }</pre>

  <p>If Icinga detects that the service results are stale, it will run the <span class="emphasis"><em>no-backup-report</em></span> command
  as an active service check. This causes the <span class="emphasis"><em>check_dummy</em></span> plugin to be executed, which returns a critical
  state to Icinga. The service will then go into to a critical state (if it isn't already there) and someone will probably
  get notified of the problem.</p>
  <a class="indexterm" name="id1992102"></a>
</div>
<div class="navfooter">
<hr>
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left">
<a accesskey="p" href="volatileservices.html">Prev</a> </td>
<td width="20%" align="center"><a accesskey="u" href="ch06.html">Up</a></td>
<td width="40%" align="right"> <a accesskey="n" href="distributed.html">Next</a>
</td>
</tr>
<tr>
<td width="40%" align="left" valign="top">Volatile Services </td>
<td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td>
<td width="40%" align="right" valign="top"> Distributed Monitoring</td>
</tr>
</table>
</div>
<P class="copyright">© 2009-2010 Icinga Development Team, http://www.icinga.org</P>
</body>
</html>