From e1a4f625c130cc14503a1ebd4ae161f35bf3e001 Mon Sep 17 00:00:00 2001 From: Viorel-Cosmin Miron Date: Sun, 3 Sep 2023 00:20:53 +0200 Subject: [PATCH 01/19] Update build_and_push.sh --- build_and_push.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_and_push.sh b/build_and_push.sh index 0e95ec6..c8b6270 100755 --- a/build_and_push.sh +++ b/build_and_push.sh @@ -1,7 +1,7 @@ #!/bin/sh MY_IMAGE_NAME="caprover/netdata" -NETDATA_VERSION="v1.34.1" +NETDATA_VERSION="v1.42.2" # ensure you're not running it on local machine if [ -z "$CI" ] || [ -z "$GITHUB_REF" ]; then From 41ca01a192a39005b639fb5b87894172bb33f7d9 Mon Sep 17 00:00:00 2001 From: Cosmic Sound Date: Sun, 3 Sep 2023 00:55:43 +0200 Subject: [PATCH 02/19] Fixed debian release --- Dockerfile | 2 +- scripts/build.sh | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 61eace1..47e114a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:stretch +FROM debian:buster ADD git-tag /git-tag diff --git a/scripts/build.sh b/scripts/build.sh index 4876b29..25c96b3 100644 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -4,16 +4,15 @@ DEBIAN_FRONTEND=noninteractive # some mirrors have issues, i skipped httpredir in favor of an eu mirror -echo "deb http://ftp.nl.debian.org/debian/ stretch main" > /etc/apt/sources.list -echo "deb http://security.debian.org/debian-security stretch/updates main" >> /etc/apt/sources.list +echo "deb http://ftp.nl.debian.org/debian/ buster main" > /etc/apt/sources.list +echo "deb http://security.debian.org/debian-security buster/updates main" >> /etc/apt/sources.list # install dependencies for build # source: https://learn.netdata.cloud/docs/agent/packaging/installer/methods/manual apt-get -qq update -apt-get -y install zlib1g-dev uuid-dev libmnl-dev gcc make curl git autoconf autogen automake pkg-config netcat-openbsd jq libuv1-dev liblz4-dev libjudy-dev libssl-dev cmake libelf-dev libprotobuf-dev protobuf-compiler g++ -apt-get -y install autoconf-archive lm-sensors nodejs python python-mysqldb python-yaml libjudydebian1 libuv1 liblz4-1 openssl -apt-get -y install msmtp msmtp-mta apcupsd fping +apt-get -y install zlib1g-dev uuid-dev libuv1-dev liblz4-dev libssl-dev libelf-dev libmnl-dev libprotobuf-dev protobuf-compiler gcc g++ make git autoconf autoconf-archive autogen automake pkg-config curl python cmake netcat-openbsd jq lm-sensors nodejs python-mysqldb python-yaml libjudydebian1 libuv1 liblz4-1 openssl msmtp msmtp-mta apcupsd fping +apt-get clean # fetch netdata From 7c9e14721af1d485e32d2800da00db98e3cd3370 Mon Sep 17 00:00:00 2001 From: Viorel-Cosmin Miron Date: Sun, 3 Sep 2023 01:25:41 +0200 Subject: [PATCH 03/19] Update build.sh --- scripts/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build.sh b/scripts/build.sh index 25c96b3..8e9998e 100644 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -11,7 +11,7 @@ echo "deb http://security.debian.org/debian-security buster/updates main" >> /et # source: https://learn.netdata.cloud/docs/agent/packaging/installer/methods/manual apt-get -qq update -apt-get -y install zlib1g-dev uuid-dev libuv1-dev liblz4-dev libssl-dev libelf-dev libmnl-dev libprotobuf-dev protobuf-compiler gcc g++ make git autoconf autoconf-archive autogen automake pkg-config curl python cmake netcat-openbsd jq lm-sensors nodejs python-mysqldb python-yaml libjudydebian1 libuv1 liblz4-1 openssl msmtp msmtp-mta apcupsd fping +apt-get -y install zlib1g-dev uuid-dev libuv1-dev liblz4-dev libssl-dev libyaml-dev libelf-dev libmnl-dev libprotobuf-dev protobuf-compiler gcc g++ make git autoconf autoconf-archive autogen automake pkg-config curl python cmake netcat-openbsd jq lm-sensors nodejs python-mysqldb python-yaml libjudydebian1 libuv1 liblz4-1 openssl msmtp msmtp-mta apcupsd fping apt-get clean # fetch netdata From 84a6560cef099f94e85ed18852fcbb633176fb9c Mon Sep 17 00:00:00 2001 From: Cosmic Sound Date: Sun, 3 Sep 2023 11:55:26 +0200 Subject: [PATCH 04/19] Fixed docker path --- README.md | 2 +- build_and_push.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bf8b7fb..f9e628b 100644 --- a/README.md +++ b/README.md @@ -2,4 +2,4 @@ Just a think wrapper for NetData that enables the user to use env vars for parameter setting. Based on https://github.com/titpetric/netdata with the exception that this is built as an multiarch image -See https://hub.docker.com/r/caprover/netdata +See https://hub.docker.com/r/uhlhosting/netdata diff --git a/build_and_push.sh b/build_and_push.sh index c8b6270..d9030f5 100755 --- a/build_and_push.sh +++ b/build_and_push.sh @@ -1,6 +1,6 @@ #!/bin/sh -MY_IMAGE_NAME="caprover/netdata" +MY_IMAGE_NAME="uhlhosting/netdata" NETDATA_VERSION="v1.42.2" # ensure you're not running it on local machine From 206754792e0460a2c1eeddaad31b097179d7f203 Mon Sep 17 00:00:00 2001 From: Cosmic Sound Date: Sun, 3 Sep 2023 11:57:42 +0200 Subject: [PATCH 05/19] Fixes --- scripts/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index 8e9998e..0c57ce3 100644 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -10,8 +10,8 @@ echo "deb http://security.debian.org/debian-security buster/updates main" >> /et # install dependencies for build # source: https://learn.netdata.cloud/docs/agent/packaging/installer/methods/manual -apt-get -qq update -apt-get -y install zlib1g-dev uuid-dev libuv1-dev liblz4-dev libssl-dev libyaml-dev libelf-dev libmnl-dev libprotobuf-dev protobuf-compiler gcc g++ make git autoconf autoconf-archive autogen automake pkg-config curl python cmake netcat-openbsd jq lm-sensors nodejs python-mysqldb python-yaml libjudydebian1 libuv1 liblz4-1 openssl msmtp msmtp-mta apcupsd fping +apt-get -qq update && \ +apt-get -y install zlib1g-dev uuid-dev libuv1-dev liblz4-dev libssl-dev libyaml-dev libelf-dev libmnl-dev libprotobuf-dev protobuf-compiler gcc g++ make git autoconf autoconf-archive autogen automake pkg-config curl python cmake netcat-openbsd jq lm-sensors nodejs python-mysqldb python-yaml libjudydebian1 libuv1 liblz4-1 openssl msmtp msmtp-mta apcupsd fping && \ apt-get clean # fetch netdata From 4739eec6042963eeb4b32c91d5e8a2204f2571c2 Mon Sep 17 00:00:00 2001 From: Cosmic Sound Date: Sun, 3 Sep 2023 14:26:47 +0200 Subject: [PATCH 06/19] Fixes that works against build - tested --- Dockerfile | 2 +- build_and_push.sh | 2 +- scripts/build.sh | 16 ++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 47e114a..fc2de6d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:buster +FROM debian:bullseye ADD git-tag /git-tag diff --git a/build_and_push.sh b/build_and_push.sh index d9030f5..c8b6270 100755 --- a/build_and_push.sh +++ b/build_and_push.sh @@ -1,6 +1,6 @@ #!/bin/sh -MY_IMAGE_NAME="uhlhosting/netdata" +MY_IMAGE_NAME="caprover/netdata" NETDATA_VERSION="v1.42.2" # ensure you're not running it on local machine diff --git a/scripts/build.sh b/scripts/build.sh index 0c57ce3..552e547 100644 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -4,19 +4,19 @@ DEBIAN_FRONTEND=noninteractive # some mirrors have issues, i skipped httpredir in favor of an eu mirror -echo "deb http://ftp.nl.debian.org/debian/ buster main" > /etc/apt/sources.list -echo "deb http://security.debian.org/debian-security buster/updates main" >> /etc/apt/sources.list +echo "deb http://deb.debian.org/debian/ bullseye main" > /etc/apt/sources.list +echo "deb http://security.debian.org/debian-security bullseye-security main" >> /etc/apt/sources.list # install dependencies for build # source: https://learn.netdata.cloud/docs/agent/packaging/installer/methods/manual -apt-get -qq update && \ -apt-get -y install zlib1g-dev uuid-dev libuv1-dev liblz4-dev libssl-dev libyaml-dev libelf-dev libmnl-dev libprotobuf-dev protobuf-compiler gcc g++ make git autoconf autoconf-archive autogen automake pkg-config curl python cmake netcat-openbsd jq lm-sensors nodejs python-mysqldb python-yaml libjudydebian1 libuv1 liblz4-1 openssl msmtp msmtp-mta apcupsd fping && \ -apt-get clean +apt-get -qq update +apt-get -y install apcupsd autoconf autoconf-archive autogen automake cmake curl fping g++ gcc git jq libelf-dev libjudy-dev libjudydebian1 liblz4-1 liblz4-dev libmnl-dev libprotobuf-dev libssl-dev libuv1 libuv1-dev libyaml-dev lm-sensors make msmtp msmtp-mta netcat-openbsd nodejs openssl pkg-config protobuf-compiler python3-yaml python3-mysqldb openssl python3 uuid-dev zlib1g-dev # fetch netdata +git config --global advice.detachedHead false -git clone https://github.com/firehol/netdata.git /netdata.git +git clone https://github.com/netdata/netdata.git /netdata.git cd /netdata.git TAG=$( Date: Sun, 3 Sep 2023 14:31:05 +0200 Subject: [PATCH 07/19] Fixed README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f9e628b..bf8b7fb 100644 --- a/README.md +++ b/README.md @@ -2,4 +2,4 @@ Just a think wrapper for NetData that enables the user to use env vars for parameter setting. Based on https://github.com/titpetric/netdata with the exception that this is built as an multiarch image -See https://hub.docker.com/r/uhlhosting/netdata +See https://hub.docker.com/r/caprover/netdata From f6e06106272b31b1c7a059c4111449a08582ec93 Mon Sep 17 00:00:00 2001 From: Cosmic Sound Date: Sun, 3 Sep 2023 14:33:45 +0200 Subject: [PATCH 08/19] Added auto-clean --- scripts/build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/build.sh b/scripts/build.sh index 552e547..8049590 100644 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -12,6 +12,7 @@ echo "deb http://security.debian.org/debian-security bullseye-security main" >> apt-get -qq update apt-get -y install apcupsd autoconf autoconf-archive autogen automake cmake curl fping g++ gcc git jq libelf-dev libjudy-dev libjudydebian1 liblz4-1 liblz4-dev libmnl-dev libprotobuf-dev libssl-dev libuv1 libuv1-dev libyaml-dev lm-sensors make msmtp msmtp-mta netcat-openbsd nodejs openssl pkg-config protobuf-compiler python3-yaml python3-mysqldb openssl python3 uuid-dev zlib1g-dev +apt-get auto-clean -y # fetch netdata git config --global advice.detachedHead false From 5fe1e735989333632a99aa8bb438a932953dfc44 Mon Sep 17 00:00:00 2001 From: Cosmic Sound Date: Sun, 3 Sep 2023 14:36:02 +0200 Subject: [PATCH 09/19] Added bullseye --- scripts/build.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index 8049590..aad8839 100644 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -2,7 +2,7 @@ set -e DEBIAN_FRONTEND=noninteractive -# some mirrors have issues, i skipped httpredir in favor of an eu mirror +# some mirrors have issues, i skipped httpredir in favor of an eu mirror, moved to bullseye echo "deb http://deb.debian.org/debian/ bullseye main" > /etc/apt/sources.list echo "deb http://security.debian.org/debian-security bullseye-security main" >> /etc/apt/sources.list @@ -12,11 +12,13 @@ echo "deb http://security.debian.org/debian-security bullseye-security main" >> apt-get -qq update apt-get -y install apcupsd autoconf autoconf-archive autogen automake cmake curl fping g++ gcc git jq libelf-dev libjudy-dev libjudydebian1 liblz4-1 liblz4-dev libmnl-dev libprotobuf-dev libssl-dev libuv1 libuv1-dev libyaml-dev lm-sensors make msmtp msmtp-mta netcat-openbsd nodejs openssl pkg-config protobuf-compiler python3-yaml python3-mysqldb openssl python3 uuid-dev zlib1g-dev -apt-get auto-clean -y -# fetch netdata +# fix the extra warning when building netdata + git config --global advice.detachedHead false +# fetch netdata + git clone https://github.com/netdata/netdata.git /netdata.git cd /netdata.git TAG=$( Date: Sun, 3 Sep 2023 15:16:06 +0200 Subject: [PATCH 10/19] Fixed packaged deps --- scripts/build.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index aad8839..650818d 100644 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -10,8 +10,9 @@ echo "deb http://security.debian.org/debian-security bullseye-security main" >> # install dependencies for build # source: https://learn.netdata.cloud/docs/agent/packaging/installer/methods/manual -apt-get -qq update -apt-get -y install apcupsd autoconf autoconf-archive autogen automake cmake curl fping g++ gcc git jq libelf-dev libjudy-dev libjudydebian1 liblz4-1 liblz4-dev libmnl-dev libprotobuf-dev libssl-dev libuv1 libuv1-dev libyaml-dev lm-sensors make msmtp msmtp-mta netcat-openbsd nodejs openssl pkg-config protobuf-compiler python3-yaml python3-mysqldb openssl python3 uuid-dev zlib1g-dev +apt-get -qq update && \ +apt-get -y install apcupsd autoconf autoconf-archive autogen automake bash cmake curl fping g++ gcc git iproute2 jq libelf-dev libelf1 libjudy-dev libjudydebian1 liblz4-1 liblz4-dev libmnl-dev libprotobuf-dev libssl-dev libuuid libuv1 libuv1-dev libyaml-dev lm-sensors make msmtp msmtp-mta netcat-openbsd nodejs openssl pkg-config protobuf-compiler python python-mysqldb python-yaml python3 python3-mysqldb python3-yaml util-linux uuid-dev zlib zlib1g-dev && \ +apt-get clean -y # fix the extra warning when building netdata @@ -43,7 +44,7 @@ git submodule update --init --recursive cd / rm -rf /netdata.git -dpkg -P zlib1g-dev uuid-dev libmnl-dev libyaml-dev make git autoconf autogen automake pkg-config libuv1-dev liblz4-dev libjudy-dev libssl-dev cmake libelf-dev libprotobuf-dev protobuf-compiler g++ +dpkg -P zlib1g-dev uuid-dev libmnl-dev libyaml-dev make git autoconf autogen automake pkg-config libuv1-dev liblz4-dev libjudy-dev libssl-dev cmake libelf-dev iproute2 libprotobuf-dev protobuf-compiler g++ apt-get -y autoremove apt-get clean rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* From 95ce7094c0395866045b3de2402a0563963eb0c7 Mon Sep 17 00:00:00 2001 From: Cosmic Sound Date: Sun, 3 Sep 2023 15:20:07 +0200 Subject: [PATCH 11/19] updated dpkg -P --- scripts/build.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index 650818d..d8850c2 100644 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -38,18 +38,17 @@ git submodule update --init --recursive ./netdata-installer.sh --dont-wait --dont-start-it --disable-telemetry - # remove build dependencies cd / rm -rf /netdata.git -dpkg -P zlib1g-dev uuid-dev libmnl-dev libyaml-dev make git autoconf autogen automake pkg-config libuv1-dev liblz4-dev libjudy-dev libssl-dev cmake libelf-dev iproute2 libprotobuf-dev protobuf-compiler g++ +dpkg -P autoconf autogen automake bash cmake curl g++ git iproute2 libelf-dev libjudy-dev liblz4-dev libmnl-dev libprotobuf-dev libssl-dev libuuid libuv1-dev libyaml-dev lm-sensors make netcat-openbsd nodejs openssl pkg-config protobuf-compiler python3 python3-mysqldb python3-yaml uuid-dev zlib1g-dev + apt-get -y autoremove apt-get clean rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - # symlink access log and error log to stdout/stderr ln -sf /dev/stdout /var/log/netdata/access.log From e5d3d0ed024b1aaa92aa388aa1cc9903cc6e9899 Mon Sep 17 00:00:00 2001 From: Cosmic Sound Date: Sun, 3 Sep 2023 15:22:00 +0200 Subject: [PATCH 12/19] Fixed Python pkgs --- scripts/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build.sh b/scripts/build.sh index d8850c2..6b79f83 100644 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -11,7 +11,7 @@ echo "deb http://security.debian.org/debian-security bullseye-security main" >> # source: https://learn.netdata.cloud/docs/agent/packaging/installer/methods/manual apt-get -qq update && \ -apt-get -y install apcupsd autoconf autoconf-archive autogen automake bash cmake curl fping g++ gcc git iproute2 jq libelf-dev libelf1 libjudy-dev libjudydebian1 liblz4-1 liblz4-dev libmnl-dev libprotobuf-dev libssl-dev libuuid libuv1 libuv1-dev libyaml-dev lm-sensors make msmtp msmtp-mta netcat-openbsd nodejs openssl pkg-config protobuf-compiler python python-mysqldb python-yaml python3 python3-mysqldb python3-yaml util-linux uuid-dev zlib zlib1g-dev && \ +apt-get -y install apcupsd autoconf autoconf-archive autogen automake bash cmake curl fping g++ gcc git iproute2 jq libelf-dev libelf1 libjudy-dev libjudydebian1 liblz4-1 liblz4-dev libmnl-dev libprotobuf-dev libssl-dev libuuid libuv1 libuv1-dev libyaml-dev lm-sensors make msmtp msmtp-mta netcat-openbsd nodejs openssl pkg-config protobuf-compiler python3 python3-mysqldb python3-yaml util-linux uuid-dev zlib zlib1g-dev && \ apt-get clean -y # fix the extra warning when building netdata From 110ad1778c84c07172dfa29499412df463b68a06 Mon Sep 17 00:00:00 2001 From: Cosmic Sound Date: Sun, 3 Sep 2023 18:44:09 +0200 Subject: [PATCH 13/19] Latest working build --- Dockerfile | 2 +- build_and_push.sh | 4 ++-- scripts/build.sh | 20 ++++++++------------ 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index fc2de6d..4336c82 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:bullseye +FROM debian:bookworm ADD git-tag /git-tag diff --git a/build_and_push.sh b/build_and_push.sh index c8b6270..cb9f302 100755 --- a/build_and_push.sh +++ b/build_and_push.sh @@ -22,5 +22,5 @@ docker buildx ls docker buildx create --name mybuilder docker buildx use mybuilder -# REMOVED linux/arm64 as debie:jessie isn't built for linux/arm64 -docker buildx build --platform linux/amd64,linux/arm,linux/arm64,linux/386 -t $MY_IMAGE_NAME:latest -t $MY_IMAGE_NAME:$NETDATA_VERSION --push . +# REMOVED linux/arm, and all 32 bit. Just focus on x86_64 +docker buildx build --platform linux/amd64,linux/arm64 -t $MY_IMAGE_NAME:latest -t $MY_IMAGE_NAME:$NETDATA_VERSION --push . diff --git a/scripts/build.sh b/scripts/build.sh index 6b79f83..6a805a2 100644 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -2,21 +2,17 @@ set -e DEBIAN_FRONTEND=noninteractive -# some mirrors have issues, i skipped httpredir in favor of an eu mirror, moved to bullseye +# some mirrors have issues, i skipped httpredir in favor of an eu mirror, moved to bookworm, and they cause duplicates only. -echo "deb http://deb.debian.org/debian/ bullseye main" > /etc/apt/sources.list -echo "deb http://security.debian.org/debian-security bullseye-security main" >> /etc/apt/sources.list +# echo "deb http://deb.debian.org/debian/ bookworm main" > /etc/apt/sources.list +# echo "deb http://security.debian.org/debian-security bookworm-security main" >> /etc/apt/sources.list # install dependencies for build # source: https://learn.netdata.cloud/docs/agent/packaging/installer/methods/manual -apt-get -qq update && \ -apt-get -y install apcupsd autoconf autoconf-archive autogen automake bash cmake curl fping g++ gcc git iproute2 jq libelf-dev libelf1 libjudy-dev libjudydebian1 liblz4-1 liblz4-dev libmnl-dev libprotobuf-dev libssl-dev libuuid libuv1 libuv1-dev libyaml-dev lm-sensors make msmtp msmtp-mta netcat-openbsd nodejs openssl pkg-config protobuf-compiler python3 python3-mysqldb python3-yaml util-linux uuid-dev zlib zlib1g-dev && \ -apt-get clean -y - -# fix the extra warning when building netdata - -git config --global advice.detachedHead false +apt-get update -qq && \ +apt-get install -y ca-certificates git-man netcat-openbsd krb5-locales less libbrotli1 libbsd0 libcbor0.8 libcurl3-gnutls libcurl4 libedit2 liberror-perl libexpat1 libfido2-1 libgdbm-compat4 libgdbm6 libgssapi-krb5-2 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libldap-2.5-0 libldap-common libnghttp2-14 libperl5.36 libpsl5 librtmp1 libsasl2-2 libsasl2-modules libsasl2-modules-db libssh2-1 libssl3 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxext6 libxmuu1 netbase openssh-client openssl patch nodejs perl perl-modules-5.36 publicsuffix xauth && \ +apt-get install -y autoconf autoconf-archive autogen automake cmake curl g++ gcc git gzip libatomic1 libuuid1 libelf-dev libjson-c-dev libjudy-dev liblz4-dev libmnl-dev libssl-dev libsystemd-dev libuv1-dev libyaml-dev lm-sensors make pkg-config python3 python3-mysqldb python3-yaml tar uuid-dev zlib1g-dev libprotobuf-dev protobuf-compiler # fetch netdata @@ -43,7 +39,7 @@ git submodule update --init --recursive cd / rm -rf /netdata.git -dpkg -P autoconf autogen automake bash cmake curl g++ git iproute2 libelf-dev libjudy-dev liblz4-dev libmnl-dev libprotobuf-dev libssl-dev libuuid libuv1-dev libyaml-dev lm-sensors make netcat-openbsd nodejs openssl pkg-config protobuf-compiler python3 python3-mysqldb python3-yaml uuid-dev zlib1g-dev +dpkg -P iproute2 libelf-dev libjudy-dev liblz4-dev libmnl-dev libprotobuf-dev libssl-dev libuv1-dev libyaml-dev lm-sensors make netcat-openbsd pkg-config protobuf-compiler python3-mysqldb python3-yaml uuid-dev zlib1g-dev apt-get -y autoremove apt-get clean @@ -53,4 +49,4 @@ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ln -sf /dev/stdout /var/log/netdata/access.log ln -sf /dev/stdout /var/log/netdata/debug.log -ln -sf /dev/stderr /var/log/netdata/error.log +ln -sf /dev/stderr /var/log/netdata/error.log \ No newline at end of file From 7906c949f5b51f7e6f0085e8720325769aa06608 Mon Sep 17 00:00:00 2001 From: Cosmic Sound Date: Sun, 3 Sep 2023 18:59:02 +0200 Subject: [PATCH 14/19] Added missing msmtp --- scripts/build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/build.sh b/scripts/build.sh index 6a805a2..ccd41b6 100644 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -12,7 +12,8 @@ DEBIAN_FRONTEND=noninteractive apt-get update -qq && \ apt-get install -y ca-certificates git-man netcat-openbsd krb5-locales less libbrotli1 libbsd0 libcbor0.8 libcurl3-gnutls libcurl4 libedit2 liberror-perl libexpat1 libfido2-1 libgdbm-compat4 libgdbm6 libgssapi-krb5-2 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libldap-2.5-0 libldap-common libnghttp2-14 libperl5.36 libpsl5 librtmp1 libsasl2-2 libsasl2-modules libsasl2-modules-db libssh2-1 libssl3 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxext6 libxmuu1 netbase openssh-client openssl patch nodejs perl perl-modules-5.36 publicsuffix xauth && \ -apt-get install -y autoconf autoconf-archive autogen automake cmake curl g++ gcc git gzip libatomic1 libuuid1 libelf-dev libjson-c-dev libjudy-dev liblz4-dev libmnl-dev libssl-dev libsystemd-dev libuv1-dev libyaml-dev lm-sensors make pkg-config python3 python3-mysqldb python3-yaml tar uuid-dev zlib1g-dev libprotobuf-dev protobuf-compiler +apt-get install -y autoconf autoconf-archive autogen automake cmake curl g++ gcc git gzip libatomic1 libuuid1 libelf-dev libjson-c-dev libjudy-dev liblz4-dev libmnl-dev libssl-dev libsystemd-dev libuv1-dev libyaml-dev lm-sensors make pkg-config python3 python3-mysqldb python3-yaml tar uuid-dev zlib1g-dev libprotobuf-dev protobuf-compiler && \ +apt-get install -y msmtp msmtp-mta apcupsd fping # fetch netdata From cfbadcc0ff31dc171611e045fb349b48c88bac9e Mon Sep 17 00:00:00 2001 From: Cosmic Sound Date: Sun, 3 Sep 2023 19:00:23 +0200 Subject: [PATCH 15/19] Comments --- scripts/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build.sh b/scripts/build.sh index ccd41b6..254383a 100644 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -15,7 +15,7 @@ apt-get install -y ca-certificates git-man netcat-openbsd krb5-locales less libb apt-get install -y autoconf autoconf-archive autogen automake cmake curl g++ gcc git gzip libatomic1 libuuid1 libelf-dev libjson-c-dev libjudy-dev liblz4-dev libmnl-dev libssl-dev libsystemd-dev libuv1-dev libyaml-dev lm-sensors make pkg-config python3 python3-mysqldb python3-yaml tar uuid-dev zlib1g-dev libprotobuf-dev protobuf-compiler && \ apt-get install -y msmtp msmtp-mta apcupsd fping -# fetch netdata +# fetch netdata & replaced firehol obsoleted by netdata git clone https://github.com/netdata/netdata.git /netdata.git cd /netdata.git From ab2040085a370861109e54aac53c856015ba316a Mon Sep 17 00:00:00 2001 From: Cosmic Sound Date: Sun, 3 Sep 2023 19:01:07 +0200 Subject: [PATCH 16/19] Allow all builds back --- build_and_push.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_and_push.sh b/build_and_push.sh index cb9f302..dc457ef 100755 --- a/build_and_push.sh +++ b/build_and_push.sh @@ -23,4 +23,4 @@ docker buildx create --name mybuilder docker buildx use mybuilder # REMOVED linux/arm, and all 32 bit. Just focus on x86_64 -docker buildx build --platform linux/amd64,linux/arm64 -t $MY_IMAGE_NAME:latest -t $MY_IMAGE_NAME:$NETDATA_VERSION --push . +docker buildx build --platform linux/amd64,linux/arm,linux/arm64,linux/386 -t $MY_IMAGE_NAME:latest -t $MY_IMAGE_NAME:$NETDATA_VERSION --push . \ No newline at end of file From 80421d53f8add4f86e1113e3967dad3a7449dbdb Mon Sep 17 00:00:00 2001 From: Cosmic Sound Date: Sun, 3 Sep 2023 19:49:41 +0200 Subject: [PATCH 17/19] Add missing variables --- scripts/run.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/scripts/run.sh b/scripts/run.sh index 940d4d0..e6b18d3 100644 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -47,6 +47,11 @@ if [[ $SLACK_CHANNEL ]]; then sed -i -e "s@DEFAULT_RECIPIENT_SLACK=\"\"@DEFAULT_RECIPIENT_SLACK=\"${SLACK_CHANNEL}\"@" /etc/netdata/health_alarm_notify.conf fi +# Add this part for the SEND_SLACK="YES" +if [[ $SLACK_WEBHOOK_URL && $SLACK_CHANNEL ]]; then + sed -i -e "s@SEND_SLACK=\"NO\"@SEND_SLACK=\"YES\"@" /etc/netdata/health_alarm_notify.conf +fi + if [[ $DISCORD_WEBHOOK_URL ]]; then sed -i -e "s@DISCORD_WEBHOOK_URL=\"\"@DISCORD_WEBHOOK_URL=\"${DISCORD_WEBHOOK_URL}\"@" /etc/netdata/health_alarm_notify.conf fi @@ -54,7 +59,12 @@ fi if [[ $DISCORD_RECIPIENT ]]; then sed -i -e "s@DEFAULT_RECIPIENT_DISCORD=\"\"@DEFAULT_RECIPIENT_DISCORD=\"${DISCORD_RECIPIENT}\"@" /etc/netdata/health_alarm_notify.conf fi +# Add this part for the SEND_DISCORD="YES" +if [[ $DISCORD_WEBHOOK_URL && $DISCORD_RECIPIENT ]]; then + sed -i -e "s@SEND_DISCORD=\"NO\"@SEND_DISCORD=\"YES\"@" /etc/netdata/health_alarm_notify.conf +fi +# For Telegram if [[ $TELEGRAM_BOT_TOKEN ]]; then sed -i -e "s@TELEGRAM_BOT_TOKEN=\"\"@TELEGRAM_BOT_TOKEN=\"${TELEGRAM_BOT_TOKEN}\"@" /etc/netdata/health_alarm_notify.conf fi @@ -63,6 +73,12 @@ if [[ $TELEGRAM_CHAT_ID ]]; then sed -i -e "s@DEFAULT_RECIPIENT_TELEGRAM=\"\"@DEFAULT_RECIPIENT_TELEGRAM=\"${TELEGRAM_CHAT_ID}\"@" /etc/netdata/health_alarm_notify.conf fi +# Add this part for the SEND_TELEGRAM="YES" +if [[ $TELEGRAM_BOT_TOKEN && $TELEGRAM_CHAT_ID ]]; then + sed -i -e "s@SEND_TELEGRAM=\"NO\"@SEND_TELEGRAM=\"YES\"@" /etc/netdata/health_alarm_notify.conf +fi + +# For PushBullet if [[ $PUSHBULLET_ACCESS_TOKEN ]]; then sed -i -e "s@PUSHBULLET_ACCESS_TOKEN=\"\"@PUSHBULLET_ACCESS_TOKEN=\"${PUSHBULLET_ACCESS_TOKEN}\"@" /etc/netdata/health_alarm_notify.conf fi @@ -71,6 +87,11 @@ if [[ $PUSHBULLET_DEFAULT_EMAIL ]]; then sed -i -e "s#DEFAULT_RECIPIENT_PUSHBULLET=\"\"#DEFAULT_RECIPIENT_PUSHBULLET=\"${PUSHBULLET_DEFAULT_EMAIL}\"#" /etc/netdata/health_alarm_notify.conf fi +# Add this part for the SEND_PUSHBULLET="YES" +if [[ $PUSHBULLET_ACCESS_TOKEN && $PUSHBULLET_DEFAULT_EMAIL ]]; then + sed -i -e "s@SEND_PUSHBULLET=\"NO\"@SEND_PUSHBULLET=\"YES\"@" /etc/netdata/health_alarm_notify.conf +fi + if [[ $NETDATA_IP ]]; then NETDATA_ARGS="${NETDATA_ARGS} -i ${NETDATA_IP}" fi From 033c8290bf8eb8a8398dd609a4c033581d611b6e Mon Sep 17 00:00:00 2001 From: Cosmic Sound Date: Sun, 3 Sep 2023 20:02:21 +0200 Subject: [PATCH 18/19] Added missing smtp vars --- scripts/run.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/run.sh b/scripts/run.sh index e6b18d3..4dceb89 100644 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -39,6 +39,21 @@ fi # copy conf from NETDATA_STOCK_CONFIG_DIR (normally under /usr/lib/netdata/conf.d) to NETDATA_USER_CONFIG_DIR (normally under /etc/netdata) cp /usr/lib/netdata/conf.d/health_alarm_notify.conf /etc/netdata +# For EMAIL_SENDER, assuming the value comes from netDataInfo.data.smtp.sender +if [[ $SMTP_SENDER ]]; then + sed -i -e "s@EMAIL_SENDER=\"\"@EMAIL_SENDER=\"${SMTP_SENDER}\"@" /etc/netdata/health_alarm_notify.conf +fi + +# For DEFAULT_RECIPIENT_EMAIL, assuming the value comes from netDataInfo.data.smtp.to +if [[ $SMTP_TO ]]; then + sed -i -e "s@DEFAULT_RECIPIENT_EMAIL=\"\"@DEFAULT_RECIPIENT_EMAIL=\"${SMTP_TO}\"@" /etc/netdata/health_alarm_notify.conf +fi + +# For enabling email, set SEND_EMAIL to YES if both SMTP_SENDER and SMTP_TO are set +if [[ $SMTP_SENDER && $SMTP_TO ]]; then + sed -i -e "s@SEND_EMAIL=\"NO\"@SEND_EMAIL=\"YES\"@" /etc/netdata/health_alarm_notify.conf +fi + if [[ $SLACK_WEBHOOK_URL ]]; then sed -i -e "s@SLACK_WEBHOOK_URL=\"\"@SLACK_WEBHOOK_URL=\"${SLACK_WEBHOOK_URL}\"@" /etc/netdata/health_alarm_notify.conf fi From d60d64e014838a15b99544255c75a5883d713866 Mon Sep 17 00:00:00 2001 From: Cosmic Sound Date: Sun, 3 Sep 2023 20:18:08 +0200 Subject: [PATCH 19/19] Commented discord --- scripts/run.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/run.sh b/scripts/run.sh index 4dceb89..d75c657 100644 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -67,17 +67,17 @@ if [[ $SLACK_WEBHOOK_URL && $SLACK_CHANNEL ]]; then sed -i -e "s@SEND_SLACK=\"NO\"@SEND_SLACK=\"YES\"@" /etc/netdata/health_alarm_notify.conf fi -if [[ $DISCORD_WEBHOOK_URL ]]; then - sed -i -e "s@DISCORD_WEBHOOK_URL=\"\"@DISCORD_WEBHOOK_URL=\"${DISCORD_WEBHOOK_URL}\"@" /etc/netdata/health_alarm_notify.conf -fi - -if [[ $DISCORD_RECIPIENT ]]; then - sed -i -e "s@DEFAULT_RECIPIENT_DISCORD=\"\"@DEFAULT_RECIPIENT_DISCORD=\"${DISCORD_RECIPIENT}\"@" /etc/netdata/health_alarm_notify.conf -fi -# Add this part for the SEND_DISCORD="YES" -if [[ $DISCORD_WEBHOOK_URL && $DISCORD_RECIPIENT ]]; then - sed -i -e "s@SEND_DISCORD=\"NO\"@SEND_DISCORD=\"YES\"@" /etc/netdata/health_alarm_notify.conf -fi +# if [[ $DISCORD_WEBHOOK_URL ]]; then +# sed -i -e "s@DISCORD_WEBHOOK_URL=\"\"@DISCORD_WEBHOOK_URL=\"${DISCORD_WEBHOOK_URL}\"@" /etc/netdata/health_alarm_notify.conf +# fi + +# if [[ $DISCORD_RECIPIENT ]]; then +# sed -i -e "s@DEFAULT_RECIPIENT_DISCORD=\"\"@DEFAULT_RECIPIENT_DISCORD=\"${DISCORD_RECIPIENT}\"@" /etc/netdata/health_alarm_notify.conf +# fi +# # Add this part for the SEND_DISCORD="YES" +# if [[ $DISCORD_WEBHOOK_URL && $DISCORD_RECIPIENT ]]; then +# sed -i -e "s@SEND_DISCORD=\"NO\"@SEND_DISCORD=\"YES\"@" /etc/netdata/health_alarm_notify.conf +# fi # For Telegram if [[ $TELEGRAM_BOT_TOKEN ]]; then