Skip to content

Commit

Permalink
update build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisss404 committed Nov 4, 2022
1 parent aa312e7 commit 2bd89d9
Show file tree
Hide file tree
Showing 4 changed files with 115 additions and 117 deletions.
56 changes: 19 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 <version>
# 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 <version>

# build a specific version of Checkmk targeting Groovy, e.g.: 2.1.0p2
bash build_check_mk_groovy64.sh <version>
# 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 <version>

### Patches

Expand Down
27 changes: 17 additions & 10 deletions build_check_mk_bullseye32.sh → build_check_mk_debian_32bit.sh
Original file line number Diff line number Diff line change
@@ -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 \
Expand All @@ -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
Expand All @@ -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
Expand All @@ -48,7 +55,7 @@ make deb DEBFULLNAME="Christian Hofer" [email protected]

# 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
70 changes: 0 additions & 70 deletions build_check_mk_groovy64.sh

This file was deleted.

79 changes: 79 additions & 0 deletions build_check_mk_ubuntu_64bit.sh
Original file line number Diff line number Diff line change
@@ -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" [email protected]

# cleanup
if [ $? -eq 0 ]; then
mv check-mk-raw-${CHECKMK_VERSION}* ..
cd ..
rm -rf check-mk-raw-${CHECKMK_VERSION}.cre
fi

0 comments on commit 2bd89d9

Please sign in to comment.