Skip to content

Commit

Permalink
update patches & update armhf version to 2.1.0p21
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisss404 committed Feb 12, 2023
1 parent 2db2fda commit ba6e36a
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 85 deletions.
59 changes: 30 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

## Checkmk for Raspberry Pi
## Arm builds of Checkmk

On the [release](https://github.com/chrisss404/check-mk-arm/releases) page you can find deb packages targeting the following systems:

Expand All @@ -11,8 +11,6 @@ On the [release](https://github.com/chrisss404/check-mk-arm/releases) page you c
* [Debian (64-bit)](https://raspi.debian.net/tested/) "Bullseye"

* [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 !
Expand All @@ -24,19 +22,37 @@ 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 when running on a RPi
### Tips & General Information

##### Reduce the number of apache processes
##### Errors during installation

````
dpkg: error processing package check-mk-raw-* (--install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
check-mk-raw-*
````
That's perfectly fine. Run `apt-get install -f` and the installation should complete successfully.

##### Raspberry Pi: use an HDD/SSD when running Checkmk

The `rrdcached` issues many small write requests which may harm your SD card, see: https://forum.checkmk.com/t/checkmk-on-raspberry-pi/27760/4

##### Raspberry Pi: reduce the number of apache processes

Go to `Setup` > `General` > `Global settings` > `Site Management` and reduce the number at `Apache process tuning` to 5.

##### Oracle Cloud Infrastructure: access web interface

In case of issues accessing the Checkmk web interface, check the pre-defined iptables rules, see: https://blog.meinside.dev/When-Oracle-Clouds-Ubuntu-Instance-Doesnt-Accept-Connections-to-Ports-Other-than-22/

### 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 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.0p20 | grep browser_download_url | cut -d '"' -f 4 | grep bullseye_armhf.deb)
curl -LO $(curl -s https://api.github.com/repos/chrisss404/check-mk-arm/releases/tags/2.1.0p21 | grep browser_download_url | cut -d '"' -f 4 | grep bullseye_armhf.deb)
dpkg -i check-mk-raw-*.bullseye_armhf.deb
apt-get update && apt-get install -f

Expand All @@ -62,7 +78,7 @@ The following sections show how to download and install the DEB packages availab

##### Raspberry Pi OS (32-bit)

* Checkmk 2.1.0 for Raspberry Pi OS Bullseye: [2.1.0p20](https://github.com/chrisss404/check-mk-arm/releases/tag/2.1.0p20)
* Checkmk 2.1.0 for Raspberry Pi OS Bullseye: [2.1.0p21](https://github.com/chrisss404/check-mk-arm/releases/tag/2.1.0p21)
* Checkmk 2.0.0 for Raspberry Pi OS Bullseye: [2.0.0p25](https://github.com/chrisss404/check-mk-arm/releases/tag/2.0.0p25)
* Checkmk 2.0.0 for Raspberry Pi OS Buster: [2.0.0p17](https://github.com/chrisss404/check-mk-arm/releases/tag/2.0.0p17)
* Checkmk 1.6.0 for Raspberry Pi OS Buster: [1.6.0p22](https://github.com/chrisss404/check-mk-arm/releases/tag/1.6.0p22)
Expand All @@ -77,33 +93,22 @@ The following sections show how to download and install the DEB packages availab

* Checkmk 2.0.0 for Ubuntu 21.10 Impish: [2.0.0p25](https://github.com/chrisss404/check-mk-arm/releases/tag/2.0.0p25)
* Checkmk 2.0.0 for Ubuntu 21.04 Hirsute: [2.0.0p20](https://github.com/chrisss404/check-mk-arm/releases/tag/2.0.0p20)
###### Because of EOL from hirsute version 2.0.0.p20 is the last version for it.

* Checkmk 2.0.0 for Ubuntu 20.10 Groovy: [2.0.0p16](https://github.com/chrisss404/check-mk-arm/releases/tag/2.0.0p16)
###### Version 2.0.0.p16 is the last version for groovy, because of EOL from groovy.

##### Debian (64-bit)

* Checkmk 2.1.0 for Debian Bullseye: [2.1.0p20](https://github.com/chrisss404/check-mk-arm/releases/tag/2.1.0p20)

### Build Checkmk from sources

# build a specific version of Checkmk targeting Debian 32-bit, e.g.: 2.1.0p15
# build a specific version of Checkmk targeting Debian 32-bit, e.g.: 2.1.0p21
INSTALL_DEPENDENCIES=1 bash build_check_mk_debian_32bit.sh <version>

# build a specific version of Checkmk targeting Ubuntu 64-bit, e.g.: 2.1.0p15
# build a specific version of Checkmk targeting Ubuntu 64-bit, e.g.: 2.1.0p21
INSTALL_DEPENDENCIES=1 bash build_check_mk_ubuntu_64bit.sh <version>

### Patches

#### Reduce maximum validity period of site certificates

cp omd/packages/omd/omdlib/certs.py omd/packages/omd/omdlib/certs_v2.py
vim omd/packages/omd/omdlib/certs_v2.py
-CERT_NOT_AFTER = 999 * 365 * 24 * 60 * 60 # 999 years by default
+CERT_NOT_AFTER = 65 * 365 * 24 * 60 * 60 # 65 years by default
diff -u omd/packages/omd/omdlib/certs.py omd/packages/omd/omdlib/certs_v2.py > ../omdlib-reduce-certificate-maximum-validity-period.patch

#### Remove module navicli

cp omd/Makefile omd/Makefile_v2
Expand All @@ -124,20 +129,16 @@ The following sections show how to download and install the DEB packages availab

cp omd/packages/Python/Python.make omd/packages/Python/Python.make_v2
vim omd/packages/Python/Python.make_v2
- $(PACKAGE_PYTHON_PYTHONPATH)/_sysconfigdata__linux_x86_64-linux-gnu.py
+ $(PACKAGE_PYTHON_PYTHONPATH)/_sysconfigdata__linux_aarch64-linux-gnu.py
- $(PACKAGE_PYTHON_PYTHONPATH)/_sysconfigdata__linux_x86_64-linux-gnu.py
+ $(PACKAGE_PYTHON_PYTHONPATH)/_sysconfigdata__linux_aarch64-linux-gnu.py
-PYTHON_SYSCONFIGDATA := _sysconfigdata__linux_x86_64-linux-gnu.py
+PYTHON_SYSCONFIGDATA := _sysconfigdata__linux_aarch64-linux-gnu.py
diff -u omd/packages/Python/Python.make omd/packages/Python/Python.make_v2 > ../python-make-set-aarch64-architecture.patch

#### Set system architecture to arm in python build

cp omd/packages/Python/Python.make omd/packages/Python/Python.make_v2
vim omd/packages/Python/Python.make_v2
- $(PACKAGE_PYTHON_PYTHONPATH)/_sysconfigdata__linux_x86_64-linux-gnu.py
+ $(PACKAGE_PYTHON_PYTHONPATH)/_sysconfigdata__linux_arm-linux-gnueabihf.py
- $(PACKAGE_PYTHON_PYTHONPATH)/_sysconfigdata__linux_x86_64-linux-gnu.py
+ $(PACKAGE_PYTHON_PYTHONPATH)/_sysconfigdata__linux_arm-linux-gnueabihf.py
-PYTHON_SYSCONFIGDATA := _sysconfigdata__linux_x86_64-linux-gnu.py
+PYTHON_SYSCONFIGDATA := _sysconfigdata__linux_arm-linux-gnueabihf.py
diff -u omd/packages/Python/Python.make omd/packages/Python/Python.make_v2 > ../python-make-set-arm-architecture.patch

#### Explicitly link against libatomic in protobuf build
Expand All @@ -152,7 +153,7 @@ The following sections show how to download and install the DEB packages availab

cp Pipfile Pipfile_v2
vim Pipfile_v2
-pbr = "==5.4.4" # needed by jira
-pbr = "==5.10.0" # needed by jira
diff -u Pipfile Pipfile_v2 > ../pipfile-remove-pbr.patch

#### Remove playwright from pipfile
Expand Down
3 changes: 1 addition & 2 deletions build_check_mk_debian_32bit.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

CHECKMK_VERSION="2.1.0p15"
CHECKMK_VERSION="2.1.0p21"
SNAP7_VERSION="1.4.2"

if [ $# -gt 0 ]; then
Expand Down Expand Up @@ -32,7 +32,6 @@ cd check-mk-raw-${CHECKMK_VERSION}.cre

# 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
patch -p0 < ../python-make-set-arm-architecture.patch
patch -p0 < ../protobuf-make-add-latomic.patch
Expand Down
2 changes: 1 addition & 1 deletion build_check_mk_ubuntu_64bit.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

CHECKMK_VERSION="2.1.0p15"
CHECKMK_VERSION="2.1.0p21"
NAGIOS_VERSION="3.5.1"
NSCA_VERSION="2.9.1"
PNP4NAGIOS_VERSION="0.6.26"
Expand Down
6 changes: 3 additions & 3 deletions omd-Makefile-remove-module-navicli.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- omd/Makefile 2019-09-23 16:42:27.000000000 +0200
+++ omd/Makefile_v2 2019-09-28 09:43:33.578249056 +0200
@@ -50,7 +50,6 @@
--- omd/Makefile 2023-01-29 01:10:01.000000000 +0000
+++ omd/Makefile_v2 2023-02-11 17:13:36.339664589 +0000
@@ -48,7 +48,6 @@
nsca \
omd \
openhardwaremonitor \
Expand Down
11 changes: 0 additions & 11 deletions omdlib-reduce-certificate-maximum-validity-period.patch

This file was deleted.

11 changes: 5 additions & 6 deletions pipfile-remove-pbr.patch
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
--- Pipfile 2022-08-21 08:56:09.064859847 +0100
+++ Pipfile_v2 2022-08-21 13:30:53.027364237 +0100
@@ -92,7 +92,6 @@
--- Pipfile 2023-01-29 01:10:00.000000000 +0000
+++ Pipfile_v2 2023-02-11 13:49:01.281257851 +0000
@@ -93,7 +93,6 @@
chardet = "==4.0.0" # needed by requests
urllib3 = "==1.26.7" # needed by requests
pyOpenSSL = "==19.1.0" # needed by requests with extras = ["security"]
-pbr = "==5.4.4" # needed by jira
-pbr = "==5.10.0" # needed by jira
pyghmi = "==1.5.13" # needed by base for IPMI
requests = {version = "==2.27.0",extras = ["security"]} # needed by DCD, connexion
requests = {version = "==2.28.1",extras = ["security"]} # needed by DCD, connexion
pykerberos = "==1.2.1" # needed by check_bi_aggr

6 changes: 3 additions & 3 deletions pipfile-remove-playwright.patch
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
--- Pipfile 2022-05-26 01:02:30.000000000 +0100
+++ Pipfile_v2 2022-06-11 19:53:11.919789661 +0100
--- Pipfile 2023-01-29 01:10:00.000000000 +0000
+++ Pipfile_v2 2023-02-11 13:50:02.480665810 +0000
@@ -36,7 +36,6 @@
types-redis = "==4.1.15" # used for type checking
types-protobuf = "==3.19.12" # used for type checking
types-setuptools = "==57.4.9" # used for type checking
-playwright = "==1.19.0" # used for in-browser testing
pydantic-factories = "==1.2.4" # used for pydantic model testing
pymongo = "==4.0.1" # used by mk_mongodb agent plugin
pytest = "==7.0.1" # used by various test/Makefile targets
pytest = "==7.0.1" # used by various test/Makefile targets
26 changes: 11 additions & 15 deletions python-make-set-aarch64-architecture.patch
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
--- omd/packages/Python/Python.make 2022-05-26 01:02:30.000000000 +0100
+++ omd/packages/Python/Python.make_v2 2022-06-10 21:32:19.602657739 +0100
@@ -56,10 +56,10 @@
done
# Native modules built based on this version need to use the correct rpath
sed -i 's|--rpath,/omd/versions/[^/]*/lib|--rpath,$(OMD_ROOT)/lib|g' \
- $(PACKAGE_PYTHON_PYTHONPATH)/_sysconfigdata__linux_x86_64-linux-gnu.py
+ $(PACKAGE_PYTHON_PYTHONPATH)/_sysconfigdata__linux_aarch64-linux-gnu.py
LD_LIBRARY_PATH="$(PACKAGE_PYTHON_LD_LIBRARY_PATH)" \
$(PACKAGE_PYTHON_EXECUTABLE) -m py_compile \
- $(PACKAGE_PYTHON_PYTHONPATH)/_sysconfigdata__linux_x86_64-linux-gnu.py
+ $(PACKAGE_PYTHON_PYTHONPATH)/_sysconfigdata__linux_aarch64-linux-gnu.py
if [ -d "$(PACKAGE_PYTHON_PYTHONPATH)/test" ] ; then \
$(RM) -r $(PACKAGE_PYTHON_PYTHONPATH)/test ; \
fi
--- omd/packages/Python/Python.make 2023-02-11 13:16:52.925978135 +0000
+++ omd/packages/Python/Python.make_v2 2023-02-11 13:23:00.204044150 +0000
@@ -12,7 +12,7 @@
PYTHON_INTERMEDIATE_INSTALL := $(BUILD_HELPER_DIR)/$(PYTHON_DIR)-install-intermediate
PYTHON_CACHE_PKG_PROCESS := $(BUILD_HELPER_DIR)/$(PYTHON_DIR)-cache-pkg-process
PYTHON_INSTALL := $(BUILD_HELPER_DIR)/$(PYTHON_DIR)-install
-PYTHON_SYSCONFIGDATA := _sysconfigdata__linux_x86_64-linux-gnu.py
+PYTHON_SYSCONFIGDATA := _sysconfigdata__linux_aarch64-linux-gnu.py

PYTHON_INSTALL_DIR := $(INTERMEDIATE_INSTALL_BASE)/$(PYTHON_DIR)
PYTHON_BUILD_DIR := $(PACKAGE_BUILD_DIR)/$(PYTHON_DIR)
26 changes: 11 additions & 15 deletions python-make-set-arm-architecture.patch
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
--- omd/packages/Python/Python.make 2022-05-26 01:02:30.000000000 +0100
+++ omd/packages/Python/Python.make_v2 2022-06-10 21:32:48.472505509 +0100
@@ -56,10 +56,10 @@
done
# Native modules built based on this version need to use the correct rpath
sed -i 's|--rpath,/omd/versions/[^/]*/lib|--rpath,$(OMD_ROOT)/lib|g' \
- $(PACKAGE_PYTHON_PYTHONPATH)/_sysconfigdata__linux_x86_64-linux-gnu.py
+ $(PACKAGE_PYTHON_PYTHONPATH)/_sysconfigdata__linux_arm-linux-gnueabihf.py
LD_LIBRARY_PATH="$(PACKAGE_PYTHON_LD_LIBRARY_PATH)" \
$(PACKAGE_PYTHON_EXECUTABLE) -m py_compile \
- $(PACKAGE_PYTHON_PYTHONPATH)/_sysconfigdata__linux_x86_64-linux-gnu.py
+ $(PACKAGE_PYTHON_PYTHONPATH)/_sysconfigdata__linux_arm-linux-gnueabihf.py
if [ -d "$(PACKAGE_PYTHON_PYTHONPATH)/test" ] ; then \
$(RM) -r $(PACKAGE_PYTHON_PYTHONPATH)/test ; \
fi
--- omd/packages/Python/Python.make 2023-02-11 13:16:52.925978135 +0000
+++ omd/packages/Python/Python.make_v2 2023-02-11 13:22:04.134207815 +0000
@@ -12,7 +12,7 @@
PYTHON_INTERMEDIATE_INSTALL := $(BUILD_HELPER_DIR)/$(PYTHON_DIR)-install-intermediate
PYTHON_CACHE_PKG_PROCESS := $(BUILD_HELPER_DIR)/$(PYTHON_DIR)-cache-pkg-process
PYTHON_INSTALL := $(BUILD_HELPER_DIR)/$(PYTHON_DIR)-install
-PYTHON_SYSCONFIGDATA := _sysconfigdata__linux_x86_64-linux-gnu.py
+PYTHON_SYSCONFIGDATA := _sysconfigdata__linux_arm-linux-gnueabihf.py

PYTHON_INSTALL_DIR := $(INTERMEDIATE_INSTALL_BASE)/$(PYTHON_DIR)
PYTHON_BUILD_DIR := $(PACKAGE_BUILD_DIR)/$(PYTHON_DIR)

0 comments on commit ba6e36a

Please sign in to comment.