[debian-edu-commits] debian-edu/upstream/ 01/01: Apply patch by Bas Couwenberg to use Icinga instead of Nagios, as nagios3 has been removed from Debian. (Closes: #846865)
Holger Levsen
holger at layer-acht.org
Tue Jan 17 17:48:14 UTC 2017
This is an automated email from the git hooks/post-receive script.
holger pushed a commit to branch master
in repository sitesummary.
commit 9f94a55736dd50ea0e8b895766afc307595db428
Author: Holger Levsen <holger at layer-acht.org>
Date: Tue Jan 17 18:47:59 2017 +0100
Apply patch by Bas Couwenberg to use Icinga instead of Nagios, as nagios3 has been removed from Debian. (Closes: #846865)
Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
Makefile | 8 +++---
README | 36 ++++++++++++-------------
debian/changelog | 7 +++++
debian/control | 4 +--
debian/sitesummary.install | 2 +-
debian/sitesummary.postinst | 8 +++---
nagios-template-contacts.cfg | 2 +-
nagios-templates.cfg | 4 +--
nagios.cfg | 62 ++++++++++++++++++++++----------------------
sitesummary-nodes | 3 ++-
sitesummary-update-nagios | 26 +++++++++----------
11 files changed, 85 insertions(+), 77 deletions(-)
diff --git a/Makefile b/Makefile
index 6d8d789..ecb83e2 100644
--- a/Makefile
+++ b/Makefile
@@ -62,13 +62,13 @@ install-server:
$(INSTALL) munin-plugin-agesinceseen \
$(DESTDIR)/usr/share/munin/plugins/sitesummary_agesinceseen
- $(INSTALL) -d $(DESTDIR)/etc/nagios3
+ $(INSTALL) -d $(DESTDIR)/etc/icinga
$(INSTALL_DATA) nagios.cfg \
- $(DESTDIR)/etc/nagios3/sitesummary.cfg
+ $(DESTDIR)/etc/icinga/sitesummary.cfg
$(INSTALL_DATA) nagios-templates.cfg \
- $(DESTDIR)/etc/nagios3/sitesummary-templates.cfg
+ $(DESTDIR)/etc/icinga/sitesummary-templates.cfg
$(INSTALL_DATA) nagios-template-contacts.cfg \
- $(DESTDIR)/etc/nagios3/sitesummary-template-contacts.cfg
+ $(DESTDIR)/etc/icinga/sitesummary-template-contacts.cfg
$(INSTALL) -d $(DESTDIR)/etc/nagios
$(INSTALL_DATA) nagios-nrpe-commands.cfg \
$(DESTDIR)/etc/nagios/sitesummary-nrpe-commands.cfg
diff --git a/README b/README
index 63c5e08..af5951a 100644
--- a/README
+++ b/README
@@ -25,35 +25,35 @@ to enable Munin autoconfig on the sitesummary collector
sitesummary sitesummary/replace-munin-config boolean true
-Sitesummary generated Nagios configuration
+Sitesummary generated Icinga configuration
------------------------------------------
-Since version 0.0.51, there is code in sitesummary to generate Nagios
+Since version 0.0.51, there is code in sitesummary to generate Icinga
configuration based on the collected information. To enable this,
-install nagios3 and nagios-plugins-standard, edit /etc/default/nagios3
-to include 'NAGIOSCFG=/etc/nagios3/sitesummary.cfg' and run the
+install icinga and monitoring-plugins-standard, edit /etc/default/icinga
+to include 'NAGIOSCFG=/etc/icinga/sitesummary.cfg' and run the
sitesummary cron job. Running these commands as root normally does
the trick.
- aptitude install nagios3 nagios-plugins-standard
- echo 'NAGIOSCFG="/etc/nagios3/sitesummary.cfg"' >> /etc/default/nagios3
+ aptitude install icinga monitoring-plugins-standard
+ echo 'NAGIOSCFG="/etc/icinga/sitesummary.cfg"' >> /etc/default/icinga
sitesummary-client
/etc/cron.daily/sitesummary
- /etc/init.d/nagios3 restart
+ service icinga restart
-The current version of the code run all Nagios checks locally, so it
+The current version of the code run all Icinga checks locally, so it
only work on a single machine. The plan is to change this to use NRPE
to work with a network of machines.
On the client side, add
'include=/etc/nagios/sitesummary-nrpe-commands.cfg' and
'dont_blame_nrpe=1' in /etc/nagios/nrpe_local.cfg to enable the
-sitesummary checks. To make sure the nagios server can contact nrpe,
+sitesummary checks. To make sure the Icinga server can contact nrpe,
it might be required to list the server address using the
allowed_hosts option. Running these commands as root normally does
the trick.
- aptitude install nagios-nrpe-server nagios-plugins-standard
+ aptitude install nagios-nrpe-server monitoring-plugins-standard
cat > /etc/nagios/nrpe.d/sitesummary-nrpe.cfg <<EOF
allowed_hosts=myserver
dont_blame_nrpe=1
@@ -62,7 +62,7 @@ EOF
sitesummary-client
These steps can be preseeded during installation, here is an example
-to enable Nagios autoconfig on the sitesummary collector and allow it
+to enable Icinga autoconfig on the sitesummary collector and allow it
to query Nagios NRPE on the clients.
sitesummary sitesummary/enable-nagios-config boolean true
@@ -74,7 +74,7 @@ Handling hosts behind VPN connections
-------------------------------------
To handle hosts with hostnames missing in DNS or IP adresses not
-available directly from the Nagios and Munin server, a mechanism to
+available directly from the Icinga and Munin server, a mechanism to
map entries to new hostnames is provided.
To enable it, create a file /etc/sitesummary/hostmap or a file in
@@ -94,21 +94,21 @@ to use instead of the value in system/hostname.
For this to work, the new-name entry must map to a IP address, either
in DNS via an entry in /etc/hosts.
-Ignoring specific Nagios checks for some hosts
+Ignoring specific Icinga checks for some hosts
----------------------------------------------
-Some times a machine have a package installed that cause some Nagios
+Some times a machine have a package installed that cause some Icinga
test to be enabled, but the service provided by the package is
-disabled and the check always fail. In this case, the Nagios test can
+disabled and the check always fail. In this case, the Icinga test can
be disabled using the /etc/sitesummary/nagiosignore file.
For example, to disable the DHCP check for a given host, add the
-hostname and the Nagios check description to
+hostname and the Icinga check description to
/etc/sitesummary/nagiosignore like this:
some.nagios.host.com process - dhcpd3
-The nagios description can be found in
+The Icinga description can be found in
/var/lib/sitesummary/nagios-generated.cfg.
Design draft
@@ -175,5 +175,5 @@ dependencies as possible, to make it lightweight and easy to install
on all machines. (perl, python, /bin/sh?)
Should the client know which files to report, or should the server be
-able to affect it? Can cfengine, nagios or munin be used for this
+able to affect it? Can cfengine, icinga or munin be used for this
instead?
diff --git a/debian/changelog b/debian/changelog
index 6eb6822..b47057c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+sitesummary (0.1.27) UNRELEASED; urgency=medium
+
+ * Apply patch by Bas Couwenberg to use Icinga instead of Nagios, as nagios3
+ has been removed from Debian. (Closes: #846865)
+
+ -- Bas Couwenberg <sebastic at debian.org> Sat, 03 Dec 2016 20:43:49 +0100
+
sitesummary (0.1.26) unstable; urgency=medium
[ Petter Reinholdtsen ]
diff --git a/debian/control b/debian/control
index a116739..db28c20 100644
--- a/debian/control
+++ b/debian/control
@@ -19,7 +19,7 @@ Architecture: all
Pre-Depends: ${misc:Pre-Depends}
Depends: ${misc:Depends}, ${perl:Depends}, gnupg, net-tools, libcgi-pm-perl
Recommends: apache2 | httpd, sitesummary-client
-Suggests: munin, munin-node, nagios3, nagios-plugins-standard, ldap-utils, cups-client
+Suggests: munin, munin-node, icinga, monitoring-plugins-standard, ldap-utils, cups-client
Description: Generate site summary of submitting hosts (server part)
The sitesummary system makes it easier to keep track of a lot of
machines, by allowing each machine to report their existence once a
@@ -33,7 +33,7 @@ Package: sitesummary-client
Architecture: all
Depends: ${misc:Depends}, ${perl:Depends}, lsb-base (>= 3.0-6), gnupg
Recommends: cron, dmidecode, pciutils, usbutils, lsscsi, iproute2, hdparm
-Suggests: sitesummary, munin-node, nagios-nrpe-server, nagios-plugins-standard, cdpr
+Suggests: sitesummary, munin-node, nagios-nrpe-server, monitoring-plugins-standard, cdpr
Description: Generate site summary of submitting hosts (client part)
The sitesummary system makes it easier to keep track of a lot of
machines, by allowing each machine to report their existence once a
diff --git a/debian/sitesummary.install b/debian/sitesummary.install
index 71c26e3..ae95c6b 100644
--- a/debian/sitesummary.install
+++ b/debian/sitesummary.install
@@ -1,5 +1,5 @@
debian/tmp/etc/apache2
-debian/tmp/etc/nagios3
+debian/tmp/etc/icinga
debian/tmp/usr/lib/cgi-bin
debian/tmp/usr/lib/sitesummary/*-summary
debian/tmp/usr/lib/sitesummary/expire-entry
diff --git a/debian/sitesummary.postinst b/debian/sitesummary.postinst
index 83eff31..bf58eb3 100644
--- a/debian/sitesummary.postinst
+++ b/debian/sitesummary.postinst
@@ -6,14 +6,14 @@ set -e
. /usr/share/debconf/confmodule
test_nagios() {
- if grep -q '^NAGIOSCFG="/etc/nagios3/sitesummary.cfg"$' "$config"; then
+ if grep -q '^NAGIOSCFG="/etc/icinga/sitesummary.cfg"$' "$config"; then
:
else
db_get sitesummary/enable-nagios-config
if [ true = "$RET" ] ; then
mkdir -p $(dirname $config)
- echo 'NAGIOSCFG="/etc/nagios3/sitesummary.cfg"' \
- >> /etc/default/nagios3
+ echo 'NAGIOSCFG="/etc/icinga/sitesummary.cfg"' \
+ >> /etc/default/icinga
if [ ! -f /var/lib/sitesummary/nagios-generated.cfg ] ; then
# Create dummy file to make sure nagios will start
# on first boot if sitesummary is installed using
@@ -53,7 +53,7 @@ case "$1" in
fi
fi
- config=/etc/default/nagios3
+ config=/etc/default/icinga
if [ -f "$config" ] ; then
test_nagios
fi
diff --git a/nagios-template-contacts.cfg b/nagios-template-contacts.cfg
index e4924c9..e82413a 100644
--- a/nagios-template-contacts.cfg
+++ b/nagios-template-contacts.cfg
@@ -12,6 +12,6 @@ define contact {
define contactgroup{
contactgroup_name admins
- alias Nagios Administrators
+ alias Icinga Administrators
members root
}
diff --git a/nagios-templates.cfg b/nagios-templates.cfg
index 749f62b..a3a607f 100644
--- a/nagios-templates.cfg
+++ b/nagios-templates.cfg
@@ -45,12 +45,12 @@ define command {
define command {
command_name host-notify-by-email
- command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTALIAS$\nState: $HOSTSTATE$ for $HOSTDURATION$\nAddress: $HOSTADDRESS$\nInfo:\n\n$HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n\nACK by: $HOSTACKAUTHOR$\nComment: $HOSTACKCOMMENT$\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ alert $NOTIFICATIONNUMBER$ - $HOSTALIAS$ host is $HOSTSTATE$ **" $CONTACTEMAIL$
+ command_line /usr/bin/printf "%b" "***** Icinga *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTALIAS$\nState: $HOSTSTATE$ for $HOSTDURATION$\nAddress: $HOSTADDRESS$\nInfo:\n\n$HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n\nACK by: $HOSTACKAUTHOR$\nComment: $HOSTACKCOMMENT$\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ alert $NOTIFICATIONNUMBER$ - $HOSTALIAS$ host is $HOSTSTATE$ **" $CONTACTEMAIL$
}
define command{
command_name notify-by-email
- command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nState: $SERVICESTATE$ for $SERVICEDURATION$\nAddress: $HOSTADDRESS$\n\nInfo:\n\n$SERVICEOUTPUT$\n\nDate/Time: $LONGDATETIME$\n\nACK by: $SERVICEACKAUTHOR$\nComment: $SERVICEACKCOMMENT$\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ alert $NOTIFICATIONNUMBER$ - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
+ command_line /usr/bin/printf "%b" "***** Icinga *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nState: $SERVICESTATE$ for $SERVICEDURATION$\nAddress: $HOSTADDRESS$\n\nInfo:\n\n$SERVICEOUTPUT$\n\nDate/Time: $LONGDATETIME$\n\nACK by: $SERVICEACKAUTHOR$\nComment: $SERVICEACKCOMMENT$\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ alert $NOTIFICATIONNUMBER$ - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
define host {
diff --git a/nagios.cfg b/nagios.cfg
index 4ade448..e4f2e09 100644
--- a/nagios.cfg
+++ b/nagios.cfg
@@ -6,24 +6,24 @@
# for historical purposes. This should be the first option specified
# in the config file!!!
-log_file=/var/log/nagios3/nagios.log
+log_file=/var/log/icinga/icinga.log
-cfg_file=/etc/nagios3/sitesummary-templates.cfg
-cfg_file=/etc/nagios3/sitesummary-template-contacts.cfg
+cfg_file=/etc/icinga/sitesummary-templates.cfg
+cfg_file=/etc/icinga/sitesummary-template-contacts.cfg
cfg_file=/var/lib/sitesummary/nagios-generated.cfg
# Commands definitions
-#cfg_file=/etc/nagios3/commands.cfg
+#cfg_file=/etc/icinga/commands.cfg
# Debian also defaults to using the check commands defined by the debian
-# nagios-plugins package
-#cfg_dir=/etc/nagios-plugins/config
+# monitoring-plugins package
+#cfg_dir=/etc/monitoring-plugins/config
-# Debian uses by default a configuration directory where nagios3-common,
+# Debian uses by default a configuration directory where icinga-common,
# other packages and the local admin can dump or link configuration
# files into.
-#cfg_dir=/etc/nagios3/conf.d
+#cfg_dir=/etc/icinga/objects
# OBJECT CONFIGURATION FILE(S)
# These are the object configuration files in which you define hosts,
@@ -32,29 +32,29 @@ cfg_file=/var/lib/sitesummary/nagios-generated.cfg
# if you wish (as shown below), or keep them all in a single config file.
# You can specify individual object config files as shown below:
-#cfg_file=/etc/nagios3/objects/commands.cfg
-#cfg_file=/etc/nagios3/objects/contacts.cfg
-#cfg_file=/etc/nagios3/objects/timeperiods.cfg
-#cfg_file=/etc/nagios3/objects/templates.cfg
+#cfg_file=/etc/icinga/objects/commands.cfg
+#cfg_file=/etc/icinga/objects/contacts.cfg
+#cfg_file=/etc/icinga/objects/timeperiods.cfg
+#cfg_file=/etc/icinga/objects/templates.cfg
# Definitions for monitoring a Windows machine
-#cfg_file=/etc/nagios3/objects/windows.cfg
+#cfg_file=/etc/icinga/objects/windows.cfg
# Definitions for monitoring a router/switch
-#cfg_file=/etc/nagios3/objects/switch.cfg
+#cfg_file=/etc/icinga/objects/switch.cfg
# Definitions for monitoring a network printer
-#cfg_file=/etc/nagios3/objects/printer.cfg
+#cfg_file=/etc/icinga/objects/printer.cfg
# You can also tell Nagios to process all config files (with a .cfg
# extension) in a particular directory by using the cfg_dir
# directive as shown below:
-#cfg_dir=/etc/nagios3/servers
-#cfg_dir=/etc/nagios3/printers
-#cfg_dir=/etc/nagios3/switches
-#cfg_dir=/etc/nagios3/routers
+#cfg_dir=/etc/icinga/servers
+#cfg_dir=/etc/icinga/printers
+#cfg_dir=/etc/icinga/switches
+#cfg_dir=/etc/icinga/routers
@@ -66,7 +66,7 @@ cfg_file=/var/lib/sitesummary/nagios-generated.cfg
# directly) in order to prevent inconsistencies that can occur
# when the config files are modified after Nagios starts.
-object_cache_file=/var/cache/nagios3/objects.cache
+object_cache_file=/var/cache/icinga/objects.cache
@@ -82,7 +82,7 @@ object_cache_file=/var/cache/nagios3/objects.cache
# Read the documentation section on optimizing Nagios to find our more
# about how this feature works.
-precached_object_file=/var/lib/nagios3/objects.precache
+precached_object_file=/var/lib/icinga/objects.precache
@@ -95,7 +95,7 @@ precached_object_file=/var/lib/nagios3/objects.precache
# defined as macros in this file and restrictive permissions (600)
# can be placed on this file.
-resource_file=/etc/nagios3/resource.cfg
+resource_file=/etc/icinga/resource.cfg
@@ -105,7 +105,7 @@ resource_file=/etc/nagios3/resource.cfg
# The contents of the status file are deleted every time Nagios
# restarts.
-status_file=/var/cache/nagios3/status.dat
+status_file=/var/lib/icinga/status.dat
@@ -174,7 +174,7 @@ command_check_interval=-1
# Debian Users: In case you didn't read README.Debian yet, _NOW_ is the
# time to do it.
-command_file=/var/lib/nagios3/rw/nagios.cmd
+command_file=/var/lib/icinga/rw/icinga.cmd
@@ -192,7 +192,7 @@ external_command_buffer_slots=4096
# This is the lockfile that Nagios will use to store its PID number
# in when it is running in daemon mode.
-lock_file=/var/run/nagios3/nagios3.pid
+lock_file=/var/run/icinga/icinga.pid
@@ -202,7 +202,7 @@ lock_file=/var/run/nagios3/nagios3.pid
# is created, used, and deleted throughout the time that Nagios is
# running.
-temp_file=/var/cache/nagios3/nagios.tmp
+temp_file=/var/cache/icinga/icinga.tmp
@@ -268,7 +268,7 @@ log_rotation_method=d
# This is the directory where archived (rotated) log files should be
# placed (assuming you've chosen to do log rotation).
-log_archive_path=/var/log/nagios3/archives
+log_archive_path=/var/log/icinga/archives
@@ -466,7 +466,7 @@ max_check_result_reaper_time=30
# Note: Make sure that only one instance of Nagios has access
# to this directory!
-check_result_path=/var/lib/nagios3/spool/checkresults
+check_result_path=/var/lib/icinga/spool/checkresults
@@ -641,7 +641,7 @@ retain_state_information=1
# This file is used only if the preserve_state_information
# variable is set to 1.
-state_retention_file=/var/lib/nagios3/retention.dat
+state_retention_file=/var/cache/icinga/retention.dat
@@ -1093,7 +1093,7 @@ date_format=iso8601
# embedded Perl interpreter) is located. If you didn't compile
# Nagios with embedded Perl support, this option has no effect.
-p1_file=/usr/lib/nagios3/p1.pl
+p1_file=/usr/lib/icinga/p1.pl
@@ -1285,7 +1285,7 @@ debug_verbosity=1
# DEBUG FILE
# This option determines where Nagios should write debugging information.
-debug_file=/var/lib/nagios3/nagios.debug
+debug_file=/var/log/icinga/icinga.debug
diff --git a/sitesummary-nodes b/sitesummary-nodes
index a554fa9..1d517bb 100755
--- a/sitesummary-nodes
+++ b/sitesummary-nodes
@@ -108,7 +108,8 @@ sub is_nagios_client {
return is_pkg_installed($hostid, "nagios-nrpe-server") ||
is_pkg_installed($hostid, "nagios-text") ||
is_pkg_installed($hostid, "nagios2") ||
- is_pkg_installed($hostid, "nagios3");
+ is_pkg_installed($hostid, "nagios3") ||
+ is_pkg_installed($hostid, "icinga");
}
sub print_munin_list {
diff --git a/sitesummary-update-nagios b/sitesummary-update-nagios
index 96db4ee..2bcc0d0 100755
--- a/sitesummary-update-nagios
+++ b/sitesummary-update-nagios
@@ -8,8 +8,8 @@ nodes=/usr/sbin/sitesummary-nodes
nagiosopts=""
# Specifies where to save the automatically generated nagios
-# configuration. Add NAGIOSCFG="/etc/nagios3/sitesummary.cfg" to
-# /etc/default/nagios3 to get Nagios to use this automatically
+# configuration. Add NAGIOSCFG="/etc/icinga/sitesummary.cfg" to
+# /etc/default/icinga to get Icinga to use this automatically
# generated configuration
NAGIOSDIR=/var/lib/sitesummary
@@ -44,21 +44,21 @@ generate_nagios_config() {
fi
}
-# Only enable if nagios v3 and sitesummary is installed.
-if [ -f /etc/init.d/nagios3 ] && [ -x $nodes ]; then
- # Only reload nagios if the configuration changed
+# Only enable if icinga and sitesummary is installed.
+if [ -f /etc/init.d/icinga ] && [ -x $nodes ]; then
+ # Only reload icinga if the configuration changed
if generate_nagios_config ; then
# subshell to avoid passing all variables from
- # /etc/default/nagios3 to other parts of this script
+ # /etc/default/icinga to other parts of this script
(
- if [ -r /etc/default/nagios3 ] ; then
- . /etc/default/nagios3
+ if [ -r /etc/default/icinga ] ; then
+ . /etc/default/icinga
fi
- # Only reload nagios if the sitesummary config is the active
- # one and nagios3 is currently running.
- if [ /etc/nagios3/sitesummary.cfg = "$NAGIOSCFG" ] && \
- invoke-rc.d nagios3 status >/dev/null ; then
- invoke-rc.d nagios3 reload >/dev/null
+ # Only reload icinga if the sitesummary config is the active
+ # one and icinga is currently running.
+ if [ /etc/icinga/objects/sitesummary.cfg = "$NAGIOSCFG" ] && \
+ invoke-rc.d icinga status >/dev/null ; then
+ invoke-rc.d icinga reload >/dev/null
fi
)
fi
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/upstream/sitesummary.git
More information about the debian-edu-commits
mailing list