Imported Upstream version 1.4.0p9

This commit is contained in:
Mario Fetka 2019-07-26 11:45:01 +02:00
parent 4208ef3fec
commit c4a45445af
26 changed files with 5204 additions and 4382 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)

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.