reorganized common repo, some minor modules improvements

This commit is contained in:
2021-12-06 16:21:13 +01:00
parent a9a0525cc5
commit 239d9972a5
29 changed files with 1782 additions and 21 deletions

39
repo/common/cmk/check_mk Normal file
View File

@@ -0,0 +1,39 @@
# Copyright (C) 2019 tribe29 GmbH - License: GNU General Public License v2
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and
# conditions defined in the file COPYING, which is part of this source code package.
service check_mk
{
type = UNLISTED
port = 6556
socket_type = stream
protocol = tcp
wait = no
user = root
server = /usr/bin/check_mk_agent
# To avoid intentional or unintentional overload due to too many parallel
# queries from one source we set this parameter. It limits the number of
# concurrent connections per source address. If you need more requests
# per source system, you can of course increase or remove this value
# (https://github.com/tribe29/checkmk/pull/157)
per_source = 3
# listen on IPv4 AND IPv6 when available on this host
#flags = IPv6
# If you use fully redundant monitoring and poll the client
# from more then one monitoring servers in parallel you might
# want to use the agent cache wrapper:
#server = /usr/bin/check_mk_caching_agent
# configure the IP address(es) of your Nagios server here:
only_from = 127.0.0.1 192.168.1.201
# Don't be too verbose. Don't log every check. This might be
# commented out for debugging. If this option is commented out
# the default options will be used for this service.
log_on_success =
disable = no
}

File diff suppressed because it is too large Load Diff

53
repo/common/cmk/mk_apt Executable file
View File

@@ -0,0 +1,53 @@
#!/bin/bash
# Copyright (C) 2019 tribe29 GmbH - License: GNU General Public License v2
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and
# conditions defined in the file COPYING, which is part of this source code package.
# Reason for this no-op: shellcheck disable=... before the first command disables the error for the
# entire script.
:
# Disable unused variable error (needed to keep track of version)
# shellcheck disable=SC2034
CMK_VERSION="2.0.0p3"
# Check for APT updates (Debian, Ubuntu)
# TODO:
# Einstellungen:
# - upgrade oder dist-upgrade
# - vorher ein update machen
# Bakery:
# - Bakelet anlegen
# - Async-Zeit einstellbar machen und das Ding immer async laufen lassen
# Check programmieren:
# * Schwellwerte auf Anzahlen
# * Regexen auf Pakete, die zu CRIT/WARN führen
# - Graph malen mit zwei Kurven
# This variable can either be "upgrade" or "dist-upgrade"
UPGRADE=upgrade
DO_UPDATE=yes
function check_apt_update {
if [ "$DO_UPDATE" = yes ] ; then
# NOTE: Even with -qq, apt-get update can output several lines to
# stderr, e.g.:
#
# W: There is no public key available for the following key IDs:
# 1397BC53640DB551
apt-get update -qq 2> /dev/null
fi
apt-get -o 'Debug::NoLocking=true' -o 'APT::Get::Show-User-Simulation-Note=false' -s -qq "$UPGRADE" | grep -v '^Conf'
}
if type apt-get > /dev/null ; then
echo '<<<apt:sep(0)>>>'
out=$(check_apt_update)
if [ -z "$out" ]; then
echo "No updates pending for installation"
else
echo "$out"
fi
fi