Code

Merged branch 'configsplit'.
authorSebastian Harl <sh@tokkee.org>
Mon, 18 Mar 2013 04:57:06 +0000 (05:57 +0100)
committerSebastian Harl <sh@tokkee.org>
Mon, 18 Mar 2013 04:57:06 +0000 (05:57 +0100)
debian/README.Debian
debian/control
debian/npcdmod.cfg [new file with mode: 0644]
debian/pnp4nagios-bin.postinst
debian/pnp4nagios-bin.postrm
debian/pnp4nagios-web-config-icinga.examples [new file with mode: 0644]
debian/pnp4nagios-web-config-nagios3.install [new file with mode: 0644]
debian/pnp4nagios-web.install
debian/rules

index 5311c2f50b60b39d501d342f4c84c88265c38928..f1378da40925091499ce85742e7d84dc6fdcbf38 100644 (file)
@@ -5,8 +5,8 @@ PNP4Nagios supports several modes of operation. They differ in the way how
 performance data is being processed and, thus, the efficiency of PNP. Detailed
 documentation is available at <http://docs.pnp4nagios.org/pnp-0.6/modes>.
 
-Using bulk mode
----------------
+Using bulk mode for Nagios3
+---------------------------
 
 We recommend to use bulk mode with NPCD and npcdmod. This will facilitate an
 easy installation and fast processing of performance data. To enable NPCD, set
@@ -21,9 +21,31 @@ To register the NPC event broker module (npcdmod), add the following line
 
 "broker_module=/usr/lib/pnp4nagios/npcdmod.o config_file=/etc/pnp4nagios/npcd.cfg"
 
-Finally reload your Nagios server by running "/etc/init.d/nagios3 reload". All
+Finally reload your Nagios server by running "service nagios3 reload". All
 performance data should be processed now.
 
+Using bulk mode for Icinga
+---------------------------
+
+We recommend to use bulk mode with NPCD and npcdmod. This will facilitate an
+easy installation and fast processing of performance data. To enable NPCD, set
+'RUN' to 'yes' in /etc/default/npcd.
+
+In order to enable processing of performance data in Nagios, please change the
+"process_performance_data" statement in "/etc/icinga/icinga.cfg" to
+"process_performance_data=1".
+
+To register the NPC event broker module (npcdmod), copy the file
+"/usr/share/doc/pnp4nagios-web-config-icinga/examples/npcdmod.cfg" to
+"/etc/icinga/modules"
+
+Finally reload your Icinga server by running "service icinga reload". All
+performance data should be processed now.
+
+
+Add links for PNP4Nagios to Nagios/Icinga Webfrontend
+-----------------------------------------------------
+
 If you want links to PNP4Nagios for your monitored hosts and services in the
 Nagios web frontend just add
 
@@ -50,8 +72,8 @@ instructions.
 In addition, the following configuration is required to get you started:
 
 - Enable processing of performance data in Nagios: set
-  'process_performance_data=1' in "/etc/nagios3/nagios.cfg" and reload your
-  Nagios server: /etc/init.d/nagios3 reload.
+  'process_performance_data=1' in "/etc/nagios3/nagios.cfg" or "/etc/icinga/icingacfg" 
+  and reload your monitoring system: "service icinga/nagios reload".
 
 - Enable the PNP Gearman worker daemon by setting 'RUN' to 'yes' in
   /etc/default/pnp_gearman_worker. Check the Gearman related options in
@@ -67,13 +89,3 @@ available in the libgearman-client-perl, perl, and libcrypt-rijndael-perl
 Debian packages (see packages suggested by pnp4nagios-bin).
 
  -- Sebastian Harl <tokkee@debian.org>  Wed, 27 Apr 2011 09:32:52 +0200
-
-Installation with Icinga
-------------------------
-
-If you use Icinga you also have to change /etc/pnp4nagios/apache.conf and
-replace the line "AuthUserFile /etc/nagios3/htpasswd.users" with
-"AuthUserFile /etc/icinga/htpasswd.users".
-
- -- Alexander Reichle-Schmehl <tolimar@debian.org>  Tue, 25 Oct 2011 14:31:28 +0200
-
index edfbf00a4f46e13e56c2264f881502604115c15a..24fe2636e14cb4afc862b4d7043002e551c45a6b 100644 (file)
@@ -3,8 +3,12 @@ Section: net
 Priority: optional
 Maintainer: Debian Nagios Maintainer Group <pkg-nagios-devel@lists.alioth.debian.org>
 Uploaders: Sebastian Harl <tokkee@debian.org>, Sven Velt <sven@velt.de>
-Build-Depends: autotools-dev, debhelper (>= 7), po-debconf, quilt,
- rrdtool, librrds-perl
+Build-Depends: autotools-dev,
+               debhelper (>= 7),
+               librrds-perl,
+               po-debconf,
+               quilt,
+               rrdtool
 Standards-Version: 3.9.2
 Homepage: http://www.pnp4nagios.org/
 Vcs-Git: git://git.debian.org/pkg-nagios/pkg-pnp4nagios.git
@@ -24,9 +28,12 @@ Description: Nagios addon to create graphs from performance data
 
 Package: pnp4nagios-bin
 Architecture: any
-Depends: librrds-perl, adduser, ${shlibs:Depends}, ${misc:Depends}
-Recommends: pnp4nagios-web, nagios3 | icinga
-Suggests: rrdcached, perl, libgearman-client-perl, libcrypt-rijndael-perl
+Depends: adduser,
+         librrds-perl,
+         ${misc:Depends},
+         ${shlibs:Depends}
+Recommends: nagios3 | icinga, pnp4nagios-web
+Suggests: libcrypt-rijndael-perl, libgearman-client-perl, perl, rrdcached
 Description: Nagios addon to create graphs from performance data (binaries)
  PNP is a graphing tool for Nagios that analyzes performance data provided by
  plugins and stores them automatically into Round Robin Databases (RRD). It
@@ -40,15 +47,56 @@ Description: Nagios addon to create graphs from performance data (binaries)
  .
  This package contains the NPCD-related binaries and process_perfdata.pl.
 
+Package: pnp4nagios-web-config-icinga
+Architecture: any
+Depends: ${misc:Depends},
+         ${shlibs:Depends}
+Conflicts: pnp4nagios-web-config-nagios3
+Replaces: pnp4nagios-web
+Description: Nagios addon to create graphs from performance data (binaries)
+ PNP is a graphing tool for Nagios that analyzes performance data provided by
+ plugins and stores them automatically into Round Robin Databases (RRD). It
+ fully integrates itself into the Nagios Monitoring Website.
+ .
+ PNP's goal is to be easily configurable and maintainable. It supports several
+ modes of operation. When using the Gearman mode, some additional Perl modules
+ are required: Gearman::Worker, MIME::Base64, and Crypt::Rijndael which are
+ available in the libgearman-client-perl, perl, and libcrypt-rijndael-perl
+ packages.
+ .
+ This package contains the icinga specific configuration for pnp4nagios-web.
+
+Package: pnp4nagios-web-config-nagios3
+Architecture: any
+Depends: ${misc:Depends},
+         ${shlibs:Depends}
+Conflicts: pnp4nagios-web-config-icinga
+Replaces: pnp4nagios-web
+Description: Nagios addon to create graphs from performance data (binaries)
+ PNP is a graphing tool for Nagios that analyzes performance data provided by
+ plugins and stores them automatically into Round Robin Databases (RRD). It
+ fully integrates itself into the Nagios Monitoring Website.
+ .
+ PNP's goal is to be easily configurable and maintainable. It supports several
+ modes of operation. When using the Gearman mode, some additional Perl modules
+ are required: Gearman::Worker, MIME::Base64, and Crypt::Rijndael which are
+ available in the libgearman-client-perl, perl, and libcrypt-rijndael-perl
+ packages.
+ .
+ This package contains the nagios3 specific configuration for pnp4nagios-web.
+
 Package: pnp4nagios-web
 Architecture: all
-Depends: libapache2-mod-php5 | php5-cgi | php5, php5-gd,
- libkohana2-php,
- libfpdi-php,
- libjs-jquery (>= 1.6.2), libjs-jquery-ui (>= 1.8.14),
- rrdtool,
- adduser,
- ${misc:Depends}
+Depends: adduser,
+         pnp4nagios-web-config-nagios3 | pnp4nagios-web-config-icinga,
+         libapache2-mod-php5 | php5-cgi | php5,
+         libfpdi-php,
+         libjs-jquery (>= 1.6.2),
+         libjs-jquery-ui (>= 1.8.14),
+         libkohana2-php,
+         php5-gd,
+         rrdtool,
+         ${misc:Depends}
 Recommends: pnp4nagios-bin
 Suggests: rrdcached
 Description: Nagios addon to create graphs from performance data (web interface)
diff --git a/debian/npcdmod.cfg b/debian/npcdmod.cfg
new file mode 100644 (file)
index 0000000..be77513
--- /dev/null
@@ -0,0 +1,15 @@
+# icinga config for npcdmod
+#
+# In order to have Icinga run the IDOMOD event broker module, you'll need
+# to place a file like this into /etc/icinga/modules/.
+#
+# ATTENTION: DO NOT load the same module here AND via broker_module in icinga.cfg
+# This can lead into problems with races on ressources.
+#
+
+define module{
+        module_name     npcdmod
+        module_type     neb
+        path            /usr/lib/pnp4nagios/npcdmod.o
+        args            config_file=/etc/pnp4nagios/npcd.cfg
+}
index d3bc3404f0f3b10e03188dfe10e95fa234947f5a..9e6929064cdc542352cc0d6c820a031ee12bc54d 100644 (file)
@@ -50,6 +50,12 @@ case "$1" in
                                ln -s /etc/pnp4nagios/nagios.cfg /etc/nagios3/conf.d/pnp4nagios.cfg
                        fi
                fi
+               if [ -d /etc/icinga/objects/ ]; then
+                       if [ ! -e /etc/icinga/objects/pnp4nagios.cfg ]; then
+                               ln -s /etc/pnp4nagios/nagios.cfg /etc/icinga/objects/pnp4nagios.cfg
+                       fi
+               fi
+
        ;;
 
        abort-upgrade|abort-remove|abort-deconfigure)
index 7e12fcd2e604c8f86d1f6b6f9f27e2daf45eb784..369f60b4b5020be02065c0e3deb25c4b7b3907c3 100644 (file)
@@ -29,6 +29,15 @@ case "$1" in
                                fi
                        fi
                fi
+               if [ -d /etc/icinga/objects/ ]; then
+                       if [ -L /etc/icinga/objects/pnp4nagios.cfg ]; then
+                               ls -l /etc/icinga/objects/pnp4nagios.cfg | grep -q /etc/pnp4nagios/nagios.cfg
+                               if [ $? -eq 0 ]; then
+                                       rm -f /etc/icinga/objects/pnp4nagios.cfg
+                               fi
+                       fi
+               fi
+
        ;;
        upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
        ;;
diff --git a/debian/pnp4nagios-web-config-icinga.examples b/debian/pnp4nagios-web-config-icinga.examples
new file mode 100644 (file)
index 0000000..51bf4bb
--- /dev/null
@@ -0,0 +1 @@
+debian/npcdmod.cfg
diff --git a/debian/pnp4nagios-web-config-nagios3.install b/debian/pnp4nagios-web-config-nagios3.install
new file mode 100644 (file)
index 0000000..c3605a3
--- /dev/null
@@ -0,0 +1,2 @@
+etc/pnp4nagios/apache.conf
+etc/pnp4nagios/config.php
index 0bbade8d6c8134f1ed816d48fe63fd6fe5b13cf8..fccb4cb00ce7bf45b02376bc6d23b319ac79e654 100644 (file)
@@ -1,11 +1,9 @@
-etc/pnp4nagios/apache.conf
 etc/pnp4nagios/background.pdf
 etc/pnp4nagios/templates/
 etc/pnp4nagios/templates.d/
 etc/pnp4nagios/pages/
 etc/pnp4nagios/templates.special/
 etc/pnp4nagios/pnp4nagios_release
-etc/pnp4nagios/config.php
 usr/share/doc/pnp4nagios/examples/templates.special/
 usr/share/doc/pnp4nagios/examples/pages/
 usr/share/doc/pnp4nagios/examples/ssi/
index b9e40d08de68c35d6e5c7c361280869cb747a35a..acb0c5600f23195b40a864445039202bc3457e81 100755 (executable)
@@ -155,6 +155,16 @@ install: build
        rmdir debian/tmp/usr/share/pnp4nagios/html/application/hooks/
        #rmdir debian/tmp/usr/share/pnp4nagios/html/application/libraries/
 
+       #create modified version of icinga specific configs
+       mkdir -p debian/pnp4nagios-web-config-icinga/etc/pnp4nagios
+       sed -e 's/nagios3/icinga/' -e 's/Nagios/Icinga/' \
+               debian/tmp/etc/pnp4nagios/apache.conf >\
+               debian/pnp4nagios-web-config-icinga/etc/pnp4nagios/apache.conf
+
+       sed -e 's/nagios3/icinga/' -e 's/nagiosadmin/icingadmin/' \
+               debian/tmp/etc/pnp4nagios/config.php >\
+               debian/pnp4nagios-web-config-icinga/etc/pnp4nagios/config.php
+
        mkdir debian/tmp/etc/pnp4nagios/templates.d
        cp debian/README.templates.d debian/tmp/etc/pnp4nagios/templates.d/README