1 # Icinga 2 Addons <a id="addons"></a>
3 ## Graphing <a id="addons-graphing"></a>
5 ### Graphite <a id="addons-graphing-graphite"></a>
7 [Graphite](https://graphite.readthedocs.org/en/latest/) is a time-series database
8 storing collected metrics and making them available through restful apis
11 Graphite consists of 3 software components:
13 * carbon -- a Twisted daemon that listens for time-series data
14 * whisper -- a simple database library for storing time-series data (similar in design to RRD)
15 * graphite webapp -- a Django webapp that renders graphs on-demand using Cairo
17 You need to install Graphite first, then proceed with configuring it in Icinga 2.
19 Use the [GraphiteWriter](14-features.md#graphite-carbon-cache-writer) feature
20 for sending real-time metrics from Icinga 2 to Graphite.
23 # icinga2 feature enable graphite
26 A popular alternative frontend for Graphite is for example [Grafana](https://grafana.org).
28 Integration in Icinga Web 2 is possible by installing the official [graphite module](https://icinga.com/docs/graphite/latest/).
30 ![Icinga Web 2 Detail View with Graphite](images/addons/icingaweb2_graphite.png)
33 ### InfluxDB <a id="addons-graphing-influxdb"></a>
35 [InfluxDB](https://influxdb.com) is a time series, metrics, and analytics database.
36 It’s written in Go and has no external dependencies.
38 Use the [InfluxdbWriter](14-features.md#influxdb-writer) feature
39 for sending real-time metrics from Icinga 2 to InfluxDB.
42 # icinga2 feature enable influxdb
45 A popular frontend for InfluxDB is for example [Grafana](https://grafana.org).
47 Integration in Icinga Web 2 is possible by installing the community [Grafana module](https://github.com/Mikesch-mp/icingaweb2-module-grafana).
49 ![Icinga Web 2 Detail View with Grafana](images/addons/icingaweb2_grafana.png)
52 ### PNP <a id="addons-graphing-pnp"></a>
54 [PNP](https://www.pnp4nagios.org) is a graphing addon.
56 [PNP](https://www.pnp4nagios.org) is an addon which adds a graphical representation of the performance data collected
57 by the monitoring plugins. The data is stored as rrd (round robin database) files.
59 Use your distribution's package manager to install the `pnp4nagios` package.
61 If you're planning to use it, configure it to use the
62 [bulk mode with npcd and npcdmod](https://docs.pnp4nagios.org/pnp-0.6/modes#bulk_mode_with_npcd_and_npcdmod)
63 in combination with Icinga 2's [PerfdataWriter](14-features.md#performance-data). NPCD collects the performance
64 data files which Icinga 2 generates.
66 Enable performance data writer in icinga 2
69 # icinga2 feature enable perfdata
72 Configure npcd to use the performance data created by Icinga 2:
75 vim /etc/pnp4nagios/npcd.cfg
78 Set `perfdata_spool_dir = /var/spool/icinga2/perfdata` and restart the `npcd` daemon.
80 There's also an Icinga Web 2 module for direct PNP graph integration
81 available at [Icinga Exchange](https://exchange.icinga.com/icinga/PNP).
83 More information on [action_url as attribute](13-addons.md#addons-graphing-pnp-action-url)
84 and [graph template names](13-addons.md#addons-graphing-pnp-custom-templates).
87 ## Visualization <a id="addons-visualization"></a>
89 ### Maps <a id="addons-visualization-maps"></a>
91 This community module displays host objects as markers on openstreetmap in Icinga Web 2.
92 It uses the data provided by the monitoring module and as such the [DB IDO](14-features.md#db-ido)
95 If you configure multiple hosts with the same coordinates, i.e. servers in a datacenter, a clustered view is rendered.
97 Check the [Map module docs](https://github.com/nbuchwitz/icingaweb2-module-map) for more details on
98 installation, configuration and integration.
100 ![Icinga Web 2 Maps](images/addons/icingaweb2_maps.png)
102 ### Dashing Dashboard <a id="addons-visualization-dashing-dashboard"></a>
104 The [Icinga 2 dashboard](https://github.com/dnsmichi/dashing-icinga2) is built
105 on top of Dashing and uses the [REST API](12-icinga2-api.md#icinga2-api) to visualize what's going
106 on with your monitoring. It combines several popular widgets and provides development
107 instructions for your own implementation.
109 The dashboard also allows to embed the [Icinga Web 2](https://icinga.com/products/icinga-web-2/)
110 host and service problem lists as Iframe.
112 ![Dashing dashboard](images/addons/dashing_icinga2.png)
114 ### Business Process <a id="addons-business-process"></a>
116 Create top-level views of your applications in a graphical editor.
117 Rules express dependencies between existing hosts and services and
118 let you alert on application level. Business processes are displayed
119 in a tree or list overview and can be added to any dashboard.
121 ![Icinga Web 2 Business Process](images/addons/icingaweb2_businessprocess.png)
123 ### NagVis <a id="addons-visualization-nagvis"></a>
125 By using the [DB IDO](14-features.md#db-ido) feature
126 you can create your own network maps
127 based on your monitoring configuration and status data using [NagVis](https://www.nagvis.org).
129 The configuration in nagvis.ini.php should look like this for Livestatus for example:
133 backendtype="mklivestatus"
134 socket="unix:/var/run/icinga2/cmd/livestatus"
137 If you are planning an integration into Icinga Web 2, look at [this module](https://github.com/Icinga/icingaweb2-module-nagvis).
139 ### Icinga Reporting <a id="addons-visualization-reporting"></a>
141 By enabling the [DB IDO](14-features.md#db-ido) feature you can use the
142 [Icinga Reporting package](https://icinga.com/docs/icinga1/latest/en/reporting.html).
144 ### Thruk <a id="addons-visualization-thruk"></a>
146 [Thruk](https://www.thruk.org) is an alternative web interface which can be used with Icinga 2
147 and the [Livestatus](14-features.md#setting-up-livestatus) feature.
149 ## Log Monitoring <a id="log-monitoring"></a>
151 Using [Logstash](https://www.elastic.co/guide/en/logstash/current/introduction.html) or
152 [Graylog](https://www.graylog.org) in your infrastructure and correlate events with your monitoring
153 is even simpler these days.
155 * Use the `GelfWriter` feature to write Icinga 2's check and notification events to Graylog or Logstash.
156 * Configure the logstash `nagios` output to send passive traps to Icinga 2 using the external command pipe.
157 * Execute a plugin to check Graylog alert streams.
159 More details can be found in [this blog post](https://icinga.com/2014/12/02/team-icinga-at-osmc-2014/).
161 ## Notification Scripts and Interfaces <a id="notification-scripts-interfaces"></a>
163 There's a variety of resources available, for example different notification scripts such as:
165 * E-Mail ([examples](03-monitoring-basics.md#alert-notifications) provided)
173 Additionally external services can be [integrated with Icinga 2](https://icinga.com/products/integrations/):
175 * [Pagerduty](https://icinga.com/products/integrations/pagerduty/)
176 * [VictorOps](https://icinga.com/products/integrations/victorops/)
177 * [StackStorm](https://icinga.com/products/integrations/stackstorm/)
179 More information can be found on the [Icinga Website](https://icinga.com/).
181 ## Configuration Management Tools <a id="configuration-tools"></a>
183 If you require your favourite configuration tool to export the Icinga 2 configuration, please get in
184 touch with their developers. The Icinga project does not provide a configuration web interface
185 yet. Follow the [Icinga Blog](https://icinga.com/blog/) for updates on this topic.
187 If you're looking for puppet manifests, chef cookbooks, ansible recipes, etc. -- we're happy
188 to integrate them upstream, so please get in touch with the [Icinga team](https://icinga.com/community/).
190 These tools are currently in development and require feedback and tests:
192 * [Ansible Roles](https://github.com/Icinga/icinga2-ansible)
193 * [Puppet Module](https://github.com/Icinga/puppet-icinga2)
194 * [Chef Cookbook](https://github.com/Icinga/chef-icinga2)
196 ## More Addon Integration Hints <a id="addon-integration-hints"></a>
198 ### PNP Action Url <a id="addons-graphing-pnp-action-url"></a>
200 They work in a similar fashion for Icinga 2 and are used for 1.x web interfaces (Icinga Web 2 doesn't require
201 the action url attribute in its own module).
204 template Host "pnp-hst" {
205 action_url = "/pnp4nagios/graph?host=$HOSTNAME$"
208 template Service "pnp-svc" {
209 action_url = "/pnp4nagios/graph?host=$HOSTNAME$&srv=$SERVICEDESC$"
213 ### PNP Custom Templates with Icinga 2 <a id="addons-graphing-pnp-custom-templates"></a>
215 PNP automatically determines the graph template from the check command name (or the argument's name).
216 This behavior changed in Icinga 2 compared to Icinga 1.x. Though there are certain possibilities to
219 * Create a symlink for example from the `templates.dist/check_ping.php` template to the actual check name in Icinga 2 (`templates/ping4.php`)
220 * Pass the check command name inside the [format template configuration](14-features.md#writing-performance-data-files)
222 The latter becomes difficult with agent based checks like NRPE or SSH where the first command argument acts as
223 graph template identifier. There is the possibility to define the pnp template name as custom attribute
224 and use that inside the formatting templates as `SERVICECHECKCOMMAND` for instance.
226 Example for services:
229 # vim /etc/icinga2/features-enabled/perfdata.conf
231 service_format_template = "DATATYPE::SERVICEPERFDATA\tTIMET::$icinga.timet$\tHOSTNAME::$host.name$\tSERVICEDESC::$service.name$\tSERVICEPERFDATA::$service.perfdata$\tSERVICECHECKCOMMAND::$service.check_command$$pnp_check_arg1$\tHOSTSTATE::$host.state$\tHOSTSTATETYPE::$host.state_type$\tSERVICESTATE::$service.state$\tSERVICESTATETYPE::$service.state_type$"
233 # vim /etc/icinga2/conf.d/services.conf
235 template Service "pnp-svc" {
236 action_url = "/pnp4nagios/graph?host=$HOSTNAME$&srv=$SERVICEDESC$"
237 vars.pnp_check_arg1 = ""
240 apply Service "nrpe-check" {
243 vars.nrpe_command = "check_disk"
245 vars.pnp_check_arg1 = "!$nrpe_command$"
249 If there are warnings about unresolved macros, make sure to specify a default value for `vars.pnp_check_arg1` inside the
251 In PNP, the custom template for nrpe is then defined in `/etc/pnp4nagios/custom/nrpe.cfg`
252 and the additional command arg string will be seen in the xml too for other templates.