]> granicus.if.org Git - icinga2/blob - doc/2.2-setting-up-check-plugins.md
Remove the 'Icinga' prefix for global constants.
[icinga2] / doc / 2.2-setting-up-check-plugins.md
1 ## <a id="setting-up-check-plugins"></a> Setting up Check Plugins
2
3 On its own Icinga 2 does not know how to check external services. The
4 [Monitoring Plugins Project](https://www.monitoring-plugins.org/) provides
5 an extensive set of plugins which can be used with Icinga 2 to check whether
6 services are working properly.
7
8 The recommended way of installing these standard plugins is to use your
9 distribution's package manager.
10
11 > **Note**
12 >
13 > The `Nagios Plugins` project was renamed to `Monitoring Plugins`
14 > in January 2014. At the time of this writing the packages are still
15 > using the old name.
16
17 For your convenience here is a list of package names for some of the more
18 popular operating systems/distributions:
19
20 OS/Distribution        | Package Name       | Installation Path
21 -----------------------|--------------------|---------------------------
22 RHEL/CentOS (EPEL)     | nagios-plugins-all | /usr/lib/nagios/plugins or /usr/lib64/nagios/plugins
23 Debian                 | nagios-plugins     | /usr/lib/nagios/plugins
24 FreeBSD                | nagios-plugins     | /usr/local/libexec/nagios
25 OS X (MacPorts)        | nagios-plugins     | /opt/local/libexec
26
27 Depending on which directory your plugins are installed into you may need to
28 update the global `PluginDir` constant in your Icinga 2 configuration. This macro is used
29 by the service templates contained in the Icinga Template Library to determine
30 where to find the plugin binaries.
31
32 ### <a id="integrate-additional-plugins"></a> Integrate Additional Plugins
33
34 For some services you may need additional check plugins which are not provided
35 by the official Monitoring Plugins project.
36
37 All existing Nagios or Icinga 1.x plugins should work with Icinga 2. Here's a
38 list of popular community sites which host check plugins:
39
40 * [MonitoringExchange](https://www.monitoringexchange.org)
41 * [Icinga Wiki](https://wiki.icinga.org)
42
43 The recommended way of setting up these plugins is to copy them to a common directory
44 and creating an extra global constant, e.g. `CustomPluginDir` in your `constants.conf`
45 configuration file:
46
47     # cp check_snmp_int.pl /opt/plugins
48     # chmod +x /opt/plugins/check_snmp_int.pl
49
50     # cat /etc/icinga2/constants.conf
51     /**
52      * This file defines global constants which can be used in
53      * the other configuration files. At a minimum the
54      * PluginDir constant should be defined.
55      */
56
57     const PluginDir = "/usr/lib/nagios/plugins"
58     const CustomPluginDir = "/opt/monitoring"
59
60 Prior to using the check plugin with Icinga 2 you should ensure that it is working properly
61 by trying to run it on the console using whichever user Icinga 2 is running as:
62
63     # su - icinga -s /bin/bash
64     $ /opt/plugins/check_snmp_int.pl --help
65     
66 Additional libraries may be required for some plugins. Please consult the plugin
67 documentation and/or README for installation instructions.