File: configobject.html

package info (click to toggle)
icinga 1.14.2%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 49,264 kB
  • sloc: ansic: 108,564; sql: 9,656; sh: 4,945; perl: 3,439; makefile: 1,213; php: 581; xml: 104
file content (321 lines) | stat: -rw-r--r-- 14,327 bytes parent folder | download
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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>3.3. Object Configuration Overview</title>
<link rel="stylesheet" href="../stylesheets/icinga-docs.css" type="text/css">
<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.14 Documentation">
<link rel="up" href="ch03.html" title="Chapter 3. Configuring Icinga">
<link rel="prev" href="configmain.html" title="3.2. Main Configuration File Options">
<link rel="next" href="objectdefinitions.html" title="3.4. Object Definitions">
<script src="../js/jquery-min.js" type="text/javascript"></script><script src="../js/icinga-docs.js" type="text/javascript"></script>
</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">3.3. Object Configuration Overview</th></tr>
<tr>
<td width="20%" align="left">
<a accesskey="p" href="configmain.html">Prev</a> </td>
<th width="60%" align="center">Chapter 3. Configuring Icinga</th>
<td width="20%" align="right"> <a accesskey="n" href="objectdefinitions.html">Next</a>
</td>
</tr>
</table>
<hr>
</div>
<div class="section" title="3.3. Object Configuration Overview">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="configobject"></a>3.3. <a name="config_object"></a>Object Configuration Overview</h2></div></div></div>
  

  <p><span class="bold"><strong>What Are Objects?</strong></span></p>

  <p>Objects are all the elements that are involved in the monitoring and notification logic. Types of objects include:</p>

  <div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
      <p>Services</p>
    </li>
<li class="listitem">
      <p>Service Groups</p>
    </li>
<li class="listitem">
      <p>Hosts</p>
    </li>
<li class="listitem">
      <p>Host Groups</p>
    </li>
<li class="listitem">
      <p>Contacts</p>
    </li>
<li class="listitem">
      <p>Contact Groups</p>
    </li>
<li class="listitem">
      <p>Commands</p>
    </li>
<li class="listitem">
      <p>Time Periods</p>
    </li>
<li class="listitem">
      <p>Notification Escalations</p>
    </li>
<li class="listitem">
      <p>Notification and Execution Dependencies</p>
    </li>
</ul></div>

  <p>More information on what objects are and how they relate to each other can be found below.</p>

  <p><span class="bold"><strong>Where Are Objects Defined?</strong></span></p>

  <p>Objects can be defined in one or more configuration files and/or directories that you specify using the <a class="link" href="configmain.html#configmain-cfg_file">cfg_file</a> and/or <a class="link" href="configmain.html#configmain-cfg_dir">cfg_dir</a> directives in the main
  configuration file.</p>

  <p><a name="configobject-include_file"></a></p>
  <p><a name="configobject-include_dir"></a></p>

  <p><span class="bold"><strong>include_file / include_dir</strong></span></p>

  <p>An object definition file can include other object definition files with the use of the <span class="bold"><strong>include_file=&lt;
  file_name&gt;</strong></span> and <span class="bold"><strong>include_dir=&lt;directory_name&gt;</strong></span> directives. The former includes
  the single file specified, the latter will process all files ending in the <span class="emphasis"><em>.cfg</em></span> extension in the directory
  specified. These directives may be repeated to include multiple files/directories.</p>
  <p>The directives are not allowed within the actual definition of an object, and should appear before, after, or in between any
  object definitions. They are closely related to the <a class="link" href="configmain.html#configmain-cfg_file">cfg_file=</a> and
  <a class="link" href="configmain.html#configmain-cfg_dir">cfg_dir=</a> directives in the main configuration file.</p>
  <p>These directives may be chained; e.g. an object definition file included from the main configuration file with a
  <span class="bold"><strong>cfg_file=</strong></span> or <span class="bold"><strong>cfg_dir=</strong></span> directive can use
  <span class="bold"><strong>include_file=</strong></span> or <span class="bold"><strong>include_dir=</strong></span> to include another object definition
  file, which in turn can also use <span class="bold"><strong>include_file=</strong></span> or <span class="bold"><strong>include_dir=</strong></span> to
  include yet another object definition file, and so on.</p>

  <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>When you follow <a class="link" href="quickstart.html" title="2.3. Quickstart Installation Guides">quickstart installation guide</a>, several sample object configuration
    files are placed in <span class="emphasis"><em>/usr/local/icinga/etc/objects/</em></span>. You can use these sample files to see how object
    inheritance works and learn how to define your own object definitions.</p>
  </td></tr>
</table></div>

  <p><span class="bold"><strong>How Are Objects Defined?</strong></span></p>

  <p>Objects are defined in a flexible template format, which can make it much easier to manage your Icinga
  configuration in the long term. Basic information on how to define objects in your configuration files can be found <a class="link" href="objectdefinitions.html" title="3.4. Object Definitions">here</a>.</p>

  <p>Once you get familiar with the basics of how to define objects, you should read up on <a class="link" href="objectinheritance.html" title="7.26. Object Inheritance">object inheritance</a>, as it will make your configuration more robust for the future. Seasoned
  users can exploit some advanced features of object definitions as described in the documentation on <a class="link" href="objecttricks.html" title="7.27. Time-Saving Tricks For Object Definitions">object tricks</a>.</p>

  <p><a name="configobject-objectoverview"></a></p>

  <p><span class="bold"><strong>Objects Explained</strong></span></p>

  <p>Some of the main object types are explained in greater detail below...</p>

  <div class="informaltable">
    <table border="0">
<colgroup>
<col>
<col>
</colgroup>
<tbody><tr>
<td align="left" valign="top">
<p> <a class="link" href="objectdefinitions.html#objectdefinitions-host">

              <span class="bold"><strong>Hosts</strong></span>
               
            </a> are one of the central objects in the monitoring logic. Important attributes of hosts are as follows:</p>
          <div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
                <p>Hosts are usually physical devices on your network (servers, workstations, routers, switches, printers,
                etc).</p>
              </li>
<li class="listitem">
                <p>Hosts have an address of some kind (e.g. an IP or MAC address).</p>
              </li>
<li class="listitem">
                <p>Hosts have one or more more services associated with them.</p>
              </li>
<li class="listitem">
                <p>Hosts can have parent/child relationships with other hosts, often representing real-world network
                connections, which is used in the <a class="link" href="networkreachability.html" title="5.10. Determining Status and Reachability of Network Hosts">network reachability</a> logic.</p>
              </li>
</ul></div> <p><a class="link" href="objectdefinitions.html#objectdefinitions-hostgroup">

              <span class="bold"><strong>Host Groups</strong></span>

            </a> are groups of one or more hosts. Host groups can make it easier to (1) view the status of related hosts in the
          Icinga web interface and (2) simplify your configuration through the use of <a class="link" href="objecttricks.html" title="7.27. Time-Saving Tricks For Object Definitions">object
          tricks</a>.</p>
</td>
<td align="center" valign="top"><p> <span class="inlinemediaobject"><img src="../images/objects-hosts.png"></span> </p></td>
</tr></tbody>
</table>
  </div>

  <div class="informaltable">
    <table border="0">
<colgroup>
<col>
<col>
</colgroup>
<tbody><tr>
<td align="left" valign="top">
<p> <a class="link" href="objectdefinitions.html#objectdefinitions-service">
               

              <span class="bold"><strong>Services</strong></span>

               
            </a> are one of the central objects in the monitoring logic. Services are associated with hosts and can be:</p>
          <div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
                <p>Attributes of a host (CPU load, disk usage, uptime, etc.)</p>
              </li>
<li class="listitem">
                <p>Services provided by the host (HTTP, POP3, FTP, SSH, etc.)</p>
              </li>
<li class="listitem">
                <p>Other things associated with the host (DNS records, etc.)</p>
              </li>
</ul></div> <p><a class="link" href="objectdefinitions.html#objectdefinitions-servicegroup">

              <span class="bold"><strong>Service Groups</strong></span>
               
            </a> are groups of one or more services. Service groups can make it easier to (1) view the status of related
          services in the Icinga web interface and (2) simplify your configuration through the use of <a class="link" href="objecttricks.html" title="7.27. Time-Saving Tricks For Object Definitions">object tricks</a>.</p>
</td>
<td align="center" valign="top"><p> <span class="inlinemediaobject"><img src="../images/objects-services.png"></span> </p></td>
</tr></tbody>
</table>
  </div>

  <div class="informaltable">
    <table border="0">
<colgroup>
<col>
<col>
</colgroup>
<tbody><tr>
<td align="left" valign="top">
<p> <a class="link" href="objectdefinitions.html#objectdefinitions-contact">
               

              <span class="bold"><strong>Contacts</strong></span>

               
            </a> are people involved in the notification process:</p> <div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
                <p>Contacts have one or more notification methods (cellphone, pager, email, instant messaging, etc.)</p>
              </li>
<li class="listitem">
                <p>Contacts receive notifications for hosts and service they are responsible for</p>
              </li>
</ul></div> <p><a class="link" href="objectdefinitions.html#objectdefinitions-contactgroup">
               

              <span class="bold"><strong>Contact Groups</strong></span>

               
            </a> are groups of one or more contacts. Contact groups can make it easier to define all the people who get
          notified when certain host or service problems occur.</p>
</td>
<td align="center" valign="top"><p> <span class="inlinemediaobject"><img src="../images/objects-contacts.png"></span> </p></td>
</tr></tbody>
</table>
  </div>

  <div class="informaltable">
    <table border="0">
<colgroup>
<col>
<col>
</colgroup>
<tbody><tr>
<td align="left" valign="top">
<p> <a class="link" href="objectdefinitions.html#objectdefinitions-timeperiod">
               

              <span class="bold"><strong>Timeperiods</strong></span>

               
            </a> are are used to control:</p> <div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
                <p>When hosts and services can be monitored</p>
              </li>
<li class="listitem">
                <p>When contacts can receive notifications</p>
              </li>
</ul></div> <p>Information on how timeperiods work can be found <a class="link" href="timeperiods.html" title="5.9. Time Periods">here</a>.</p>
</td>
<td align="center" valign="top"><p> <span class="inlinemediaobject"><img src="../images/objects-timeperiods.png"></span> </p></td>
</tr></tbody>
</table>
  </div>

  <div class="informaltable">
    <table border="0">
<colgroup>
<col>
<col>
</colgroup>
<tbody><tr>
<td align="left" valign="top">
<p> <a class="link" href="objectdefinitions.html#objectdefinitions-command">
               

              <span class="bold"><strong>Commands</strong></span>

               
            </a> are used to tell Icinga what programs, scripts, etc. it should execute to perform:</p> <div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
                <p>Host and service checks</p>
              </li>
<li class="listitem">
                <p>Notifications</p>
              </li>
<li class="listitem">
                <p>Event handlers</p>
              </li>
<li class="listitem">
                <p>and more...</p>
              </li>
</ul></div>
</td>
<td align="center" valign="top"><p> <span class="inlinemediaobject"><img src="../images/objects-commands.png"></span> </p></td>
</tr></tbody>
</table>
  </div>
  <a class="indexterm" name="idm140381634688080"></a>
  <a class="indexterm" name="idm140381634687216"></a>
  <a class="indexterm" name="idm140381634685984"></a>
  <a class="indexterm" name="idm140381634684416"></a>
  <a class="indexterm" name="idm140381634682784"></a>
</div>
<div class="navfooter">
<hr>
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left">
<a accesskey="p" href="configmain.html">Prev</a> </td>
<td width="20%" align="center"><a accesskey="u" href="ch03.html">Up</a></td>
<td width="40%" align="right"> <a accesskey="n" href="objectdefinitions.html">Next</a>
</td>
</tr>
<tr>
<td width="40%" align="left" valign="top">3.2. Main Configuration File Options </td>
<td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td>
<td width="40%" align="right" valign="top"> 3.4. Object Definitions</td>
</tr>
</table>
</div>
<P class="copyright">© 1999-2009 Ethan Galstad, 2009-2017 Icinga Development Team, https://www.icinga.com</P>
</body>
</html>