2012-09-25 13:46:28 +02:00
|
|
|
/**
|
|
|
|
* Icinga 2 configuration file
|
|
|
|
* - this is where you define settings for the Icinga application including
|
|
|
|
* which hosts/services to check.
|
|
|
|
*
|
|
|
|
* The docs/icinga2-config.txt file in the source tarball has a detailed
|
|
|
|
* description of what configuration options are available.
|
|
|
|
*/
|
2012-09-14 11:32:49 +02:00
|
|
|
|
2012-09-25 13:46:28 +02:00
|
|
|
/**
|
|
|
|
* Global configuration settings
|
|
|
|
*/
|
|
|
|
local object IcingaApplication "icinga" {
|
|
|
|
macros = {
|
|
|
|
plugindir = "/usr/lib/nagios/plugins"
|
|
|
|
}
|
2012-09-14 11:32:49 +02:00
|
|
|
}
|
|
|
|
|
2012-09-25 13:46:28 +02:00
|
|
|
/**
|
|
|
|
* The checker component takes care of executing service checks.
|
|
|
|
*/
|
2012-09-14 11:32:49 +02:00
|
|
|
local object Component "checker" {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2012-09-25 13:46:28 +02:00
|
|
|
/**
|
|
|
|
* The delegation component assigns services to checkers. You need to load
|
|
|
|
* this component even if your Icinga setup only consists of a single instance.
|
|
|
|
*/
|
2012-09-14 11:32:49 +02:00
|
|
|
local object Component "delegation" {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2012-09-25 13:46:28 +02:00
|
|
|
/**
|
|
|
|
* The compat component periodically updates the status.dat and objects.cache
|
|
|
|
* files. These are used by the Icinga 1.x CGIs to display the state of
|
|
|
|
* hosts and services.
|
|
|
|
*/
|
2012-09-14 11:32:49 +02:00
|
|
|
local object Component "compat" {
|
2012-09-28 14:26:01 +02:00
|
|
|
/*
|
|
|
|
statuspath = "/var/icinga2/status.dat",
|
|
|
|
objectspath = "/var/icinga2/objects.cache",
|
|
|
|
*/
|
2012-09-14 11:32:49 +02:00
|
|
|
}
|
|
|
|
|
2012-09-25 15:21:33 +02:00
|
|
|
/**
|
|
|
|
* The compatido component works as idomod connector to a running ido2db
|
|
|
|
* daemon, connected via tcp socket only. It will dump config and status
|
|
|
|
* information periodically for now. By default, this remains disabled.
|
|
|
|
*/
|
|
|
|
/*
|
|
|
|
local object Component "compatido" {
|
2012-09-28 12:13:50 +02:00
|
|
|
socket_address = "127.0.0.1",
|
|
|
|
socket_port = "5668",
|
|
|
|
instance_name = "i2-default",
|
2012-09-25 15:21:33 +02:00
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
2012-09-25 13:46:28 +02:00
|
|
|
/**
|
|
|
|
* This template defines some basic parameters for services that use
|
|
|
|
* external plugins for their checks.
|
|
|
|
*/
|
2012-09-25 15:26:06 +02:00
|
|
|
abstract object Service "icinga-service" {
|
2012-09-14 15:41:14 +02:00
|
|
|
methods = {
|
2012-09-25 09:06:21 +02:00
|
|
|
check = "native::PluginCheck"
|
2012-09-14 11:32:49 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-09-25 13:46:28 +02:00
|
|
|
/**
|
|
|
|
* The service template for ping checks. In an Icinga 1.x environment
|
|
|
|
* this would be defined as a check command.
|
|
|
|
*/
|
2012-09-25 15:26:06 +02:00
|
|
|
abstract object Service "ping" inherits "icinga-service" {
|
2012-09-14 11:32:49 +02:00
|
|
|
check_command = "$plugindir$/check_ping -H $address$ -w $wrta$,$wpl$% -c $crta$,$cpl$%",
|
|
|
|
|
|
|
|
macros += {
|
|
|
|
wrta = 50,
|
|
|
|
wpl = 5,
|
|
|
|
crta = 100,
|
|
|
|
cpl = 10
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-09-25 13:46:28 +02:00
|
|
|
/**
|
|
|
|
* And finally we define some host that should be checked.
|
|
|
|
*/
|
2012-09-14 11:32:49 +02:00
|
|
|
object Host "localhost" {
|
|
|
|
services = { "ping" },
|
|
|
|
|
|
|
|
macros = {
|
|
|
|
address = "127.0.0.1"
|
|
|
|
},
|
|
|
|
|
2012-09-25 11:17:04 +02:00
|
|
|
check_interval = 1m
|
2012-09-14 11:32:49 +02:00
|
|
|
}
|
|
|
|
|