diff --git a/README.md b/README.md index 5a542dd..6f889fd 100644 --- a/README.md +++ b/README.md @@ -3,78 +3,60 @@ On the [release](https://github.com/chrisss404/check-mk-arm/releases) page you can find deb packages targeting the following systems: -* [Raspberry Pi OS (32-bit)](https://www.raspberrypi.org/downloads/raspberry-pi-os/) (formerly Raspbian) "Bullseye" on a RPi 3 and 4 +* [Raspberry Pi OS (32-bit)](https://www.raspberrypi.org/downloads/raspberry-pi-os/) (formerly Raspbian) "Bullseye" -* [Ubuntu (64-bit)](https://ubuntu.com/download/raspberry-pi/) "Jammy" on a RPi 4 -* [Ubuntu (64-bit)](https://ubuntu.com/download/raspberry-pi/) "Focal" on a RPi 4 +* [Ubuntu (64-bit)](https://ubuntu.com/download/raspberry-pi/) "Jammy" +* [Ubuntu (64-bit)](https://ubuntu.com/download/raspberry-pi/) "Focal" -* [Debian (64-bit)](https://raspi.debian.net/tested/) "Bullseye" on a RPi 4 +* [Debian (64-bit)](https://raspi.debian.net/tested/) "Bullseye" -* [Ubuntu (64-bit)](https://ubuntu.com/download/raspberry-pi/) "Impish" on a RPi 4 (EOL / last version will be 2.0.0.p25) -* [Ubuntu (64-bit)](https://ubuntu.com/download/raspberry-pi/) "Hirsute" on a RPi 4 (EOL / last version will be 2.0.0.p20) -* [Ubuntu (64-bit)](https://ubuntu.com/download/raspberry-pi/) "Groovy" on a RPi 4 (EOL / last version will be 2.0.0.p16) +* [Ubuntu (64-bit)](https://ubuntu.com/download/raspberry-pi/) "Impish" (EOL / last version will be 2.0.0.p25) +* [Ubuntu (64-bit)](https://ubuntu.com/download/raspberry-pi/) "Hirsute" (EOL / last version will be 2.0.0.p20) +* [Ubuntu (64-bit)](https://ubuntu.com/download/raspberry-pi/) "Groovy" (EOL / last version will be 2.0.0.p16) ##### The builds for Focal and Groovy are untested ! ##### The build for Bullseye arm64 is untested ! -If your system is listed you can follow the instructions from section [Install Checkmk to your RPi](#install-checkmk-to-your-rpi), otherwise please refer to section [Build Checkmk from sources](#build-checkmk-from-sources) to compile a package for your system. +If your system is listed you can follow the instructions from section [Install Checkmk to your device](#install-checkmk-to-your-device), otherwise please refer to section [Build Checkmk from sources](#build-checkmk-from-sources) to compile a package for your system. The sources of Checkmk can be found here: https://github.com/tribe29/checkmk ![Checkmk](https://raw.github.com/chrisss404/check-mk-arm/master/data/check_mk.png) -### Recommended Configurations +### Recommended configurations when running on a RPi ##### Reduce the number of apache processes Go to `Setup` > `General` > `Global settings` > `Site Management` and reduce the number at `Apache process tuning` to 5. -### Install Checkmk to your RPi +### Install Checkmk to your device -The following sections show how to download and install the DEB packages available from this repo. After the installation you could follow the [official user guide](https://docs.checkmk.com/latest/en/) to set it up and start your monitoring journey. +The following sections show how to download and install the DEB packages available from this repo. After the installation you can follow the [official user guide](https://docs.checkmk.com/latest/en/) to set it up and start your monitoring journey. ##### Raspberry Pi OS (32-bit) Bullseye curl -LO $(curl -s https://api.github.com/repos/chrisss404/check-mk-arm/releases/tags/2.1.0p15 | grep browser_download_url | cut -d '"' -f 4 | grep bullseye_armhf.deb) dpkg -i check-mk-raw-*.bullseye_armhf.deb - apt-get install -f + apt-get update && apt-get install -f ##### Ubuntu (64-bit) Jammy curl -LO $(curl -s https://api.github.com/repos/chrisss404/check-mk-arm/releases/tags/2.1.0p15 | grep browser_download_url | cut -d '"' -f 4 | grep jammy_arm64.deb) dpkg -i check-mk-raw-*.jammy_arm64.deb - apt-get install -f + apt-get update && apt-get install -f ##### Ubuntu (64-bit) Focal curl -LO $(curl -s https://api.github.com/repos/chrisss404/check-mk-arm/releases/tags/2.1.0p15 | grep browser_download_url | cut -d '"' -f 4 | grep focal_arm64.deb) dpkg -i check-mk-raw-*.focal_arm64.deb - apt-get install -f - -##### Ubuntu (64-bit) Impish - - curl -LO $(curl -s https://api.github.com/repos/chrisss404/check-mk-arm/releases/tags/2.0.0p25 | grep browser_download_url | cut -d '"' -f 4 | grep impish_arm64.deb) - dpkg -i check-mk-raw-*.impish_arm64.deb - apt-get install -f - -##### Ubuntu (64-bit) Hirsute - - curl -LO $(curl -s https://api.github.com/repos/chrisss404/check-mk-arm/releases/tags/2.0.0p20 | grep browser_download_url | cut -d '"' -f 4 | grep hirsute_arm64.deb) - dpkg -i check-mk-raw-*.hirsute_arm64.deb - apt-get install -f - -##### Ubuntu (64-bit) Groovy - - curl -LO $(curl -s https://api.github.com/repos/chrisss404/check-mk-arm/releases/tags/2.0.0p16 | grep browser_download_url | cut -d '"' -f 4 | grep groovy_arm64.deb) - dpkg -i check-mk-raw-*.groovy_arm64.deb - apt-get install -f + apt-get update && apt-get install -f ##### Debian (64-bit) Bullseye curl -LO $(curl -s https://api.github.com/repos/chrisss404/check-mk-arm/releases/tags/2.1.0p15 | grep browser_download_url | cut -d '"' -f 4 | grep bullseye_arm64.deb) dpkg -i check-mk-raw-*.bullseye_arm64.deb - apt-get install -f + apt-get update && apt-get install -f ### Package overview @@ -106,11 +88,11 @@ The following sections show how to download and install the DEB packages availab ### Build Checkmk from sources - # build a specific version of Checkmk targeting Bullseye, e.g.: 2.1.0p2 - INSTALL_DEPENDENCIES=1 bash build_check_mk_bullseye32.sh + # build a specific version of Checkmk targeting Debian 32-bit, e.g.: 2.1.0p15 + INSTALL_DEPENDENCIES=1 bash build_check_mk_debian_32bit.sh - # build a specific version of Checkmk targeting Groovy, e.g.: 2.1.0p2 - bash build_check_mk_groovy64.sh + # build a specific version of Checkmk targeting Ubuntu 64-bit, e.g.: 2.1.0p15 + INSTALL_DEPENDENCIES=1 bash build_check_mk_ubuntu_64bit.sh ### Patches diff --git a/build_check_mk_bullseye32.sh b/build_check_mk_debian_32bit.sh similarity index 74% rename from build_check_mk_bullseye32.sh rename to build_check_mk_debian_32bit.sh index c858f78..6e9c8d3 100644 --- a/build_check_mk_bullseye32.sh +++ b/build_check_mk_debian_32bit.sh @@ -1,15 +1,15 @@ #!/bin/bash -VERSION="2.1.0p2" +CHECKMK_VERSION="2.1.0p15" SNAP7_VERSION="1.4.2" if [ $# -gt 0 ]; then - VERSION="$1" + CHECKMK_VERSION="$1" fi -echo "building Check_MK ${VERSION}..." +echo "building Check_MK ${CHECKMK_VERSION}..." -# get check_mk sources and build dependencies +# get check_mk build dependencies if [ ${INSTALL_DEPENDENCIES:-0} -eq 1 ]; then apt-get -y install apache2 build-essential chrpath cmake debhelper dnsutils dpatch flex fping freetds-dev git \ git-buildpackage make rpcbind rrdtool smbclient snmp apache2-dev default-libmysqlclient-dev dietlibc-dev \ @@ -19,11 +19,18 @@ if [ ${INSTALL_DEPENDENCIES:-0} -eq 1 ]; then libsodium-dev libsqlite3-dev libssl-dev libxml2-dev libxmlsec1-dev patchelf python3-pip tk-dev uuid-dev fi -wget -qO- https://download.checkmk.com/checkmk/${VERSION}/check-mk-raw-${VERSION}.cre.tar.gz | tar -xvz -cd check-mk-raw-${VERSION}.cre +# get check_mk sources +if [ ! -f check-mk-raw-${CHECKMK_VERSION}.cre.tar.gz ]; then + wget -q https://download.checkmk.com/checkmk/${CHECKMK_VERSION}/check-mk-raw-${CHECKMK_VERSION}.cre.tar.gz +fi +rm -rf check-mk-raw-${CHECKMK_VERSION}.cre +tar xfz check-mk-raw-${CHECKMK_VERSION}.cre.tar.gz + +# configure check_mk +cd check-mk-raw-${CHECKMK_VERSION}.cre ./configure -# patch files +# apply patches patch -p0 < ../omd-Makefile-remove-module-navicli.patch patch -p0 < ../omdlib-reduce-certificate-maximum-validity-period.patch patch -p0 < ../python-make-add-fno-semantic-interposition.patch @@ -33,7 +40,7 @@ patch -p0 < ../pipfile-remove-pbr.patch patch -p0 < ../pipfile-remove-playwright.patch # prepare snap7 -tar -xvzf omd/packages/snap7/snap7-${SNAP7_VERSION}.tar.gz -C omd/packages/snap7 +tar xvzf omd/packages/snap7/snap7-${SNAP7_VERSION}.tar.gz -C omd/packages/snap7 cp omd/packages/snap7/snap7-${SNAP7_VERSION}/build/unix/arm_v6_linux.mk omd/packages/snap7/snap7-${SNAP7_VERSION}/build/unix/armv6l_linux.mk ln -s arm_v6-linux omd/packages/snap7/snap7-${SNAP7_VERSION}/build/bin/armv6l-linux cp omd/packages/snap7/snap7-${SNAP7_VERSION}/build/unix/arm_v7_linux.mk omd/packages/snap7/snap7-${SNAP7_VERSION}/build/unix/armv7l_linux.mk @@ -48,7 +55,7 @@ make deb DEBFULLNAME="Christian Hofer" DEBEMAIL=chrisss404@gmail.com # cleanup if [ $? -eq 0 ]; then - mv check-mk-raw-${VERSION}* .. + mv check-mk-raw-${CHECKMK_VERSION}* .. cd .. - rm -rf check-mk-raw-${VERSION}.cre + rm -rf check-mk-raw-${CHECKMK_VERSION}.cre fi diff --git a/build_check_mk_groovy64.sh b/build_check_mk_groovy64.sh deleted file mode 100644 index 7164321..0000000 --- a/build_check_mk_groovy64.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash - -VERSION="2.1.0p2" -SNAP7_VERSION="1.4.2" - -if [ $# -gt 0 ]; then - VERSION="$1" -fi - -echo "building Check_MK ${VERSION}..." - -if [ ! -d check-mk-raw-${VERSION}.cre ]; then - if [ ! -f check-mk-raw-${VERSION}.cre.tar.gz ]; then - wget -q https://download.checkmk.com/checkmk/${VERSION}/check-mk-raw-${VERSION}.cre.tar.gz - fi - tar xfz check-mk-raw-${VERSION}.cre.tar.gz -fi - -cd check-mk-raw-${VERSION}.cre -./configure - -# patch files -patch -p0 < ../omd-Makefile-remove-module-navicli.patch -patch -p0 < ../omdlib-reduce-certificate-maximum-validity-period.patch -patch -p0 < ../python-make-add-fno-semantic-interposition.patch -patch -p0 < ../python-make-set-aarch64-architecture.patch -patch -p0 < ../protobuf-make-add-latomic.patch -patch -p0 < ../pipfile-remove-pbr.patch -patch -p0 < ../pipfile-remove-playwright.patch - -touch agents/windows/check_mk.user.yml -touch agents/windows/check_mk_agent_arm64.{exe,msi} - -tar xzf omd/packages/net-snmp/net-snmp-0b32548.tar.gz -C /tmp -cp /usr/share/misc/config.guess /tmp/net-snmp-0b32548/ -tar czf omd/packages/net-snmp/net-snmp-0b32548.tar.gz -C /tmp net-snmp-0b32548 -rm -rf /tmp/net-snmp-0b32548 - -tar xzf omd/packages/nagios/nagios-3.5.1.tar.gz -C /tmp -cp /usr/share/misc/config.guess /tmp/nagios-3.5.1/ -tar czf omd/packages/nagios/nagios-3.5.1.tar.gz -C /tmp nagios-3.5.1 -rm -rf /tmp/nagios-3.5.1 - -tar xzf omd/packages/nsca/nsca-2.9.1.tar.gz -C /tmp -cp /usr/share/misc/config.guess /tmp/nsca-2.9.1/ -tar czf omd/packages/nsca/nsca-2.9.1.tar.gz -C /tmp nsca-2.9.1 -rm -rf /tmp/nsca-2.9.1 - -tar xzf omd/packages/pnp4nagios/pnp4nagios-0.6.26.tar.gz -C /tmp -cp /usr/share/misc/config.guess /tmp/pnp4nagios-0.6.26/ -tar czf omd/packages/pnp4nagios/pnp4nagios-0.6.26.tar.gz -C /tmp pnp4nagios-0.6.26 -rm -rf /tmp/pnp4nagios-0.6.26 - -tar xzf omd/packages/stunnel/stunnel-5.50.tar.gz -C /tmp -cp /usr/share/misc/config.guess /tmp/stunnel-5.50/ -tar czf omd/packages/stunnel/stunnel-5.50.tar.gz -C /tmp stunnel-5.50 -rm -rf /tmp/stunnel-5.50 - -# prepare snap7 -tar -xvzf omd/packages/snap7/snap7-${SNAP7_VERSION}.tar.gz -C /tmp -cp /tmp/snap7-${SNAP7_VERSION}/build/unix/arm_v6_linux.mk /tmp/snap7-${SNAP7_VERSION}/build/unix/aarch64_linux.mk -sed -i 's/arm_v6/aarch64/' /tmp/snap7-${SNAP7_VERSION}/build/unix/aarch64_linux.mk -tar czf omd/packages/snap7/snap7-${SNAP7_VERSION}.tar.gz -C /tmp snap7-${SNAP7_VERSION} -rm -rf /tmp/snap7-${SNAP7_VERSION} - -# setup pipenv -bash buildscripts/infrastructure/build-nodes/scripts/install-pipenv.sh - -# compile and package -make deb DEBFULLNAME="Martin Petersen" DEBEMAIL=martin@petersen20.de diff --git a/build_check_mk_ubuntu_64bit.sh b/build_check_mk_ubuntu_64bit.sh new file mode 100644 index 0000000..40b756e --- /dev/null +++ b/build_check_mk_ubuntu_64bit.sh @@ -0,0 +1,79 @@ +#!/bin/bash + +CHECKMK_VERSION="2.1.0p15" +NAGIOS_VERSION="3.5.1" +NSCA_VERSION="2.9.1" +PNP4NAGIOS_VERSION="0.6.26" +SNAP7_VERSION="1.4.2" + +if [ $# -gt 0 ]; then + CHECKMK_VERSION="$1" +fi + +echo "building Check_MK ${CHECKMK_VERSION}..." + +# get check_mk build dependencies +if [ ${INSTALL_DEPENDENCIES:-0} -eq 1 ]; then + sudo apt-get -y install apache2-dev build-essential cmake devscripts flex freetds-dev libcurl4-openssl-dev \ + libffi-dev libglib2.0-dev libgsf-1-dev libjpeg-dev libkrb5-dev libldap2-dev libncurses5-dev libpango1.0-dev \ + libpcap-dev libperl-dev libpq-dev libreadline-dev librrd-dev libsasl2-dev libsodium-dev libssl-dev libxml2-dev \ + libxmlsec1-dev libxmlsec1-openssl libxslt-dev patchelf pipenv python3.9 python3.9-distutils python3.9-dev \ + rsync zlib1g-dev +fi + +# get check_mk sources +if [ ! -f check-mk-raw-${CHECKMK_VERSION}.cre.tar.gz ]; then + wget -q https://download.checkmk.com/checkmk/${CHECKMK_VERSION}/check-mk-raw-${CHECKMK_VERSION}.cre.tar.gz +fi +rm -rf check-mk-raw-${CHECKMK_VERSION}.cre +tar xfz check-mk-raw-${CHECKMK_VERSION}.cre.tar.gz + +# configure check_mk +cd check-mk-raw-${CHECKMK_VERSION}.cre +./configure + +# apply patches +patch -p0 < ../omd-Makefile-remove-module-navicli.patch +patch -p0 < ../python-make-add-fno-semantic-interposition.patch +patch -p0 < ../python-make-set-aarch64-architecture.patch +patch -p0 < ../protobuf-make-add-latomic.patch +patch -p0 < ../pipfile-remove-pbr.patch +patch -p0 < ../pipfile-remove-playwright.patch + +# prepare nagios +tar xvzf omd/packages/nagios/nagios-${NAGIOS_VERSION}.tar.gz -C /tmp +cp /usr/share/misc/config.guess /tmp/nagios-${NAGIOS_VERSION}/ +tar czf omd/packages/nagios/nagios-${NAGIOS_VERSION}.tar.gz -C /tmp nagios-${NAGIOS_VERSION} +rm -rf /tmp/nagios-${NAGIOS_VERSION} + +# prepare nsca +tar xzf omd/packages/nsca/nsca-${NSCA_VERSION}.tar.gz -C /tmp +cp /usr/share/misc/config.guess /tmp/nsca-${NSCA_VERSION}/ +tar czf omd/packages/nsca/nsca-${NSCA_VERSION}.tar.gz -C /tmp nsca-${NSCA_VERSION} +rm -rf /tmp/nsca-${NSCA_VERSION} + +# prepare pnp4nagios +tar xzf omd/packages/pnp4nagios/pnp4nagios-${PNP4NAGIOS_VERSION}.tar.gz -C /tmp +cp /usr/share/misc/config.guess /tmp/pnp4nagios-${PNP4NAGIOS_VERSION}/ +tar czf omd/packages/pnp4nagios/pnp4nagios-${PNP4NAGIOS_VERSION}.tar.gz -C /tmp pnp4nagios-${PNP4NAGIOS_VERSION} +rm -rf /tmp/pnp4nagios-${PNP4NAGIOS_VERSION} + +# prepare snap7 +tar xvzf omd/packages/snap7/snap7-${SNAP7_VERSION}.tar.gz -C /tmp +cp /tmp/snap7-${SNAP7_VERSION}/build/unix/arm_v6_linux.mk /tmp/snap7-${SNAP7_VERSION}/build/unix/aarch64_linux.mk +sed -i 's/arm_v6/aarch64/' /tmp/snap7-${SNAP7_VERSION}/build/unix/aarch64_linux.mk +tar czf omd/packages/snap7/snap7-${SNAP7_VERSION}.tar.gz -C /tmp snap7-${SNAP7_VERSION} +rm -rf /tmp/snap7-${SNAP7_VERSION} + +# setup pipenv +sudo bash buildscripts/infrastructure/build-nodes/scripts/install-pipenv.sh + +# compile and package +make deb DEBFULLNAME="Martin Petersen" DEBEMAIL=martin@petersen20.de + +# cleanup +if [ $? -eq 0 ]; then + mv check-mk-raw-${CHECKMK_VERSION}* .. + cd .. + rm -rf check-mk-raw-${CHECKMK_VERSION}.cre +fi