3.1. Configuration Overview
Prev | Chapter 3. Configuring Icinga | Next

## 3.1. Configuration Overview

### 3.1.1. Introduction

There are several different configuration files that you're going to need to create or edit before you start monitoring anything. Be patient! Configuring Icinga can take quite a while, especially if you're first-time user. Once you figure out how things work, it'll all be well worth your time. :-)

| Note
Sample configuration files are installed in the /usr/local/icinga/etc/ directory when you follow the quickstart installation guide.

### 3.1.2. File names

Names and locations of these configuration files are all up to you but it is commonly accepted to have files called `icinga.cfg`, `resource.cfg`, and `cgi.cfg` in the main config directory.

The names of the object definition files may show the type of definitions (`contacts.cfg, commands.cfg`, `timeperiods.cfg`, `notifications.cfg`), the type of hardware (`printer.cfg`, `switch.cfg`), or the object which is described (`localhost.cfg`). If your installation doesn't contain any of these files then there is no need to panic. Using a web-based configuration tool, a database driven script, or editing the files with your favourite editor the files may be in separate folders per geographical location (country, branch, ...) and a file per physical or logical unit (room, rack, application, development, ...), or the concept which seems to suit your needs best.

### 3.1.3. Main Configuration File

The main configuration file contains a number of directives that affect how the Icinga daemon operates and links to several other files. This config file is read by both the Icinga daemon and the CGIs. This is where you're going to want to get started in your configuration adventures.

Documentation for the main configuration file can be found here.

### 3.1.4. Resource File(s)

Resource files can be used to store user-defined macros. The main point of having resource files is to use them to store sensitive configuration information (like passwords), without making them available to the CGIs.

You can specify one or more optional resource files by using the resource_file directive in your main configuration file.

### 3.1.5. Object Definition Files

Object definition files are used to define hosts, services, hostgroups, contacts, contactgroups, commands, etc. This is where you define all the things you want to monitor and how you want to monitor them.

You can specify one or more object definition files by using the cfg_file and/or cfg_dir directives in your main configuration file, but it is advisable to stick to one type of directive (either cfg_dir or cfg_file until you understand the implications using both at a time).

An introduction to object definitions, and how they relate to each other, can be found here.

Your object definition files can in turn include other files using the include_file or include_dir directives. These can only occur outside of the actual object definitions, and behave very much like the cfg_file= and cfg_dir= directives in the main configuration file.

### 3.1.6. CGI Configuration File

The CGI configuration file contains a number of directives that affect the operation of the CGIs. It also contains a reference to the main configuration file, so the CGIs know how you've configured Icinga and where your object definitions are stored.

Documentation for the CGI configuration file can be found here.

Prev | Up | Next
Chapter 3. Configuring Icinga | Home | 3.2. Main Configuration File Options

© 2009-2012 Icinga Development Team, http://www.icinga.org