[Pkg-nagios-changes] [pkg-check-mk] 01/01: Revert "Drop binary package for nagios3 which is no longer in Debian."

Matt Taggart taggart at moszumanska.debian.org
Thu Dec 8 19:33:04 UTC 2016


This is an automated email from the git hooks/post-receive script.

taggart pushed a commit to branch master
in repository pkg-check-mk.

commit b812b731501eb7c5c87f3fddcc3ff9504d247655
Author: Matt Taggart <taggart at debian.org>
Date:   Thu Dec 8 11:30:50 2016 -0800

    Revert "Drop binary package for nagios3 which is no longer in Debian."
    
    This reverts commit 5978742ccffdb97991907253940eaadc00cef940.
    
    Conflicts:
    	debian/changelog
    
    Temporarily reverting this due to needing to be able to provide
    backports, will reapply later.
---
 debian/README.Debian                    | 13 ++++--
 debian/apache.nagios3                   | 76 ++++++++++++++++++++++++++++++
 debian/changelog                        |  1 -
 debian/check-mk-config-nagios3.install  |  2 +
 debian/check-mk-config-nagios3.links    |  2 +
 debian/check-mk-config-nagios3.postinst | 83 +++++++++++++++++++++++++++++++++
 debian/check-mk-config-nagios3.postrm   | 32 +++++++++++++
 debian/check-mk-config-nagios3.preinst  | 10 ++++
 debian/check-mk-config-nagios3.prerm    |  0
 debian/control                          | 19 +++++++-
 debian/defaults.nagios3                 | 54 +++++++++++++++++++++
 debian/rules                            |  5 ++
 12 files changed, 289 insertions(+), 8 deletions(-)

diff --git a/debian/README.Debian b/debian/README.Debian
index d51b733..46f1a9b 100644
--- a/debian/README.Debian
+++ b/debian/README.Debian
@@ -1,9 +1,12 @@
 check-mk-livestatus
 ===================
 
-To load the event broker add the following lines to your Icinga
+To load the event broker add the following lines to your Nagios/Icinga
 configuration:
 
+Nagios3:
+broker_module=/usr/lib/check_mk/livestatus.o /var/lib/nagios3/rw/live
+
 Icinga:
 broker_module=/usr/lib/check_mk/livestatus.o /var/lib/icinga/rw/live
 
@@ -22,10 +25,10 @@ On the server side you need multisite enabled to see the logs. If you also want
 to acknowledge the alarms (recommended) put www-data into the nagios group
 
 
-check-mk-config-icinga
-======================
+check-mk-config-nagios3 and check-mk-config-icinga
+==================================================
 
 Check-MK's web frontend "Multisite" (package "check-mk-multisite") and the
-server part of Check-MK ("check-mk-server") can only be used with Icinga.
-Please install the "check-mk-config-icinga" package.
+server part of Check-MK ("check-mk-server") can only be used with either
+Nagios3 or Icinga. Please install the adequate "check-mk-config-*" package.
 
diff --git a/debian/apache.nagios3 b/debian/apache.nagios3
new file mode 100644
index 0000000..1cc690e
--- /dev/null
+++ b/debian/apache.nagios3
@@ -0,0 +1,76 @@
+# Created by setup of check_mk version 1.2.6p12
+# This file will *not* be overwritten at the next setup
+# of check_mk. You may edit it as needed. In order to get
+# a new version, please delete it and re-run setup.sh.
+
+# Note for RedHat 5.3 users (and probably other version:
+# this file must be loaded *after* python.conf, otherwise
+# <IfModule mod_python.c> does not trigger! For that
+# reason, it is installed as zzz_.... Sorry for the
+# inconveniance.
+
+<IfModule mod_python.c>
+  Alias /check_mk /usr/share/check_mk/web/htdocs
+  <Directory /usr/share/check_mk/web/htdocs>
+        AddHandler mod_python .py
+        PythonHandler index
+        PythonDebug On
+	DirectoryIndex index.py
+
+        #Handle apache 2.2 and 2.4
+        <IfVersion >= 2.3>
+            Require local
+        </IfVersion>
+        <IfVersion < 2.3>
+            Order deny,allow
+            allow from all
+        </IfVersion>
+	# Need Nagios authentification. Please edit the
+	# following: Set AuthName and AuthUserFile to the
+	# same value that you use for your Nagios configuration!
+        Order deny,allow
+        allow from all
+	AuthName "Nagios Access"
+        AuthType Basic
+        AuthUserFile /etc/nagios3/htpasswd.users
+        require valid-user
+
+	ErrorDocument 403 "<h1>Authentication Problem</h1>Either you've entered an invalid password or the authentication<br>configuration of your check_mk web pages is incorrect.<br><br>Please make sure that you've edited the file<br><tt>/etc/apache2/conf.d/check_mk</tt> and made it use the same<br>authentication settings as your Nagios web pages.<br>Restart Apache afterwards."
+	ErrorDocument 500 "<h1>Server or Configuration Problem</h1>A Server problem occurred. You'll find details in the error log of Apache. One possible reason is, that the file <tt>/etc/nagios/htpasswd.users</tt> is missing. You can create that file with <tt>htpasswd</tt> or <tt>htpasswd2</tt>. A better solution might be to use your existing htpasswd file from your Nagios installation. Please edit <tt>/etc/apache2/conf.d/check_mk</tt> and change the path there. Restart Apache afterwards."
+  </Directory>
+  ## WARNING: automation is part of multisite, more information at
+  ##  http://mathias-kettner.com/checkmk_multisite_automation.html
+  ## It uses a shared secret rather than HTTP Auth for authentication and
+  ## and is potentially exposed to public networks so is disabled on Debian
+  ## by default. If you need this feature, be sure you understand the
+  ## security implications and take necessary precautions before turning it on.
+  ## Automation is done without HTTP Auth
+  #<Location "/check_mk/automation.py">
+  #     Order allow,deny
+  #     Allow from all
+  #     Satisfy any
+  #</Location>
+
+  ## WARNING: like automation above, run_cron is part of multisite.
+  ## It does not use HTTP Auth, but is only exposed to localhost. Having
+  ## it enabled has less risk, but since it's part of multisite it is
+  ## also disabled by default on Debian.
+  ## Trigger cron jobs. This is done without authentication
+  #<Location "/check_mk/run_cron.py">
+  #    Order deny,allow
+  #    Deny from all
+  #    Allow from 127.0.0.1
+  #    Satisfy any
+  #</Location>
+
+</IfModule>
+
+
+
+<IfModule !mod_python.c>
+  Alias /check_mk /usr/share/check_mk/web/htdocs
+  <Directory /usr/share/check_mk/web/htdocs>
+        Deny from all
+        ErrorDocument 403 "<h1>Check_mk: Incomplete Apache2 Installation</h1>You need mod_python in order to run the web interface of check_mk.<br> Please install mod_python and restart Apache."
+  </Directory>
+</IfModule>
diff --git a/debian/changelog b/debian/changelog
index 1a72044..46e914d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,7 +1,6 @@
 check-mk (1.2.6p12-2) UNRELEASED; urgency=medium
 
   * Team upload.
-  * Drop binary package for nagios3 which is no longer in Debian.
   * Update Vcs-* URLs to use HTTPS.
 
  -- Bas Couwenberg <sebastic at debian.org>  Sat, 03 Dec 2016 18:11:37 +0100
diff --git a/debian/check-mk-config-nagios3.install b/debian/check-mk-config-nagios3.install
new file mode 100644
index 0000000..b7510dd
--- /dev/null
+++ b/debian/check-mk-config-nagios3.install
@@ -0,0 +1,2 @@
+usr/share/check_mk/check_mk_templates.cfg etc/nagios3/conf.d/check_mk
+etc/check_mk/multisite.mk
diff --git a/debian/check-mk-config-nagios3.links b/debian/check-mk-config-nagios3.links
new file mode 100644
index 0000000..3bf633c
--- /dev/null
+++ b/debian/check-mk-config-nagios3.links
@@ -0,0 +1,2 @@
+usr/share/check_mk/modules/defaults    usr/share/check_mk/web/htdocs/defaults.py
+
diff --git a/debian/check-mk-config-nagios3.postinst b/debian/check-mk-config-nagios3.postinst
new file mode 100644
index 0000000..fdfa423
--- /dev/null
+++ b/debian/check-mk-config-nagios3.postinst
@@ -0,0 +1,83 @@
+#!/bin/bash
+
+set -e
+
+# a little helper for getting permissions right
+setperm() {
+    local user="$1"
+    local group="$2"
+    local mode="$3"
+    local file="$4"
+    shift 4
+    # only do something when no setting exists
+    if ! dpkg-statoverride --list "$file" >/dev/null 2>&1; then
+      chown "$user":"$group" "$file"
+      chmod "$mode" "$file"
+    fi
+}
+
+dpkg-maintscript-helper mv_conffile \
+    /etc/nagios3/conf.d/check_mk_templates.cfg \
+    /etc/nagios3/conf.d/check_mk/check_mk_templates.cfg \
+    1.1.10-2 -- "$@"
+
+# older releases (1.1.12p7-1 at least) delivered the multisite conffile to
+# /etc/apache2/conf.d. If it exists we need to move it to conf-available
+# once it's moved then the code below will setup the conf.d symlink.
+# This code wasn't in place until 1.2.6p4-2, so we need to check everything
+# before that.
+dpkg-maintscript-helper mv_conffile \
+    /etc/apache2/conf.d/check_mk_multisite.cfg \
+    /etc/apache2/conf-available/check_mk_multisite.cfg \
+    1.2.6p4-2 -- "$@"
+
+if [ -e '/etc/nagios3/conf.d/check_mk_objects.cfg' ];
+then
+    echo 'Migrate /etc/nagios3/conf.d/check_mk_objects.cfg to /etc/nagios3/conf.d/objects/check_mk/check_mk_objects.cfg'
+    mv /etc/nagios3/conf.d/check_mk_objects.cfg \
+    /etc/nagios3/conf.d/check_mk/check_mk_objects.cfg
+fi
+
+case "$1" in
+	  configure)
+		#make sure our nagios user exists  
+		if ! getent passwd nagios > /dev/null ; then
+			echo 'Adding system-user for nagios' 1>&2
+			adduser --system --group --home /var/lib/nagios \
+			  --disabled-login --force-badname nagios > /dev/null
+		fi
+		#fix permissions for some directorys
+		test -d /etc/nagios3/conf.d/check_mk || mkdir -p /etc/nagios3/conf.d/check_mk
+		setperm root nagios 0775 /etc/nagios3/conf.d/check_mk
+
+                #handle the apache2.2 -> apache2.4 upgrade (see https://wiki.debian.org/Apache/PackagingFor24)
+                CONF="check-mk-multisite"
+                COMMON_STATE=$(dpkg-query -f '${Status}' -W 'apache2.2-common' 2>/dev/null | awk '{print $3}' || true)
+
+                if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
+                        . /usr/share/apache2/apache2-maintscript-helper
+                        apache2_invoke enconf $CONF || exit $?
+                elif [ "$COMMON_STATE" = "installed" ] || [ "$COMMON_STATE" = "unpacked" ] ; then
+                        if [ -d /etc/apache2/conf.d/ ]; then
+                                if [ -L /etc/apache2/conf.d/$CONF.conf ]; then
+                                        # it's a symlink, all is well
+                                        true
+                                elif [ -e /etc/apache2/conf.d/$CONF.conf ]; then
+                                        # it's not a symlink, but exists, error
+                                        echo "ERROR: /etc/apache2/conf.d/$CONF.conf is not a symlink, please investigate" 1>&2
+                                else
+                                        # we need to create the symlink
+                                        ln -s ../conf-available/$CONF.conf /etc/apache2/conf.d/$CONF.conf
+                                fi
+                        fi
+                fi
+    ;;
+  abort-upgrade|abort-remove|abort-deconfigure)
+    ;;
+  *)
+    echo "postinst called with unknown argument \$1'" >&2
+    exit 1
+    ;;
+esac
+
+#DEBHELPER#
diff --git a/debian/check-mk-config-nagios3.postrm b/debian/check-mk-config-nagios3.postrm
new file mode 100644
index 0000000..1bfd02e
--- /dev/null
+++ b/debian/check-mk-config-nagios3.postrm
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+set -e
+
+dpkg-maintscript-helper mv_conffile \
+    /etc/nagios3/conf.d/check_mk_templates.cfg \
+    /etc/nagios3/conf.d/check_mk/check_mk_templates.cfg \
+    1.1.10-2 -- "$@"
+
+# older releases (1.1.12p7-1 at least) delivered the multisite conffile to
+# /etc/apache2/conf.d. If it exists we need to move it to conf-available
+# once it's moved then the code below will setup the conf.d symlink.
+# This code wasn't in place until 1.2.6p4-2, so we need to check everything
+# before that.
+dpkg-maintscript-helper mv_conffile \
+    /etc/apache2/conf.d/check_mk_multisite.cfg \
+    /etc/apache2/conf-available/check_mk_multisite.cfg \
+    1.2.6p4-2 -- "$@"
+
+if [ "$1" = "remove" ] || [ "$1" = "purge" ] ; then
+        CONF="check-mk-multisite"
+        COMMON_STATE=$(dpkg-query -f '${Status}' -W 'apache2.2-common' 2>/dev/null | awk '{print $3}' || true)
+
+        if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
+                . /usr/share/apache2/apache2-maintscript-helper
+                apache2_invoke disconf $CONF || exit $?
+        elif [ "$COMMON_STATE" = "installed" ] || [ "$COMMON_STATE" = "unpacked" ] ; then
+                [ -L /etc/apache2/conf.d/$CONF.conf ] && rm /etc/apache2/conf.d/$CONF.conf || true
+        fi
+fi
+
+#DEBHELPER#
diff --git a/debian/check-mk-config-nagios3.preinst b/debian/check-mk-config-nagios3.preinst
new file mode 100644
index 0000000..cdb5b1e
--- /dev/null
+++ b/debian/check-mk-config-nagios3.preinst
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+set -e
+
+dpkg-maintscript-helper mv_conffile \
+    /etc/nagios3/conf.d/check_mk_templates.cfg \
+    /etc/nagios3/conf.d/check_mk/check_mk_templates.cfg \
+    1.1.10-2 -- "$@"
+
+#DEBHELPER#
diff --git a/debian/check-mk-config-nagios3.prerm b/debian/check-mk-config-nagios3.prerm
new file mode 100644
index 0000000..e69de29
diff --git a/debian/control b/debian/control
index 349ac1f..df4e785 100644
--- a/debian/control
+++ b/debian/control
@@ -43,7 +43,7 @@ Description: general purpose nagios-plugin for retrieving data
 
 Package: check-mk-server
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, python, check-mk-config-icinga, debconf
+Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, python, check-mk-config-nagios3 | check-mk-config-icinga, debconf
 Recommends: check-mk-doc, snmp
 Description: general purpose nagios-plugin for retrieving data
  Check_mk adopts a new a approach for collecting data from operating systems
@@ -70,6 +70,21 @@ Description: general purpose nagios-plugin for retrieving data
  .
  This package contains the icinga specific part of check_mk
 
+Package: check-mk-config-nagios3
+Architecture: any
+Pre-Depends: dpkg (>= 1.15.7.2~)
+Depends: ${shlibs:Depends}, ${misc:Depends}, adduser
+Conflicts: check-mk-config-icinga
+Description: general purpose nagios-plugin for retrieving data
+ Check_mk adopts a new a approach for collecting data from operating systems
+ and network components. It obsoletes NRPE, check_by_ssh, NSClient and
+ check_snmp. It has many benefits, the most important of which are:
+ .
+  * Significant reduction of CPU usage on the Nagios host.
+  * Automatic inventory of items to be checked on hosts.
+ .
+ This package contains the nagios 3 specific part of check_mk
+
 Package: check-mk-livestatus
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -88,7 +103,7 @@ Description: general purpose nagios-plugin for retrieving data
 
 Package: check-mk-multisite
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, libapache2-mod-python, check-mk-config-icinga
+Depends: ${shlibs:Depends}, ${misc:Depends}, libapache2-mod-python, check-mk-config-nagios3 | check-mk-config-icinga
 Recommends: sudo, check-mk-doc
 Suggests: check-mk-livestatus
 Description: general purpose nagios-plugin for retrieving data
diff --git a/debian/defaults.nagios3 b/debian/defaults.nagios3
new file mode 100644
index 0000000..bdecf42
--- /dev/null
+++ b/debian/defaults.nagios3
@@ -0,0 +1,54 @@
+# This file has been created during setup of check_mk at Thu Sep 24 12:57:08 PDT 2015.
+# Do not edit this file. Also do not try to override these settings
+# in main.mk since some of them are hardcoded into several files
+# during setup.
+#
+# If you need to change these settings, you have to re-run setup.sh
+# and enter new values when asked, or edit ~/.check_mk_setup.conf and
+# run ./setup.sh --yes.
+
+check_mk_version            = '1.2.6p12'
+default_config_dir          = '/etc/check_mk'
+check_mk_configdir          = '/etc/check_mk/conf.d'
+share_dir                   = '/usr/share/check_mk'
+checks_dir                  = '/usr/share/check_mk/checks'
+notifications_dir           = '/usr/share/check_mk/notifications'
+inventory_dir               = '/usr/share/check_mk/inventory'
+check_manpages_dir          = '/usr/share/check_mk/checks-man'
+modules_dir                 = '/usr/share/check_mk/modules'
+locale_dir                  = '/usr/share/check_mk/locale'
+agents_dir                  = '/usr/share/check_mk/agents'
+lib_dir                     = '/usr/lib/check_mk'
+var_dir                     = '/var/lib/check_mk'
+log_dir                     = '/var/lib/check_mk/log'
+snmpwalks_dir               = '/var/lib/check_mk/snmpwalks'
+autochecksdir               = '/var/lib/check_mk/autochecks'
+precompiled_hostchecks_dir  = '/var/lib/check_mk/precompiled'
+counters_directory          = '/var/lib/check_mk/counters'
+tcp_cache_dir		    = '/var/lib/check_mk/cache'
+tmp_dir		            = '/var/lib/check_mk/tmp'
+logwatch_dir                = '/var/lib/check_mk/logwatch'
+nagios_objects_file         = '/etc/nagios3/conf.d/check_mk/check_mk_objects.cfg'
+rrd_path                    = '/var/lib/nagios/rrd'
+rrddcached_socket           = '/tmp/rrdcached.sock'
+nagios_command_pipe_path    = '/var/lib/nagios3/rw/nagios.cmd'
+check_result_path           = '/var/lib/nagios3/spool/checkresults'
+nagios_status_file          = '/var/cache/nagios3/status.dat'
+nagios_conf_dir             = '/etc/nagios3/conf.d'
+nagios_user                 = 'nagios'
+logwatch_notes_url          = '/check_mk/logwatch.py?host=%s&file=%s'
+www_group                   = 'nagios'
+nagios_config_file          = '/etc/nagios3/nagios.cfg'
+nagios_startscript          = '/etc/init.d/nagios3'
+nagios_binary               = '/usr/sbin/nagios3'
+apache_config_dir           = '/etc/apache2/conf.d'
+htpasswd_file               = '/etc/nagios3/htpasswd.users'
+nagios_auth_name            = 'Nagios Access'
+web_dir                     = '/usr/share/check_mk/web'
+livestatus_unix_socket      = '/var/lib/nagios3/rw/live'
+livebackendsdir             = '/usr/share/check_mk/livestatus'
+url_prefix                  = '/'
+pnp_url                     = '/pnp4nagios/'
+pnp_templates_dir           = '/usr/share/check_mk/pnp-templates'
+doc_dir                     = '/usr/share/doc/check-mk-doc'
+check_mk_automation         = 'sudo -u nagios /usr/bin/check_mk --automation'
diff --git a/debian/rules b/debian/rules
index 8392d07..4fe9ed3 100755
--- a/debian/rules
+++ b/debian/rules
@@ -85,11 +85,16 @@ install: build
 	rm debian/tmp/usr/share/check_mk/web/htdocs/defaults.py
 	mkdir -p debian/check-mk-config-icinga/usr/share/check_mk/modules/
 	cp debian/defaults.icinga debian/check-mk-config-icinga/usr/share/check_mk/modules/defaults
+	mkdir -p debian/check-mk-config-nagios3/usr/share/check_mk/modules/
+	cp debian/defaults.nagios3 debian/check-mk-config-nagios3/usr/share/check_mk/modules/defaults
 	# We need 2 different Apache configs
 	mkdir -p debian/check-mk-config-icinga/etc/apache2/conf-available/
 	cp debian/apache.icinga debian/check-mk-config-icinga/etc/apache2/conf-available/check-mk-multisite.conf
+	mkdir -p debian/check-mk-config-nagios3/etc/apache2/conf-available/
+	cp debian/apache.nagios3 debian/check-mk-config-nagios3/etc/apache2/conf-available/check-mk-multisite.conf
 	# Adjust path names
 	# sed -i 's#/nagios/cgi-bin/#/cgi-bin/icinga/#' debian/tmp/check-mk-config-icinga/etc/icinga/objects/check_mk_templates.cfg
+	# sed -i 's#/nagios/cgi-bin/#/cgi-bin/nagios3/#' debian/tmp/check-mk-config-nagios3/etc/nagios3/conf.d/check_mk_templates.cfg
 	# Prepare agent files
 	cp debian/tmp/usr/share/check_mk/agents/check_mk_agent.linux debian/check-mk-agent/usr/bin/check_mk_agent
 	chmod +x debian/check-mk-agent/usr/bin/check_mk_agent

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-nagios/pkg-check-mk.git



More information about the Pkg-nagios-changes mailing list