Imported Debian patch 1.4.0p9-1

This commit is contained in:
Matt Taggart 2017-06-22 15:44:37 -07:00 committed by Mario Fetka
commit f886d3d451
44 changed files with 5547 additions and 4507 deletions

8698
ChangeLog

File diff suppressed because it is too large Load Diff

View File

@ -1 +1 @@
1.2.8p26
1.4.0p9

BIN
active_checks.tar.gz Normal file

Binary file not shown.

Binary file not shown.

View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
@ -65,8 +65,9 @@ target_values = {
# /usr/sbin/nagios3 -d /etc/nagios3/nagios.cfg
class Sorry(Exception):
def __init__(self, text):
self.reason = text
def __init__(self, reason):
self.reason = reason
super(Sorry, self).__init__(reason)
def find_pid_and_configfile():
procs = os.popen("ps ax -o pid,ppid,user,command").readlines()

BIN
base.tar.gz Normal file

Binary file not shown.

BIN
bin.tar.gz Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

36
create-changelog.py Executable file
View File

@ -0,0 +1,36 @@
#!/usr/bin/env python
import sys
import os
import cmk.werks
def create_changelog(dest_file, precompiled_werk_files):
werks = load_werks(precompiled_werk_files)
with open(dest_file, "w") as f:
cmk.werks.write_as_text(werks, f)
# Append previous werk changes
if os.path.exists(dest_file + ".in"):
f.write("\n\n")
f.write(file(dest_file + ".in").read())
def load_werks(precompiled_werk_files):
werks = {}
for path in precompiled_werk_files:
werks.update(cmk.werks.load_precompiled_werks_file(path))
return werks
#
# MAIN
#
if len(sys.argv) < 3:
sys.stderr.write("ERROR: Call like this: create-changelog CHANGELOG WERK_DIR...\n")
sys.exit(1)
dest_file, precompiled_werk_files = sys.argv[1], sys.argv[2:]
create_changelog(dest_file, precompiled_werk_files)

11
debian/apache.icinga vendored
View File

@ -1,4 +1,4 @@
# Created by setup of check_mk version 1.2.6p12
# Created by setup of check_mk version 1.4.0p9
# 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.
@ -63,6 +63,15 @@
# Satisfy any
#</Location>
## WARNING: disabled like the others above
## Webservice for dynamic creation of PNP templates
#<Location "/check_mk/pnp_template.py">
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
# Satisfy any
#</Location>
</IfModule>

11
debian/changelog vendored
View File

@ -1,9 +1,12 @@
check-mk (1.2.8p22-1) UNRELEASED; urgency=medium
check-mk (1.4.0p9-1) experimental; urgency=high
* New upstream release
* change to quilt patches
* new upstream release
* fixes CVE-2017-9781 (Closes: #865497)
* move to the way upstream now does defaults
* add new librrd-dev, libboost-dev, libboost-system-dev, g++-6 build-deps
* new -common package for private python libs
-- Mario Fetka <mario.fetka@gmail.com> Wed, 24 May 2017 11:04:22 +0200
-- Matt Taggart <taggart@debian.org> Thu, 22 Jun 2017 15:44:37 -0700
check-mk (1.2.8p16-1) unstable; urgency=medium

2
debian/check-mk-common.install vendored Normal file
View File

@ -0,0 +1,2 @@
usr/share/check_mk/cmk
usr/share/check_mk/cmk_base

View File

@ -1,2 +1,3 @@
usr/share/check_mk/check_mk_templates.cfg etc/icinga/objects/check_mk
usr/share/check_mk/cmk/paths.py
etc/check_mk/multisite.mk

View File

@ -1,2 +0,0 @@
usr/share/check_mk/modules/defaults usr/share/check_mk/web/htdocs/defaults.py

View File

@ -0,0 +1 @@
usr/lib/nagios/plugins/*

View File

@ -1,4 +1,3 @@
etc/sudoers.d
etc/check_mk
var/lib/check_mk
etc/check_mk/multisite.d

34
debian/control vendored
View File

@ -7,7 +7,7 @@ Uploaders: Alexander Wirt <formorer@debian.org>,
Thomas Bechtold <toabctl@debian.org>,
Ilya Rassadin <elcamlost@gmail.com>,
Matt Taggart <taggart@debian.org>
Build-Depends: debhelper (>= 9), quilt
Build-Depends: debhelper (>= 9), dh-python, python, dpatch, librrd-dev, libboost-dev, libboost-system-dev, g++-6
Standards-Version: 3.9.8
Vcs-Git: https://anonscm.debian.org/git/pkg-nagios/pkg-check-mk.git
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-nagios/pkg-check-mk.git
@ -29,7 +29,7 @@ Description: general purpose monitoring plugin for retrieving data
Package: check-mk-agent-logwatch
Architecture: all
Depends: ${shlibs:Depends}, ${misc:Depends}, check-mk-agent, python
Depends: ${shlibs:Depends}, ${misc:Depends}, check-mk-agent, python, check-mk-common
Description: general purpose monitoring 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
@ -58,7 +58,7 @@ Description: general purpose monitoring plugin for retrieving data
Package: check-mk-config-icinga
Conflicts: check-mk-config-nagios3
Architecture: any
Pre-Depends: dpkg (>= 1.15.7.2~)
Pre-Depends: dpkg (>= 1.15.7.2~), check-mk-common
Depends: ${shlibs:Depends}, ${misc:Depends}, adduser
Description: general purpose monitoring plugin for retrieving data
Check_mk adopts a new a approach for collecting data from operating systems
@ -116,3 +116,31 @@ Description: general purpose monitoring plugin for retrieving data (documentatio
* Automatic inventory of items to be checked on hosts.
.
This package contains the check_mk documentation.
Package: check-mk-common
Architecture: all
Section: python
Depends: ${misc:Depends}, ${python:Depends}
Description: general purpose monitoring plugin for retrieving data (common libraries)
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 check_mk python libraries.
Package: check-mk-monitoring-plugins
Architecture: all
Section: net
Depends: ${misc:Depends}, check-mk-common
Description: general purpose monitoring plugin for retrieving data (monitoring plugins)
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 check_mk provided monitoring plugins.

View File

@ -1,54 +0,0 @@
# 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.8p22'
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/icinga/objects/check_mk/check_mk_objects.cfg'
rrd_path = '/var/lib/nagios/rrd'
rrddcached_socket = '/tmp/rrdcached.sock'
nagios_command_pipe_path = '/var/lib/icinga/rw/icinga.cmd'
check_result_path = '/var/lib/icinga/spool/checkresults'
nagios_status_file = '/var/lib/icinga/status.dat'
nagios_conf_dir = '/etc/icinga/objects/check_mk'
nagios_user = 'nagios'
logwatch_notes_url = '/check_mk/logwatch.py?host=%s&file=%s'
www_group = 'nagios'
nagios_config_file = '/etc/icinga/icinga.cfg'
nagios_startscript = '/etc/init.d/icinga'
nagios_binary = '/usr/sbin/icinga'
apache_config_dir = '/etc/apache2/conf.d'
htpasswd_file = '/etc/icinga/htpasswd.users'
nagios_auth_name = 'Nagios Access'
web_dir = '/usr/share/check_mk/web'
livestatus_unix_socket = '/var/lib/icinga/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'

2
debian/patches/00list vendored Normal file
View File

@ -0,0 +1,2 @@
01_fix_livestatus
02_wato-sudoers

19
debian/patches/01_fix_livestatus.dpatch vendored Normal file
View File

@ -0,0 +1,19 @@
#! /bin/sh /usr/share/dpatch/dpatch-run
## 01_fix_livestatus.dpatch by Alexander Wirt <formorer@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.
@DPATCH@
diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' pkg-check_mk~/setup.sh pkg-check_mk/setup.sh
--- pkg-check_mk~/setup.sh 2011-05-28 13:21:38.000000000 +0200
+++ pkg-check_mk/setup.sh 2011-05-28 13:22:09.662237441 +0200
@@ -535,6 +535,8 @@
rm -rf $D
mkdir -p $D
tar xvzf $SRCDIR/livestatus.tar.gz -C $D
+ sed -i '/Boston/ a\
+#include <cstddef>' livestatus.src/src/TableStatus.cc livestatus.src/src/TableLog.cc
pushd $D
./configure --libdir=$libdir --bindir=$bindir &&
make clean &&

View File

@ -1,12 +0,0 @@
diff -uNr check-mk.orig/setup.sh check-mk/setup.sh
--- check-mk.orig/setup.sh 2017-05-24 11:36:07.620000000 +0200
+++ check-mk/setup.sh 2017-05-24 11:37:27.928000000 +0200
@@ -568,6 +568,8 @@
rm -rf $D
mkdir -p $D
tar xvzf $SRCDIR/livestatus.tar.gz -C $D
+ sed -i '/Boston/ a\
+#include <cstddef>' livestatus.src/src/TableStatus.cc livestatus.src/src/TableLog.cc
pushd $D
local CONFIGURE_OPTS=""

View File

@ -1,7 +1,14 @@
diff -uNr check-mk.orig/setup.sh check-mk/setup.sh
--- check-mk.orig/setup.sh 2017-05-24 11:38:06.852000000 +0200
+++ check-mk/setup.sh 2017-05-24 11:38:31.000000000 +0200
@@ -745,28 +745,11 @@
#! /bin/sh /usr/share/dpatch/dpatch-run
## wato-sudoers-location.dpatch by Bernd Zeimetz <bzed@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Install WATO sudoers line into /etc/sudoers.d/check_mk_WATO
@DPATCH@
diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' pkg-check-mk~/setup.sh pkg-check-mk/setup.sh
--- pkg-check-mk~/setup.sh 2013-08-07 11:44:12.000000000 +0200
+++ pkg-check-mk/setup.sh 2013-08-07 11:47:40.344748346 +0200
@@ -718,28 +718,11 @@
return
fi

View File

@ -1,22 +0,0 @@
--- a/modules/check_mk.py 2014-07-04 09:24:22.000000000 +0200
+++ b/modules/check_mk.py 2014-07-09 23:07:27.077488020 +0200
@@ -110,6 +110,7 @@
check_result_path = '/usr/local/nagios/var/spool/checkresults'
www_group = None # unset
nagios_startscript = '/etc/init.d/nagios'
+nagios_startuptype = 'script'
nagios_binary = '/usr/sbin/nagios'
nagios_config_file = '/etc/nagios/nagios.cfg'
logwatch_notes_url = "/nagios/logwatch.php?host=%s&file=%s"
@@ -4710,7 +4711,10 @@
sys.stdout.flush()
if monitoring_core == "nagios":
os.putenv("CORE_NOVERIFY", "yes")
- command = nagios_startscript + " re%s 2>&1" % action
+ if nagios_startuptype == 'script':
+ command = nagios_startscript + " re%s 2>&1" % action
+ else:
+ command = nagios_startuptype + " re%s " % action + nagios_service
else:
command = "omd re%s cmc 2>&1" % action

View File

@ -1,2 +0,0 @@
01_fix_livestatus.patch
02_wato-sudoers.patch

217
debian/paths.py.icinga vendored Normal file
View File

@ -0,0 +1,217 @@
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
# | | |___| | | | __/ (__| < | | | | . \ |
# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
# | |
# | Copyright Mathias Kettner 2016 mk@mathias-kettner.de |
# +------------------------------------------------------------------+
#
# This file is part of Check_MK.
# The official homepage is at http://mathias-kettner.de/check_mk.
#
# check_mk is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation in version 2. check_mk is distributed
# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. See the GNU General Public License for more de-
# tails. You should have received a copy of the GNU General Public
# License along with GNU Make; see the file COPYING. If not, write
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
"""This module serves the path structure of the Check_MK environment
to all components of Check_MK."""
import os
from .exceptions import MKGeneralException
# TODO: Clean this up one day by using the way recommended by gettext.
# (See https://docs.python.org/2/library/gettext.html). For this we
# need the path to the locale files here.
try:
_
except NameError:
_ = lambda x: x # Fake i18n when not available
#
# First declare the possible paths for the linters. Then set it within _set_paths()
#
# TODO: Add piggyback_dir and use it in code
omd_root = None
default_config_dir = None
main_config_file = None
final_config_file = None
local_config_file = None
check_mk_config_dir = None
modules_dir = None
var_dir = None
log_dir = None
autochecks_dir = None
precompiled_hostchecks_dir= None
snmpwalks_dir = None
counters_dir = None
tcp_cache_dir = None
tmp_dir = None
logwatch_dir = None
nagios_objects_file = None
nagios_command_pipe_path = None
check_result_path = None
nagios_status_file = None
nagios_conf_dir = None
nagios_config_file = None
nagios_startscript = None
nagios_binary = None
apache_config_dir = None
htpasswd_file = None
livestatus_unix_socket = None
pnp_rraconf_dir = None
livebackendsdir = None
share_dir = None
checks_dir = None
notifications_dir = None
inventory_dir = None
check_manpages_dir = None
agents_dir = None
mibs_dir = None
web_dir = None
pnp_templates_dir = None
doc_dir = None
locale_dir = None
bin_dir = None
lib_dir = None
mib_dir = None
# TODO: Add active_checks_dir and make it used in code
local_share_dir = None
local_checks_dir = None
local_notifications_dir = None
local_inventory_dir = None
local_check_manpages_dir = None
local_agents_dir = None
local_mibs_dir = None
local_web_dir = None
local_pnp_templates_dir = None
local_doc_dir = None
local_locale_dir = None
local_bin_dir = None
local_lib_dir = None
local_mib_dir = None
def _set_paths():
omd_root = _omd_root()
globals().update({
"omd_root" : omd_root,
"default_config_dir" : os.path.join(omd_root, "etc/check_mk"),
"main_config_file" : os.path.join(omd_root, "etc/check_mk/main.mk"),
"final_config_file" : os.path.join(omd_root, "etc/check_mk/final.mk"),
"local_config_file" : os.path.join(omd_root, "etc/check_mk/local.mk"),
"check_mk_config_dir" : os.path.join(omd_root, "etc/check_mk/conf.d"),
"modules_dir" : os.path.join(omd_root, "share/check_mk/modules"),
"var_dir" : os.path.join(omd_root, "var/check_mk"),
"log_dir" : os.path.join(omd_root, "var/log"),
"autochecks_dir" : os.path.join(omd_root, "var/check_mk/autochecks"),
"precompiled_hostchecks_dir" : os.path.join(omd_root, "var/check_mk/precompiled"),
"snmpwalks_dir" : os.path.join(omd_root, "var/check_mk/snmpwalks"),
"counters_dir" : os.path.join(omd_root, "tmp/check_mk/counters"),
"tcp_cache_dir" : os.path.join(omd_root, "tmp/check_mk/cache"),
"tmp_dir" : os.path.join(omd_root, "tmp/check_mk"),
"logwatch_dir" : os.path.join(omd_root, "var/check_mk/logwatch"),
"nagios_startscript" : os.path.join(omd_root, "etc/init.d/iginga"),
# Switched via symlinks on icinga/nagios change
"nagios_conf_dir" : os.path.join(omd_root, "etc/icinga/conf.d"),
"nagios_objects_file" : os.path.join(omd_root, "etc/icinga/conf.d/check_mk_objects.cfg"),
"check_result_path" : os.path.join(omd_root, "tmp/nagios/checkresults"),
"nagios_status_file" : os.path.join(omd_root, "tmp/nagios/status.dat"),
"apache_config_dir" : os.path.join(omd_root, "etc/apache"),
"htpasswd_file" : os.path.join(omd_root, "etc/htpasswd"),
"livestatus_unix_socket" : os.path.join(omd_root, "tmp/run/live"),
"pnp_rraconf_dir" : os.path.join(omd_root, "share/check_mk/pnp-rraconf"),
"livebackendsdir" : os.path.join(omd_root, "share/check_mk/livestatus"),
})
_set_core_specific_paths()
_set_overridable_paths()
_set_overridable_paths(local=True)
def _omd_root():
return os.environ.get("OMD_ROOT", "")
#try:
#except KeyError:
# raise MKGeneralException(_("OMD_ROOT environment variable not set. You can "
# "only execute this in an OMD site."))
def _set_core_specific_paths():
omd_root = _omd_root()
core = _get_core_name()
if core == "icinga":
globals().update({
"nagios_binary" : os.path.join(omd_root, "bin/icinga"),
"nagios_config_file" : os.path.join(omd_root, "tmp/icinga/icinga.cfg"),
"nagios_command_pipe_path" : os.path.join(omd_root, "tmp/run/icinga.cmd"),
})
else:
globals().update({
# debian override of default for icinga, to avoid needing an
# etc/omd/site.conf
"nagios_binary" : os.path.join(omd_root, "bin/icinga"),
"nagios_config_file" : os.path.join(omd_root, "tmp/icinga/nagios.cfg"),
"nagios_command_pipe_path" : os.path.join(omd_root, "tmp/run/icinga.cmd"),
})
# TODO: Find a better way to determine the currently configured core.
# For example generalize the etc/check_mk/conf.d/microcore.mk which is written by the CORE
# hook -> Change the name to core.mk and write it for all configured cores.
def _get_core_name():
try:
for l in open(os.path.join(omd_root, "etc/omd/site.conf")):
if l.startswith("CONFIG_CORE='"):
return l.split("'")[1]
except IOError, e:
# At least in test environment the file is not available. We only added this try/except for
# this case. This should better be solved in a cleaner way.
if e.errno == 2:
pass
else:
raise
def _set_overridable_paths(local=False):
rel_base = "local" if local else ""
var_prefix = "local_" if local else ""
globals().update({
var_prefix+"share_dir" : os.path.join(omd_root, rel_base, "share/check_mk"),
var_prefix+"checks_dir" : os.path.join(omd_root, rel_base, "share/check_mk/checks"),
var_prefix+"notifications_dir" : os.path.join(omd_root, rel_base, "share/check_mk/notifications"),
var_prefix+"inventory_dir" : os.path.join(omd_root, rel_base, "share/check_mk/inventory"),
var_prefix+"check_manpages_dir" : os.path.join(omd_root, rel_base, "share/check_mk/checkman"),
var_prefix+"agents_dir" : os.path.join(omd_root, rel_base, "share/check_mk/agents"),
var_prefix+"mibs_dir" : os.path.join(omd_root, rel_base, "share/check_mk/mibs"),
var_prefix+"web_dir" : os.path.join(omd_root, rel_base, "share/check_mk/web"),
var_prefix+"pnp_templates_dir" : os.path.join(omd_root, rel_base, "share/check_mk/pnp-templates"),
var_prefix+"doc_dir" : os.path.join(omd_root, rel_base, "share/doc/check_mk"),
var_prefix+"locale_dir" : os.path.join(omd_root, rel_base, "share/check_mk/locale"),
var_prefix+"bin_dir" : os.path.join(omd_root, rel_base, "bin"),
var_prefix+"lib_dir" : os.path.join(omd_root, rel_base, "lib"),
var_prefix+"mib_dir" : os.path.join(omd_root, rel_base, "share/snmp/mibs"),
})
_set_paths()

60
debian/rules vendored
View File

@ -9,7 +9,10 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
#python_share_dir = /usr/share/check_mk
#export PYBUILD_INSTALL_ARGS ?= \
# --install-lib=${package_share_dir}/ \
# --install-scripts=${package_share_dir}/
@ -21,8 +24,6 @@ configure-stamp:
tar -xzf agents.tar.gz -C agents
mkdir docs
tar -xzf doc.tar.gz -C docs
mkdir config
tar -xzf conf.tar.gz -C config
touch configure-stamp
@ -31,7 +32,7 @@ build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp
build-stamp: configure-stamp
build-stamp: patch-stamp configure-stamp
dh_testdir
# Add here commands to compile the package.
@ -40,7 +41,7 @@ build-stamp: configure-stamp
touch $@
clean: clean-patched
clean: clean-patched unpatch
clean-patched:
dh_testdir
dh_testroot
@ -58,31 +59,41 @@ install: build
dh_installdirs
dh_installdebconf
mkdir -p debian/tmp
DESTDIR=debian/tmp ./setup.sh --yes
DESTDIR=debian/tmp python_lib_dir=/usr/share/check_mk/ ./setup.sh --yes
## clean up binaries shipped by upstream
# upstream agent deb and rpm
rm -rf debian/tmp/usr/share/check_mk/agent/check-mk-agent*.deb
rm -rf debian/tmp/usr/share/check_mk/agent/check-mk-agent*.rpm
# java jar and classes (we don't rebuild these, help if you want them)
rm -rf debian/tmp/usr/share/doc/check_mk/jasperreports
# Windows binaries (we don't rebuild these, help if you want them)
rm -rf debian/tmp/usr/share/doc/check_mk/treasures/jasperreports
# Windows binaries related (we don't rebuild these, help if you want them)
rm -rf debian/tmp/usr/share/check_mk/agents/windows
rm -rf debian/tmp/usr/share/doc/check_mk/windows
rm -rf debian/tmp/usr/share/doc/check_mk/checks/windows_*
rm -rf debian/tmp/usr/share/check_mk/checks/windows_*
rm -rf debian/tmp/usr/share/doc/check_mk/treasures/windows_msi
# fsc-celsius 'treasure' tarball that includes binaries
rm -rf debian/tmp/usr/share/doc/check_mk/treasures/fsc-celsius*
# agent_modbus
# remove deprecated stuff
rm -rf debian/tmp/usr/share/doc/check_mk/treasures/deprecated
# remove binary selinux policy file
rm -rf debian/tmp/usr/share/doc/check_mk/treasures/selinux/omd.pp
# remove webapps mkp package file and dir
rm -rf debian/tmp/usr/share/doc/check_mk/treasures/webapp
# remove sap agent with source tarball
rm -rf debian/tmp/usr/share/check_mk/agents/sap
# remove binary agent_modbus
rm debian/tmp/usr/share/doc/check_mk/treasures/modbus/agent_modbus
# remove waitmax binary, check_mk will use timeout if available
rm debian/tmp/usr/share/check_mk/agents/waitmax
rm debian/tmp/usr/share/check_mk/agents/z_os/waitmax
# copy the livestatus stuff that setup.sh generated in it's own dir
cp -a livestatus.src/debian/tmp/* debian/tmp/
## config files
# We need 2 different "defaults" files for Icinga and Nagios3
rm debian/tmp/usr/share/check_mk/modules/defaults
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
# We need 2 different Apache configs
# We need a "paths.py" file with edited paths for FHS and monitoring
# system changes
# remove the provided one
rm debian/tmp/usr/share/check_mk/cmk/paths.py
cp debian/paths.py.icinga debian/tmp/usr/share/check_mk/cmk/paths.py
# provide a safe apache config that references icinga
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
# Adjust path names
@ -96,7 +107,7 @@ install: build
chmod +x debian/check-mk-server/usr/bin/mkp
# xinetd: provide config, but disabled by default
cp debian/tmp/usr/share/check_mk/agents/cfg_examples/xinetd.conf debian/check-mk-agent/etc/xinetd.d/check_mk
#sed -i 's#disable\s*=\s*no#disable = yes#' debian/check-mk-agent/etc/xinetd.d/check_mk
sed -i 's#disable\s*=\s*no#disable = yes#' debian/check-mk-agent/etc/xinetd.d/check_mk
# move checks manpages (to be installed in -server)
mv debian/tmp/usr/share/doc/check_mk/checks debian/tmp/usr/share/check_mk/checks-man
# remove installed ChangeLog to avoid duplicate
@ -112,6 +123,7 @@ binary-indep: build install
dh_installchangelogs -i ChangeLog
dh_installexamples -i
dh_install -i
dh_python2 /usr/share/check_mk
dh_installman -i
dh_link -i
dh_strip -i
@ -141,7 +153,6 @@ binary-arch: build install
# dh_installemacsen
# dh_installpam
# dh_installmime
# dh_python
# dh_installinit
# dh_installcron
# dh_installinfo
@ -158,5 +169,16 @@ binary-arch: build install
dh_md5sums -a
dh_builddeb -a
patch: patch-stamp
patch-stamp:
@echo "Doing $@"
dpatch --with-cpp apply-all
dpatch --with-cpp cat-all >patch-stamp
unpatch:
@echo "Doing $@"
dpatch --with-cpp deapply-all
rm -rf patch-stamp debian/patched
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure

View File

@ -1 +1 @@
3.0 (quilt)
1.0

Binary file not shown.

Binary file not shown.

BIN
lib.tar.gz Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

25
precompile-werks.py Executable file
View File

@ -0,0 +1,25 @@
#!/usr/bin/env python
import os
import sys
import cmk.werks
werk_dir, dest_file = sys.argv[1:3]
if len(sys.argv) > 3:
edition_short = sys.argv[3]
else:
edition_short = None
werks = cmk.werks.load_raw_files(werk_dir)
if edition_short:
edition_werks = {}
for werk in werks.values():
if werk["edition"] == edition_short:
edition_werks[werk["id"]] = werk
werks = edition_werks
cmk.werks.write_precompiled_werks(dest_file, werks)

170
setup.sh
View File

@ -24,7 +24,7 @@
# Boston, MA 02110-1301 USA.
VERSION=1.2.8p26
VERSION=1.4.0p9
NAME=check_mk
LANG=
LC_ALL=
@ -164,17 +164,9 @@ ask_title ()
echo
}
if [ -z "$YES" ] ; then cat <<EOF
if [ -z "$YES" ] ; then
cat <<EOF

 ____ _ _ __ __ _ __ 
 / ___| |__ ___ ___| | __ | \/ | |/ / 
 | | | '_ \ / _ \/ __| |/ / | |\/| | ' / 
@ -182,20 +174,33 @@ if [ -z "$YES" ] ; then cat <<EOF
 \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ 
 |_____| 
 
 Check_MK setup $(printf "%32s" Version:' '$VERSION) 
Welcome to Check_MK. This setup will install Check_MK into user defined
directories. If you run this script as root, installation paths below
/usr will be suggested. If you run this script as non-root user paths
in your home directory will be suggested. You may override the default
values or just hit enter to accept them.
Your answers will be saved to $SETUPCONF and will be
reused when you run the setup of this or a later version again. Please
delete that file if you want to delete your previous answers.
 Check_MK manual setup $(printf "%32s" Version:' '$VERSION) 
 
 The manual setup of Check_MK via ./setup.sh is not possible 
 anymore. Check_MK is only supported to be used with the 
 Check_MK Raw or Enterprise Edition packages. 
 
 These have many advantages: 
 
 - Very easy installation via a single RPM/DEB package 
 - Contains fully integrated complete monitoring environment 
 - Does not need installation of Nagios, PNP4Nagios or plugins 
 - Supports multiple versions of Check_MK at the same time 
 - Supports multiple monitoring instances on one server 
 - Actively maintainained by the Check_MK project 
 
 
 You can download the Check_MK Raw Edition for free here: 
 
 http://mathias-kettner.com/download 
 
 Installation instructions are here: 
 
 http://mathias-kettner.com/cms_introduction_packages.html 
 
EOF
exit 1
fi
if [ -z "$DESTDIR" ]
@ -256,6 +261,16 @@ ask_dir vardir /var/lib/$NAME $HOMEBASEDIR/var $OMD_ROOT/var/check_mk "working d
other files into this directory. The setup will create several subdirectories
and makes them writable by the Nagios process"
PYTHON_PATH=$(python -c "import sys; print([ p for p in sys.path if p.startswith(\"/usr/lib/\") and p.count(\"/\") == 3 ][0])" 2>/dev/null)
if [ -z "$PYTHON_PATH" ]; then
PYTHON_PATH=/usr/lib/python2.7
fi
ask_dir python_lib_dir $PYTHON_PATH $HOMEBASEDIR/python $OMD_ROOT/lib/python "Check_MK python modules" \
"Check_MKs different components share common code in Python modules. These
have to be installed in a directory where the used Python interpreter is
searching for modules."
ask_title "Configuration of Linux/UNIX Agents"
@ -463,84 +478,7 @@ modulesdir=$sharedir/modules
web_dir=$sharedir/web
localedir=$sharedir/locale
agentsdir=$sharedir/agents
create_defaults ()
{
cat <<EOF
# encoding: utf-8
# This file has been created during setup of check_mk at $(date).
# 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 = '$VERSION'
default_config_dir = '$confdir'
check_mk_configdir = '$confdir/conf.d'
share_dir = '$sharedir'
checks_dir = '$checksdir'
notifications_dir = '$notificationsdir'
inventory_dir = '$inventorydir'
check_manpages_dir = '$checkmandir'
modules_dir = '$modulesdir'
locale_dir = '$localedir'
agents_dir = '$agentsdir'
lib_dir = '$libdir'
var_dir = '$vardir'
log_dir = '$vardir/log'
snmpwalks_dir = '$vardir/snmpwalks'
autochecksdir = '$vardir/autochecks'
precompiled_hostchecks_dir = '$vardir/precompiled'
counters_directory = '$vardir/counters'
tcp_cache_dir = '$vardir/cache'
tmp_dir = '$vardir/tmp'
logwatch_dir = '$vardir/logwatch'
nagios_objects_file = '$nagconfdir/check_mk_objects.cfg'
rrd_path = '$rrd_path'
rrddcached_socket = '$rrdcached_socket'
nagios_command_pipe_path = '$nagpipe'
check_result_path = '$check_result_path'
nagios_status_file = '$nagios_status_file'
nagios_conf_dir = '$nagconfdir'
nagios_user = '$nagiosuser'
logwatch_notes_url = '${url_prefix}check_mk/logwatch.py?host=%s&file=%s'
www_group = '$wwwgroup'
nagios_config_file = '$nagios_config_file'
nagios_startscript = '$nagios_startscript'
nagios_binary = '$nagios_binary'
apache_config_dir = '$apache_config_dir'
htpasswd_file = '$htpasswd_file'
nagios_auth_name = '$nagios_auth_name'
web_dir = '$web_dir'
livestatus_unix_socket = '$livesock'
livebackendsdir = '$livebackendsdir'
url_prefix = '$url_prefix'
pnp_url = '${url_prefix}pnp4nagios/'
pnp_templates_dir = '$pnptemplates'
doc_dir = '$docdir'
EOF
if [ -n "$OMD_ROOT" ] ; then
cat <<EOF
# Special for OMD
check_mk_automation = None
omd_site = '$OMD_SITE'
omd_root = '$OMD_ROOT'
tcp_cache_dir = '$OMD_ROOT/tmp/check_mk/cache'
counters_directory = '$OMD_ROOT/tmp/check_mk/counters'
EOF
else
cat <<EOF
check_mk_automation = 'sudo -u $(id -un) $bindir/check_mk --automation'
EOF
fi
}
activechecksdir=${check_icmp_path%/*}
if [ -z "$YES" ]
then
@ -595,11 +533,11 @@ EOF
compile_mkeventd ()
{
local D=$SRCDIR/mkeventd.src
local D=$SRCDIR/bin
rm -rf $D
mkdir -p $D
tar xvzf $SRCDIR/mkeventd.tar.gz -C $D
pushd $D/src &&
tar xzf $SRCDIR/bin.tar.gz -C $D
pushd $D &&
make &&
popd
}
@ -803,20 +741,23 @@ do
fi &&
mkdir -p $DESTDIR$sharedir &&
tar xzf $SRCDIR/share.tar.gz -C $DESTDIR$sharedir &&
mkdir -p $DESTDIR$python_lib_dir &&
tar xzf $SRCDIR/lib.tar.gz -C $DESTDIR$python_lib_dir &&
tar xzf $SRCDIR/base.tar.gz -C $DESTDIR$python_lib_dir &&
mkdir -p $DESTDIR$sharedir/werks &&
tar xzf $SRCDIR/werks.tar.gz -C $DESTDIR$sharedir/werks &&
mkdir -p $DESTDIR$modulesdir &&
create_defaults > $DESTDIR$modulesdir/defaults &&
mkdir -p $DESTDIR$localedir &&
mkdir -p $DESTDIR$checksdir &&
tar xzf $SRCDIR/checks.tar.gz -C $DESTDIR$checksdir &&
mkdir -p $DESTDIR$activechecksdir &&
tar xzf $SRCDIR/active_checks.tar.gz -C $DESTDIR$activechecksdir &&
mkdir -p $DESTDIR$notificationsdir &&
tar xzf $SRCDIR/notifications.tar.gz -C $DESTDIR$notificationsdir &&
mkdir -p $DESTDIR$inventorydir &&
tar xzf $SRCDIR/inventory.tar.gz -C $DESTDIR$inventorydir &&
mkdir -p $DESTDIR$web_dir &&
tar xzf $SRCDIR/web.tar.gz -C $DESTDIR$web_dir &&
cp $DESTDIR$modulesdir/defaults $DESTDIR$web_dir/htdocs/defaults.py &&
mkdir -p $DESTDIR$pnptemplates &&
tar xzf $SRCDIR/pnp-templates.tar.gz -C $DESTDIR$pnptemplates &&
mkdir -p $DESTDIR$modulesdir &&
@ -863,7 +804,10 @@ do
chgrp $wwwgroup $DESTDIR$confdir/conf.d/distributed_wato.mk &&
chmod 664 $DESTDIR$confdir/conf.d/distributed_wato.mk
fi &&
tar xzf $SRCDIR/conf.tar.gz -C $DESTDIR$confdir &&
echo -e "# Main configuration file of Check_MK\n#We highly recommend to use WATO to configure Check_MK these days." \
> $DESTDIR$confdir/main.mk-$VERSION &&
echo -e "# Main configuration file of the Check_MK GUI\n#We highly recommend to use WATO to configure Check_MK these days." \
> $DESTDIR$confdir/multisite.mk-$VERSION &&
if [ -e $DESTDIR$confdir/check_mk.cfg -a ! -e $DESTDIR$confdir/main.mk ] ; then
mv -v $DESTDIR$confdir/check_mk.cfg $DESTDIR$confdir/main.mk
echo "Renamed check_mk.cfg into main.mk."
@ -1058,13 +1002,9 @@ EOF
compile_mkeventd 2>&1 | propeller > $SRCDIR/mkeventd.log
if [ "${PIPESTATUS[0]}" = 0 ]
then
pushd $SRCDIR/mkeventd.src > /dev/null &&
install -m 755 src/mkevent $DESTDIR$bindir &&
install -m 4754 src/mkeventd_open514 -g $wwwgroup $DESTDIR$bindir &&
install -m 644 checks/* $DESTDIR$checksdir &&
install -m 755 bin/* $DESTDIR$bindir &&
install -m 755 lib/* $DESTDIR${check_icmp_path%/*} &&
cp -r web/* $DESTDIR$web_dir &&
pushd $SRCDIR > /dev/null &&
install -m 755 bin/mkevent bin/mkeventd $DESTDIR$bindir &&
install -m 4754 bin/mkeventd_open514 -g $wwwgroup $DESTDIR$bindir &&
mkdir -p $DESTDIR$confdir/mkeventd.d/wato &&
chown $wwwuser.$wwwgroup $DESTDIR$confdir/mkeventd.d/wato &&
if [ ! -e "$DESTDIR$confdir/multisite.d/mkeventd.mk" ] ; then

Binary file not shown.

40
standalone.make Normal file
View File

@ -0,0 +1,40 @@
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
# | | |___| | | | __/ (__| < | | | | . \ |
# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
# | |
# | Copyright Mathias Kettner 2014 mk@mathias-kettner.de |
# +------------------------------------------------------------------+
#
# This file is part of Check_MK.
# The official homepage is at http://mathias-kettner.de/check_mk.
#
# check_mk is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation in version 2. check_mk is distributed
# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. See the GNU General Public License for more de-
# tails. You should have received a copy of the GNU General Public
# License along with GNU Make; see the file COPYING. If not, write
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
# TODO(sp) We should really use autotools here...
ifneq ($(shell which g++-6 2>/dev/null),)
CXX := g++-6 -std=c++14
else
CXX := g++-5 -std=c++14
endif
CXXFLAGS := -g -O3 -Wall -Wextra
LDFLAGS := -static-libstdc++
.PHONY: all clean
all: $(EXECUTABLES)
clean:
$(RM) $(EXECUTABLES)

Binary file not shown.

Binary file not shown.