1 # <a id="addons-plugins"></a> Icinga 2 Addons and Plugins
3 ## <a id="addons-graphing-pnp"></a> PNP
5 [PNP](http://www.pnp4nagios.org) is a graphing addon. If you're planning to use
6 it you have to configure it to use the
7 [bulk mode with npcd and npcdmod](http://docs.pnp4nagios.org/pnp-0.6/modes#bulk_mode_with_npcd_and_npcdmod)
8 in combination with Icinga 2's [PerfdataWriter](4-advanced-topics.md#performance-data). NPCD collects the performance
9 data files which Icinga 2 generates.
11 ## <a id="addons-graphing-ingraph"></a> inGraph
13 [inGraph](https://www.netways.org/projects/ingraph/wiki) requires the ingraph-collector addon
14 to be configured to point at the perfdata files. Icinga 2's [PerfdataWriter](4-advanced-topics.md#performance-data) will
15 write to the performance data spool directory.
17 ## <a id="addons-graphing-graphite"></a> Graphite
19 There are Graphite addons available for collecting the performance data files as well. But
20 natively you can use the [GraphiteWriter](4-advanced-topics.md#graphite-carbon-cache-writer) feature.
22 ## <a id="addons-reporting"></a> Icinga Reporting
24 By enabling the DB IDO feature you can use the Icinga Reporting package.
26 ## <a id="addons-visualization-nagvis"></a> NagVis
28 By using either Livestatus or DB IDO as a backend you can create your own network maps
29 based on your monitoring configuration and status data using [NagVis](http://www.nagvis.org).
31 ## <a id="addons-thruk"></a> Thruk
33 [Thruk](http://www.thruk.org) is an alternative web interface which can be used with Icinga 2.
36 ## <a id="plugins"></a> Plugins
38 For some services you may need additional 'check plugins' which are not provided
39 by the official Monitoring Plugins project.
41 All existing Nagios or Icinga 1.x plugins work with Icinga 2. Here's a
42 list of popular community sites which host check plugins:
44 * [Icinga Exchange](https://exchange.icinga.org)
45 * [Icinga Wiki](https://wiki.icinga.org)
47 The recommended way of setting up these plugins is to copy them to a common directory
48 and create a new global constant, e.g. `CustomPluginDir` in your [constants.conf](5-configuring-icinga-2.md#constants-conf)
51 # cp check_snmp_int.pl /opt/monitoring/plugins
52 # chmod +x /opt/plugins/check_snmp_int.pl
54 # cat /etc/icinga2/constants.conf
56 * This file defines global constants which can be used in
57 * the other configuration files. At a minimum the
58 * PluginDir constant should be defined.
61 const PluginDir = "/usr/lib/nagios/plugins"
62 const CustomPluginDir = "/opt/monitoring/plugins"
64 Prior to using the check plugin with Icinga 2 you should ensure that it is working properly
65 by trying to run it on the console using whichever user Icinga 2 is running as:
67 # su - icinga -s /bin/bash
68 $ /opt/monitoring/plugins/check_snmp_int.pl --help
70 Additional libraries may be required for some plugins. Please consult the plugin
71 documentation and/or plugin provided README for installation instructions.
72 Sometimes plugins contain hard-coded paths to other components. Instead of changing
73 the plugin it might be easier to create logical links which is (more) update-safe.
75 Each plugin requires a [CheckCommand](6-object-types.md#objecttype-checkcommand) object in your
76 configuration which can be used in the [Service](6-object-types.md#objecttype-service) or
77 [Host](6-object-types.md#objecttype-host) object definition.
79 There are the following conventions to follow when adding a new command object definition:
81 * Always import the `plugin-check-command` template
82 * Use [command-arguments](#) whenever possible. The `command` attribute must be an array
83 in `[ ... ]` then for shell escaping.
84 * Define a unique `prefix` for the command's specific command arguments. That way you can safely
85 set them on host/service level and you'll always know which command they control.
86 * Use command argument default values, e.g. for thresholds
87 * Use [advanced conditions](6-object-types.md#objecttype-checkcommand) like `set_if` definitions.
89 Example for a custom `my-snmp-int` check command:
91 object CheckCommand "my-snmp-int" {
92 import "plugin-check-command"
94 command = [ CustomPluginDir + "/check_snmp_int.pl" ]
97 "-H" = "$snmp_address$"
98 "-C" = "$snmp_community$"
103 "-n" = "$snmp_interface$"
105 set_if = "$snmp_perf$"
112 vars.snmp_perf = true
113 vars.snmp_warn = "300,400"
114 vars.snmp_crit = "0,600"
117 Icinga 2 has built-in check command definitions for the [Manubulon Plugin Checks](7-icinga-template-library.md#snmp-manubulon-plugin-check-commands).
119 For further information on your monitoring configuration read the
120 [Monitoring Basics](3-monitoring-basics.md#monitoring-basics) chapter.
122 You can find additional plugins at the [Icinga Exchange](https://exchange.icinga.org)
124 More details on the plugins can also be found on the Icinga Wiki at https://wiki.icinga.org
126 ## <a id="plugin-api"></a> Plugin API
128 Currently Icinga 2 supports the native plugin API specification from the `Monitoring Plugins`
131 The `Monitoring Plugin API` is defined in the [Monitoring Plugins Development Guidelines](https://www.monitoring-plugins.org/doc/guidelines.html).
133 There are no output length restrictions using Icinga 2. This is different to the
134 [Icinga 1.x plugin api definition](http://docs.icinga.org/latest/en/pluginapi.html#outputlengthrestrictions).
136 ## <a id="configuration-tools"></a> Configuration Tools
138 If you require your favourite configuration tool to export Icinga 2 configuration, please get in
139 touch with their developers. The Icinga project does not provide a configuration web interface
144 > Get to know the new configuration format and the advanced [apply](3-monitoring-basics.md#using-apply) rules and
145 > use [syntax highlighting](10-addons-plugins.md#configuration-syntax-highlighting) in vim/nano.
147 If you're looking for puppet manifests, chef cookbooks, ansible recipes, etc - we're happy
148 to integrate them upstream, so please get in touch at [https://support.icinga.org](https://support.icinga.org).
150 These tools are in development and require feedback and tests:
152 * [Ansible Roles](https://github.com/Icinga/icinga2-ansible)
153 * [Puppet Module](https://github.com/Icinga/puppet-icinga2)
155 ## <a id="configuration-syntax-highlighting"></a> Configuration Syntax Highlighting
157 Icinga 2 ships configuration examples for syntax highlighting using the `vim` and `nano` editors.
158 The RHEL, SUSE and Debian package `icinga2-common` install these files into
159 `/usr/share/*/icinga2-common/syntax`. Sources provide these files in `tools/syntax`.
161 ### <a id="configuration-syntax-highlighting-vim"></a> Configuration Syntax Highlighting using Vim
163 Create a new local vim configuration storage, if not already existing.
164 Edit `vim/ftdetect/icinga2.vim` if your paths to the Icinga 2 configuration
168 $ mkdir -p $PREFIX/{syntax,ftdetect}
169 $ cp vim/syntax/icinga2.vim $PREFIX/syntax/
170 $ cp vim/ftdetect/icinga2.vim $PREFIX/ftdetect/
174 $ vim /etc/icinga2/conf.d/templates.conf
176 ### <a id="configuration-syntax-highlighting-nano"></a> Configuration Syntax Highlighting using Nano
178 Copy the `/etc/nanorc` sample file to your home directory. Create the `/etc/nano` directory
179 and copy the provided `icinga2.nanorc` into it.
181 $ cp /etc/nanorc ~/.nanorc
184 # cp icinga2.nanorc /etc/nano/
186 Then include the icinga2.nanorc file in your ~/.nanorc by adding the following line:
191 include "/etc/nano/icinga2.nanorc"
195 $ nano /etc/icinga2/conf.d/templates.conf