]> granicus.if.org Git - icinga2/blob - doc/13-addons.md
Merge pull request #7169 from Icinga/feature/enhance-docs
[icinga2] / doc / 13-addons.md
1 # Icinga 2 Addons <a id="addons"></a>
2
3 ## Graphing <a id="addons-graphing"></a>
4
5 ### Graphite <a id="addons-graphing-graphite"></a>
6
7 [Graphite](https://graphite.readthedocs.org/en/latest/) is a time-series database
8 storing collected metrics and making them available through restful apis
9 and web interfaces.
10
11 Graphite consists of 3 software components:
12
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
16
17 You need to install Graphite first, then proceed with configuring it in Icinga 2.
18
19 Use the [GraphiteWriter](14-features.md#graphite-carbon-cache-writer) feature
20 for sending real-time metrics from Icinga 2 to Graphite.
21
22 ```
23 # icinga2 feature enable graphite
24 ```
25
26 A popular alternative frontend for Graphite is for example [Grafana](https://grafana.org).
27
28 Integration in Icinga Web 2 is possible by installing the official [graphite module](https://icinga.com/docs/graphite/latest/).
29
30 ![Icinga Web 2 Detail View with Graphite](images/addons/icingaweb2_graphite.png)
31
32
33 ### InfluxDB <a id="addons-graphing-influxdb"></a>
34
35 [InfluxDB](https://influxdb.com) is a time series, metrics, and analytics database.
36 It’s written in Go and has no external dependencies.
37
38 Use the [InfluxdbWriter](14-features.md#influxdb-writer) feature
39 for sending real-time metrics from Icinga 2 to InfluxDB.
40
41 ```
42 # icinga2 feature enable influxdb
43 ```
44
45 A popular frontend for InfluxDB is for example [Grafana](https://grafana.org).
46
47 Integration in Icinga Web 2 is possible by installing the community [Grafana module](https://github.com/Mikesch-mp/icingaweb2-module-grafana).
48
49 ![Icinga Web 2 Detail View with Grafana](images/addons/icingaweb2_grafana.png)
50
51
52 ### PNP <a id="addons-graphing-pnp"></a>
53
54 [PNP](https://www.pnp4nagios.org) is a graphing addon.
55
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.
58
59 Use your distribution's package manager to install the `pnp4nagios` package.
60
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#writing-performance-data-files). NPCD collects the performance
64 data files which Icinga 2 generates.
65
66 Enable performance data writer in icinga 2
67
68 ```
69 # icinga2 feature enable perfdata
70 ```
71
72 Configure npcd to use the performance data created by Icinga 2:
73
74 ```
75 vim /etc/pnp4nagios/npcd.cfg
76 ```
77
78 Set `perfdata_spool_dir = /var/spool/icinga2/perfdata` and restart the `npcd` daemon.
79
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).
82
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).
85
86
87 ## Visualization <a id="addons-visualization"></a>
88
89 ### Maps <a id="addons-visualization-maps"></a>
90
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)
93 from Icinga 2.
94
95 If you configure multiple hosts with the same coordinates, i.e. servers in a datacenter, a clustered view is rendered.
96
97 Check the  [Map module docs](https://github.com/nbuchwitz/icingaweb2-module-map) for more details on
98 installation, configuration and integration.
99
100 ![Icinga Web 2 Maps](images/addons/icingaweb2_maps.png)
101
102 ### Dashing Dashboard <a id="addons-visualization-dashing-dashboard"></a>
103
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.
108
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.
111
112 ![Dashing dashboard](images/addons/dashing_icinga2.png)
113
114 ### Business Process <a id="addons-business-process"></a>
115
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.
120
121 ![Icinga Web 2 Business Process](images/addons/icingaweb2_businessprocess.png)
122
123 ### NagVis <a id="addons-visualization-nagvis"></a>
124
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).
128
129 The configuration in nagvis.ini.php should look like this for Livestatus for example:
130
131 ```
132 [backend_live_1]
133 backendtype="mklivestatus"
134 socket="unix:/var/run/icinga2/cmd/livestatus"
135 ```
136
137 If you are planning an integration into Icinga Web 2, look at [this module](https://github.com/Icinga/icingaweb2-module-nagvis).
138
139 ### Icinga Reporting <a id="addons-visualization-reporting"></a>
140
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).
143
144 ### Thruk <a id="addons-visualization-thruk"></a>
145
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.
148
149 ## Log Monitoring <a id="log-monitoring"></a>
150
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.
154
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.
158
159 More details can be found in [this blog post](https://icinga.com/2014/12/02/team-icinga-at-osmc-2014/).
160
161 ## Notification Scripts and Interfaces <a id="notification-scripts-interfaces"></a>
162
163 There's a variety of resources available, for example different notification scripts such as:
164
165 * E-Mail ([examples](03-monitoring-basics.md#alert-notifications) provided)
166 * SMS
167 * Pager (XMPP, etc.)
168 * Twitter
169 * IRC
170 * Ticket systems
171 * etc.
172
173 Additionally external services can be [integrated with Icinga 2](https://icinga.com/products/integrations/):
174
175 * [Pagerduty](https://icinga.com/products/integrations/pagerduty/)
176 * [VictorOps](https://icinga.com/products/integrations/victorops/)
177 * [StackStorm](https://icinga.com/products/integrations/stackstorm/)
178
179 More information can be found on the [Icinga Website](https://icinga.com/).
180
181 ## Configuration Management Tools <a id="configuration-tools"></a>
182
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.
186
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/).
189
190 These tools are currently in development and require feedback and tests:
191
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)
195
196 ## More Addon Integration Hints <a id="addon-integration-hints"></a>
197
198 ### PNP Action Url <a id="addons-graphing-pnp-action-url"></a>
199
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).
202
203 ```
204 template Host "pnp-hst" {
205   action_url = "/pnp4nagios/graph?host=$HOSTNAME$"
206 }
207
208 template Service "pnp-svc" {
209   action_url = "/pnp4nagios/graph?host=$HOSTNAME$&srv=$SERVICEDESC$"
210 }
211 ```
212
213 ### PNP Custom Templates with Icinga 2 <a id="addons-graphing-pnp-custom-templates"></a>
214
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
217 fix this:
218
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)
221
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.
225
226 Example for services:
227
228 ```
229 # vim /etc/icinga2/features-enabled/perfdata.conf
230
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$"
232
233 # vim /etc/icinga2/conf.d/services.conf
234
235 template Service "pnp-svc" {
236   action_url = "/pnp4nagios/graph?host=$HOSTNAME$&srv=$SERVICEDESC$"
237   vars.pnp_check_arg1 = ""
238 }
239
240 apply Service "nrpe-check" {
241   import "pnp-svc"
242   check_command = nrpe
243   vars.nrpe_command = "check_disk"
244
245   vars.pnp_check_arg1 = "!$nrpe_command$"
246 }
247 ```
248
249 If there are warnings about unresolved macros, make sure to specify a default value for `vars.pnp_check_arg1` inside the
250
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.