]> granicus.if.org Git - icinga2/blobdiff - doc/13-addons-plugins.md
Documentation: Refactor RemoteClient/Cluster/etc from community&training feedback
[icinga2] / doc / 13-addons-plugins.md
similarity index 51%
rename from doc/10-addons-plugins.md
rename to doc/13-addons-plugins.md
index 486273c6ad5c9d8b13078c0b63cddc030b3ece4c..0af4deea99d8de238fb56afea70c553b6d3a7b02 100644 (file)
 # <a id="addons-plugins"></a> Icinga 2 Addons and Plugins
 
-## <a id="addons-graphing-pnp"></a> PNP
+## <a id="addons-graphing"></a> Graphing
 
-[PNP](http://www.pnp4nagios.org) is a graphing addon. If you're planning to use
-it you have to configure it to use the
+### <a id="addons-graphing-pnp"></a> PNP
+
+[PNP](http://www.pnp4nagios.org) is a graphing addon.
+
+[PNP](http://www.pnp4nagios.org) is an addon which adds a graphical representation of the performance data collected
+by the monitoring plugins. The data is stored as rrd (round robin database) files.
+
+Use your distribution's package manager to install the `pnp4nagios` package.
+
+If you're planning to use it configure it to use the
 [bulk mode with npcd and npcdmod](http://docs.pnp4nagios.org/pnp-0.6/modes#bulk_mode_with_npcd_and_npcdmod)
 in combination with Icinga 2's [PerfdataWriter](4-advanced-topics.md#performance-data). NPCD collects the performance
 data files which Icinga 2 generates.
 
-## <a id="addons-graphing-ingraph"></a> inGraph
+Enable performance data writer in icinga 2
+
+    # icinga2 feature enable perfdata
+
+Configure npcd to use the performance data created by Icinga 2:
+
+    vim /etc/pnp4nagios/npcd.cfg
+
+Set `perfdata_spool_dir = /var/spool/icinga2/perfdata` and restart the `npcd` daemon.
+
+There's also an Icinga Web 2 module for direct PNP graph integration
+available at https://exchange.icinga.org/icinga/PNP4Nagios
+
+More information on [action_url as attribute](12-addons-plugins.md#addons-graphing-pnp-action-url)
+and [graph template names](12-addons-plugins.md#addons-graphing-pnp-custom-templates).
+
+
+### <a id="addons-graphing-graphite"></a> Graphite
+
+[Graphite](http://graphite.readthedocs.org/en/latest/) is a time-series database
+storing collected metrics and making them available through restful apis
+and web interfaces.
+
+Graphite consists of 3 software components:
+
+* carbon - a Twisted daemon that listens for time-series data
+* whisper - a simple database library for storing time-series data (similar in design to RRD)
+* graphite webapp - A Django webapp that renders graphs on-demand using Cairo
+
+Use the [GraphiteWriter](4-advanced-topics.md#graphite-carbon-cache-writer) feature
+for sending real-time metrics from Icinga 2 to Graphite.
+
+    # icinga 2 feature enable graphite
+
+There are Graphite addons available for collecting the performance data files too (e.g. `Graphios`).
+
+### <a id="addons-graphing-ingraph"></a> inGraph
 
 [inGraph](https://www.netways.org/projects/ingraph/wiki) requires the ingraph-collector addon
 to be configured to point at the perfdata files. Icinga 2's [PerfdataWriter](4-advanced-topics.md#performance-data) will
 write to the performance data spool directory.
 
-## <a id="addons-graphing-graphite"></a> Graphite
+## <a id="addons-visualization"></a> Visualization
 
-There are Graphite addons available for collecting the performance data files as well. But
-natively you can use the [GraphiteWriter](4-advanced-topics.md#graphite-carbon-cache-writer) feature.
-
-## <a id="addons-reporting"></a> Icinga Reporting
+### <a id="addons-visualization-reporting"></a> Icinga Reporting
 
 By enabling the DB IDO feature you can use the Icinga Reporting package.
 
-## <a id="addons-visualization-nagvis"></a> NagVis
+### <a id="addons-visualization-nagvis"></a> NagVis
 
 By using either Livestatus or DB IDO as a backend you can create your own network maps
 based on your monitoring configuration and status data using [NagVis](http://www.nagvis.org).
 
-## <a id="addons-thruk"></a> Thruk
+### <a id="addons-visualization-thruk"></a> Thruk
 
 [Thruk](http://www.thruk.org) is an alternative web interface which can be used with Icinga 2.
 
+## <a id="log-monitoring"></a> Log Monitoring
+
+Using Logstash or Graylog in your infrastructure and correlate events with your monitoring
+is even simpler these days.
+
+* Use the `GelfWriter` feature to write Icinga 2's check and notification events to Graylog or Logstash.
+* Configure the logstash `nagios` output to send passive traps to Icinga 2 using the external command pipe.
+* Execute a plugin to check Graylog alert streams.
+
+More details can be found in [this blog post](https://www.icinga.org/2014/12/02/team-icinga-at-osmc-2014/).
+
+## <a id="configuration-tools"></a> Configuration Management Tools
+
+If you require your favourite configuration tool to export Icinga 2 configuration, please get in
+touch with their developers. The Icinga project does not provide a configuration web interface
+yet. Follow the [Icinga Blog](https://www.icinga.org/blog/) for updates on this topic.
+
+If you're looking for puppet manifests, chef cookbooks, ansible recipes, etc - we're happy
+to integrate them upstream, so please get in touch at [https://support.icinga.org](https://support.icinga.org).
+
+These tools are currently in development and require feedback and tests:
+
+* [Ansible Roles](https://github.com/Icinga/icinga2-ansible)
+* [Puppet Module](https://github.com/Icinga/puppet-icinga2)
+* [Chef Cookbook](https://github.com/Icinga/chef-icinga2)
+
 
 ## <a id="plugins"></a> Plugins
 
@@ -133,65 +200,57 @@ The `Monitoring Plugin API` is defined in the [Monitoring Plugins Development Gu
 There are no output length restrictions using Icinga 2. This is different to the
 [Icinga 1.x plugin api definition](http://docs.icinga.org/latest/en/pluginapi.html#outputlengthrestrictions).
 
-## <a id="configuration-tools"></a> Configuration Tools
 
-If you require your favourite configuration tool to export Icinga 2 configuration, please get in
-touch with their developers. The Icinga project does not provide a configuration web interface
-or similar.
+## <a id="addon-integration-hints"></a> More Addon Integration Hints
 
-> **Tip**
->
-> Get to know the new configuration format and the advanced [apply](3-monitoring-basics.md#using-apply) rules and
-> use [syntax highlighting](10-addons-plugins.md#configuration-syntax-highlighting) in vim/nano.
+### <a id="addons-graphing-pnp-action-url"></a> PNP Action Url
 
-If you're looking for puppet manifests, chef cookbooks, ansible recipes, etc - we're happy
-to integrate them upstream, so please get in touch at [https://support.icinga.org](https://support.icinga.org).
-
-These tools are in development and require feedback and tests:
-
-* [Ansible Roles](https://github.com/Icinga/icinga2-ansible)
-* [Puppet Module](https://github.com/Icinga/puppet-icinga2)
-
-## <a id="configuration-syntax-highlighting"></a> Configuration Syntax Highlighting
+They work in a similar fashion for Icinga 2 and are used for 1.x web interfaces (Icinga Web 2 doesn't require
+the action url attribute in its own module).
 
-Icinga 2 ships configuration examples for syntax highlighting using the `vim` and `nano` editors.
-The RHEL, SUSE and Debian package `icinga2-common` install these files into
-`/usr/share/*/icinga2-common/syntax`. Sources provide these files in `tools/syntax`.
-
-### <a id="configuration-syntax-highlighting-vim"></a> Configuration Syntax Highlighting using Vim
-
-Create a new local vim configuration storage, if not already existing.
-Edit `vim/ftdetect/icinga2.vim` if your paths to the Icinga 2 configuration
-differ.
+    template Service "pnp-hst" {
+      action_url = "/pnp4nagios/graph?host=$HOSTNAME$"
+    }
 
-    $ PREFIX=~/.vim
-    $ mkdir -p $PREFIX/{syntax,ftdetect}
-    $ cp vim/syntax/icinga2.vim $PREFIX/syntax/
-    $ cp vim/ftdetect/icinga2.vim $PREFIX/ftdetect/
+    template Service "pnp-svc" {
+      action_url = "/pnp4nagios/graph?host=$HOSTNAME$&srv=$SERVICEDESC$"
+    }
 
-Test it:
+### <a id="addons-graphing-pnp-custom-templates"></a> PNP Custom Templates with Icinga 2
 
-    $ vim /etc/icinga2/conf.d/templates.conf
+PNP automatically determines the graph template from the check command name (or the argument's name).
+This behavior changed in Icinga 2 compared to Icinga 1.x. Though there are certain possibilities to
+fix this:
 
-### <a id="configuration-syntax-highlighting-nano"></a> Configuration Syntax Highlighting using Nano
+* Create a symlink for example from the `templates.dist/check_ping.php` template to the actual check name in Icinga 2 (`templates/ping4.php`)
+* Pass the check command name inside the [format template configuration](04-advanced-topics.md#writing-performance-data-files)
 
-Copy the `/etc/nanorc` sample file to your home directory. Create the `/etc/nano` directory
-and copy the provided `icinga2.nanorc` into it.
+The latter becomes difficult with agent based checks like NRPE or SSH where the first command argument acts as
+graph template identifier. There is the possibility to define the pnp template name as custom attribute
+and use that inside the formatting templates as `SERVICECHECKCOMMAND` for instance.
 
-    $ cp /etc/nanorc ~/.nanorc
+Example for services:
 
-    # mkdir -p /etc/nano
-    # cp icinga2.nanorc /etc/nano/
+    # vim /etc/icinga2/features-enabled/perfdata.conf
 
-Then include the icinga2.nanorc file in your ~/.nanorc by adding the following line:
+    service_format_template = "DATATYPE::SERVICEPERFDATA\tTIMET::$icinga.timet$\tHOSTNAME::$host.name$\tSERVICEDESC::$service.name$\tSERVICEPERFDATA::$service.perfdata$\tSERVICECHECKCOMMAND::$service.checkcommand$$pnp_check_arg1$\tHOSTSTATE::$host.state$\tHOSTSTATETYPE::$host.statetype$\tSERVICESTATE::$service.state$\tSERVICESTATETYPE::$service.statetype$"
 
-    $ vim ~/.nanorc
+    # vim /etc/icinga2/conf.d/services.conf
 
-    ## Icinga 2
-    include "/etc/nano/icinga2.nanorc"
+    template Service "pnp-svc" {
+      action_url = "/pnp4nagios/graph?host=$HOSTNAME$&srv=$SERVICEDESC$"
+      vars.pnp_check_arg1 = ""
+    }
 
-Test it:
+    apply Service "nrpe-check" {
+      import "pnp-svc"
+      check_command = nrpe
+      vars.nrpe_command = "check_disk"
 
-    $ nano /etc/icinga2/conf.d/templates.conf
+      vars.pnp_check_arg1 = "!$nrpe_command$"
+    }
 
+If there are warnings about unresolved macros make sure to specify a default value for `vars.pnp_check_arg1` inside the
 
+In PNP, the custom template for nrpe is then defined in `/etc/pnp4nagios/custom/nrpe.cfg`
+and the additional command arg string will be seen in the xml too for other templates.
\ No newline at end of file