[check-mk] Many improvements and bug fixes. (#956492, #956496, #956489)

averi averi at fedoraproject.org
Sat Apr 27 14:09:59 UTC 2013


commit 1686d4f2dd449ec2da1e615b3e16c8fba4ba86c5
Author: Andrea Veri <av at gnome.org>
Date:   Sat Apr 27 16:08:59 2013 +0200

    Many improvements and bug fixes. (#956492, #956496, #956489)

 First-Installation.txt |   19 ++++-------------
 check-mk.spec          |   40 +++++++++++++++++++++++++++++++++----
 defaults               |   50 ++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 90 insertions(+), 19 deletions(-)
---
diff --git a/First-Installation.txt b/First-Installation.txt
index cbaa016..2dd20c2 100644
--- a/First-Installation.txt
+++ b/First-Installation.txt
@@ -1,19 +1,10 @@
 First steps for a brand new installation:
 
-1. Edit /usr/share/check_mk/modules/defaults and make sure all the relevant fields match your Nagios installation. Specifically:
+1. Add check-mk's template and objects files into /etc/nagios/nagios.cfg:
 
-nagios_objects_file         = '/etc/nagios/objects/check_mk_objects.cfg'
-nagios_command_pipe_path    = '/var/spool/nagios/cmd/nagios.cmd'
-check_result_path           = '/usr/local/nagios/var/spool/checkresults'
-nagios_status_file          = '/var/log/nagios/status.dat'
-nagios_conf_dir             = '/etc/nagios/objects'
-apache_config_dir           = '/etc/httpd/conf.d'
+cfg_file=/etc/nagios/conf.d/check_mk_templates.cfg
+cfg_file=/etc/nagios/conf.d/check_mk_objects.cfg
 
-2. Add check-mk's template and objects files into /etc/nagios/nagios.cfg:
+2. Edit /etc/check_mk/main.mk and add the hostnames / IPs of the machines you want to monitor.
 
-cfg_file=/etc/nagios/objects/check_mk_templates.cfg
-cfg_file=/etc/nagios/objects/check_mk_objects.cfg
-
-3. Edit /etc/check_mk/main.mk and add the hostnames / IPs of the machines you want to monitor.
-
-4. Run check_mk -I and check_mk -O, this will run an inventory check and rebuild your Nagios configuration files.
+3. Run check_mk -I and check_mk -O, this will run an inventory check and rebuild your Nagios configuration files.
diff --git a/check-mk.spec b/check-mk.spec
index 55f6281..5afc543 100644
--- a/check-mk.spec
+++ b/check-mk.spec
@@ -2,7 +2,7 @@
 
 Name:		check-mk
 Version:	1.2.2
-Release:	3%{?dist}
+Release:	4%{?dist}
 Summary:	A new general purpose Nagios-plugin for retrieving data
 Group:		Applications/Internet
 License:	GPLv2 and GPLv3
@@ -10,6 +10,7 @@ URL:		http://mathias-kettner.de/check_mk
 Source:		http://mathias-kettner.de/download/check_mk-%{version}.tar.gz
 Requires:	nagios
 Source1:	First-Installation.txt
+Source2:	defaults
 AutoReq:	0
 
 %description
@@ -69,7 +70,7 @@ install -d -m 755 %{buildroot}%{_sysconfdir}/xinetd.d
 install -m 644 xinetd.conf %{buildroot}%{_sysconfdir}/xinetd.d/check-mk-agent
 
 install -d -m 755 %{buildroot}%{_bindir}
-install -m 755 check_mk_agent.linux %{buildroot}%{_bindir}/check-mk-agent
+install -m 755 check_mk_agent.linux %{buildroot}%{_bindir}/check_mk_agent
 
 install -d -m 755 %{buildroot}%{_datadir}/check-mk-agent
 install -d -m 755 %{buildroot}%{_datadir}/check-mk-agent/plugins
@@ -85,7 +86,7 @@ install -m 644 logwatch.cfg %{buildroot}%{_sysconfdir}/check-mk-agent
 perl -pi \
     -e 's|LIBDIR="/to/be/changed"|LIBDIR="%{_datadir}/check-mk-agent"|;' \
     -e 's|CONFDIR="/to/be/changed"|CONFDIR="%{_sysconfdir}/check-mk-agent"|;' \
-    %{buildroot}%{_bindir}/check-mk-agent
+    %{buildroot}%{_bindir}/check_mk_agent
 
 # Server, livestatus and other modules installation
 
@@ -128,6 +129,26 @@ for file in `find %{buildroot}%{_datadir}/check_mk/web -name '*.py'`; do
  sed -i '1{\@^#!/usr/bin/python at d}' $file
 done
 
+# Copy the check_mk_templates.cfg from the example file and remove the file installed
+# on the /etc/nagios/objects directory.
+mkdir -p %{buildroot}%{_sysconfdir}/nagios/conf.d/
+cp -r %{buildroot}%{_datadir}/check_mk/check_mk_templates.cfg %{buildroot}%{_sysconfdir}/nagios/conf.d/check_mk_templates.cfg
+rm -rf %{buildroot}%{_sysconfdir}/nagios/objects/check_mk_templates.cfg
+
+# Remove the auto-generated defaults file and replace it with a customized version
+rm -rf %{buildroot}%{_datadir}/check_mk/modules/defaults
+install -m 644 %{SOURCE2} %{buildroot}%{_datadir}/check_mk/modules/
+
+# Remove other operating systems agents, we definitely don't need them on this package.
+rm -rf %{buildroot}%{_datadir}/check_mk/agents/check_mk_agent.aix
+rm -rf %{buildroot}%{_datadir}/check_mk/agents/check_mk_agent.freebsd
+rm -rf %{buildroot}%{_datadir}/check_mk/agents/check_mk_agent.hpux
+rm -rf %{buildroot}%{_datadir}/check_mk/agents/check_mk_agent.macosx
+rm -rf %{buildroot}%{_datadir}/check_mk/agents/check_mk_agent.netbsd
+rm -rf %{buildroot}%{_datadir}/check_mk/agents/check_mk_agent.openbsd
+rm -rf %{buildroot}%{_datadir}/check_mk/agents/check_mk_agent.openvms
+rm -rf %{buildroot}%{_datadir}/check_mk/agents/check_mk_agent.solaris
+
 # Remove Windows files.
 rm -rf %{buildroot}%{_docdir}/check_mk/windows/
 rm -rf %{buildroot}%{_datadir}/check_mk/agents/windows/
@@ -135,6 +156,7 @@ rm -rf %{buildroot}%{_datadir}/check_mk/agents/windows/
 # Remove waitmax and its leftarounds, looks like it's a statically linked binary.
 rm %{buildroot}%{_datadir}/check_mk/agents/waitmax
 rm %{buildroot}%{_datadir}/check_mk/agents/waitmax.c
+rm %{buildroot}%{_datadir}/check_mk/agents/Makefile
 
 # Remove the packages directory.
 rm -rf %{buildroot}%{_localstatedir}/lib/check_mk/packages/
@@ -164,12 +186,12 @@ rmdir %{buildroot}%{_prefix}/lib/check_mk
 %{_datadir}/check_mk/notifications
 %{_datadir}/check_mk/check_mk_templates.cfg
 %config(noreplace) %{_sysconfdir}/httpd/conf.d/zzz_check_mk.conf
-%config(noreplace) %{_sysconfdir}/nagios/objects/check_mk_templates.cfg
+%config(noreplace) %{_sysconfdir}/nagios/conf.d/check_mk_templates.cfg
 %attr(755, nagios, nagios) %{_localstatedir}/lib/check_mk/*
 %doc COPYING ChangeLog AUTHORS
 
 %files agent
-%{_bindir}/check-mk-agent
+%{_bindir}/check_mk_agent
 %{_datadir}/check-mk-agent
 %config(noreplace) %{_sysconfdir}/xinetd.d/check-mk-agent
 %config(noreplace) %{_sysconfdir}/check-mk-agent
@@ -190,6 +212,14 @@ rmdir %{buildroot}%{_prefix}/lib/check_mk
 
 
 %changelog
+* Sat Apr 27 2013 Andrea Veri <averi at fedoraproject.org> 1.2.2-4%{?dist}
+- Change check-mk-agent's binary name to check_mk_agent to match xinetd's file. (BZ: #956489)
+- Remove other operating systems agents, we definitely don't need them on this package.
+- Make sure that check_mk_templates gets shipped into /etc/nagios/conf.d. (BZ: #956492)
+- Don't ship the auto-generated defaults file, but provide it with our customizations. This actually
+  fixes BZ: #956496 since we modify the checkresults path to be the same as the one provided
+  by Nagios itself, thus no need to create an additional directory.
+
 * Fri Apr 12 2013 Dan HorĂ¡k <dan[at]danny.cz> - 1.2.2-3
 - fix for 64-bit arches
 
diff --git a/defaults b/defaults
new file mode 100644
index 0000000..796fb72
--- /dev/null
+++ b/defaults
@@ -0,0 +1,50 @@
+# This file has been created during setup of check_mk at Tue Apr  9 17:15:45 CEST 2013.
+# 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.2'
+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'
+check_manpages_dir          = '/usr/share/doc/check_mk/checks'
+modules_dir                 = '/usr/share/check_mk/modules'
+locale_dir                  = '/usr/share/check_mk/locale'
+agents_dir                  = '/usr/share/check_mk/agents'
+var_dir                     = '/var/lib/check_mk'
+lib_dir                     = '/usr/lib/check_mk'
+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/nagios/conf.d/check_mk_objects.cfg'
+nagios_command_pipe_path    = '/var/log/nagios/rw/nagios.cmd'
+check_result_path           = '/var/log/nagios/spool/checkresults'
+nagios_status_file          = '/var/log/nagios/status.dat'
+nagios_conf_dir             = '/etc/nagios/objects'
+nagios_user                 = 'nagios'
+logwatch_notes_url          = '/check_mk/logwatch.py?host=%s&file=%s'
+www_group                   = 'nagios'
+nagios_config_file          = '/etc/nagios/nagios.cfg'
+nagios_startscript          = '/etc/init.d/nagios'
+nagios_binary               = '/usr/sbin/nagios'
+apache_config_dir           = '/etc/httpd/conf.d'
+htpasswd_file               = '/etc/nagios/htpasswd.users'
+nagios_auth_name            = 'Nagios Access'
+web_dir                     = '/usr/share/check_mk/web'
+livestatus_unix_socket      = '/var/log/nagios/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'
+check_mk_automation         = 'sudo -u mockbuild /usr/bin/check_mk --automation'


More information about the scm-commits mailing list