2014-02-05 15:53:22 +01:00
|
|
|
## <a id="performance-data"></a> Performance Data
|
2013-10-10 11:22:32 +02:00
|
|
|
|
2014-04-04 18:41:54 +02:00
|
|
|
When a host and service check is executed plugins should provide so-called
|
2013-10-18 20:05:08 +02:00
|
|
|
`performance data`. Next to that additional check performance data
|
|
|
|
can be fetched using Icinga 2 runtime macros such as the check latency
|
2014-04-04 18:41:54 +02:00
|
|
|
or the current service state (or additional custom attributes).
|
2013-10-18 20:05:08 +02:00
|
|
|
|
|
|
|
The performance data may be passed to external applications which
|
|
|
|
then generate nice graphs for historical reporting and trending.
|
|
|
|
|
|
|
|
Well-known addons processing Icinga performance data are PNP4Nagios,
|
|
|
|
inGraph and Graphite.
|
|
|
|
|
|
|
|
> **Note**
|
|
|
|
>
|
2014-04-01 20:30:44 +02:00
|
|
|
> As there are no real host checks in Icinga 2, the performance data is
|
|
|
|
> generated from the host check service, if existing.
|
2013-10-18 20:05:08 +02:00
|
|
|
|
2014-02-05 15:53:22 +01:00
|
|
|
### <a id="writing-performance-data-files"></a> Writing Performance Data Files
|
2013-10-18 20:05:08 +02:00
|
|
|
|
2014-04-01 20:30:44 +02:00
|
|
|
PNP4Nagios, inGraph and Graphios use performance data collector daemons to fetch
|
2013-10-18 20:05:08 +02:00
|
|
|
the current performance files for their backend updates.
|
|
|
|
|
|
|
|
Therefore the Icinga 2 `PerfdataWriter` object allows you to define
|
2014-04-01 20:30:44 +02:00
|
|
|
the output template format for host and services backed with Icinga 2
|
2014-04-04 18:41:54 +02:00
|
|
|
runtime vars.
|
2013-10-18 20:05:08 +02:00
|
|
|
|
2014-04-01 20:30:44 +02:00
|
|
|
host_format_template = "DATATYPE::HOSTPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tHOSTPERFDATA::$HOSTPERFDATA$\tHOSTCHECKCOMMAND::$HOSTCHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$"
|
|
|
|
service_format_template = "DATATYPE::SERVICEPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tSERVICEDESC::$SERVICEDESC$\tSERVICEPERFDATA::$SERVICEPERFDATA$\tSERVICECHECKCOMMAND::$SERVICECHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$\tSERVICESTATE::$SERVICESTATE$\tSERVICESTATETYPE::$SERVICESTATETYPE$"
|
|
|
|
|
|
|
|
The default templates are already provided with the Icinga 2 feature configuration
|
2013-10-18 20:05:08 +02:00
|
|
|
which can be enabled using
|
|
|
|
|
2013-10-18 22:11:40 +02:00
|
|
|
# icinga2-enable-feature perfdata
|
2013-10-18 20:05:08 +02:00
|
|
|
|
|
|
|
By default all performance data files are rotated in a 15 seconds interval into
|
2014-04-01 20:30:44 +02:00
|
|
|
the `/var/spool/icinga2/perfdata/` directory as `host-perfdata.<timestamp>` and
|
|
|
|
`service-perfdata.<timestamp>`.
|
2013-10-18 20:05:08 +02:00
|
|
|
External collectors need to parse the rotated performance data files and then
|
|
|
|
remove the processed files.
|
|
|
|
|
|
|
|
> **Note**
|
|
|
|
>
|
|
|
|
> If you enable this feature by accident and no collector daemon is processing
|
|
|
|
> these files, the filesystem's inodes may run out. Make sure to watch the
|
|
|
|
> `localhost` service check `disks` and define your own inode warning
|
|
|
|
> and critical thresholds.
|
|
|
|
|
|
|
|
|
2014-02-05 15:53:22 +01:00
|
|
|
### <a id="graphite-carbon-cache-writer"></a> Graphite Carbon Cache Writer
|
2013-10-18 20:05:08 +02:00
|
|
|
|
2014-04-01 20:30:44 +02:00
|
|
|
While there are some Graphite collector scripts and daemons like Graphios available for
|
|
|
|
Icinga 1.x it's more reasonable to directly process the check and plugin performance
|
|
|
|
in memory in Icinga 2. Once there are new metrics available, Icinga 2 will directly
|
2013-10-21 21:43:17 +02:00
|
|
|
write them to the defined Graphite Carbon daemon tcp socket.
|
2013-10-18 20:05:08 +02:00
|
|
|
|
|
|
|
You can enable the feature using
|
|
|
|
|
2013-10-18 22:11:40 +02:00
|
|
|
# icinga2-enable-feature graphite
|
2014-04-01 20:30:44 +02:00
|
|
|
|
2013-10-18 20:05:08 +02:00
|
|
|
The `GraphiteWriter` object expects the Graphite Carbon Cache socket listening
|
|
|
|
at `127.0.0.1` on port `2003` by default.
|
|
|
|
|
|
|
|
The current naming schema is
|
|
|
|
|
2014-04-01 20:30:44 +02:00
|
|
|
icinga.<hostname>.<metricname>
|
2013-10-18 20:05:08 +02:00
|
|
|
icinga.<hostname>.<servicename>.<metricname>
|