These are reworked patches on top of [master] that modify the [go] package to be downloaded for all supported architectures and introduce the new package [node_exporter], which requires [go] during compilation.
node_exporter generally provides a number of runtime related metrics through a lightweight HTTP plain text interface that can be scraped by time series databases in regular interval. These metrics can then be used in grapical UIs for monitoring, analyzation and alerting. It is of use for users already monitoring their machines this way and just are about to add their ipfire nodes into the monitoring stack.
These patches replace my previous patches from 06/05/2021 21:46: "[PATCH 0/2] Added new Package node_exporter", "[PATCH 1/2] Added i586/386 support for GO language required for node_exporter.", "[PATCH 2/2] Added new node_exporter package."
Holger Sunke (2): Added x86_64 i586 aarch64 armv5tel support for GO language required for node_exporter compilation. Added new node_exporter package.
config/node_exporter/node_exporter_options | 203 +++++++++++++++++++++ config/rootfiles/packages/node_exporter | 3 + lfs/Config | 8 + lfs/go | 9 +- lfs/node_exporter | 94 ++++++++++ make.sh | 1 + src/initscripts/packages/node_exporter | 42 +++++ src/paks/node_exporter/install.sh | 31 ++++ src/paks/node_exporter/uninstall.sh | 30 +++ src/paks/node_exporter/update.sh | 27 +++ 10 files changed, 445 insertions(+), 3 deletions(-) create mode 100644 config/node_exporter/node_exporter_options create mode 100644 config/rootfiles/packages/node_exporter create mode 100644 lfs/node_exporter create mode 100644 src/initscripts/packages/node_exporter create mode 100644 src/paks/node_exporter/install.sh create mode 100644 src/paks/node_exporter/uninstall.sh create mode 100644 src/paks/node_exporter/update.sh
--- lfs/Config | 8 ++++++++ lfs/go | 9 ++++++--- 2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/lfs/Config b/lfs/Config index 7d98e303b..c8be227a1 100644 --- a/lfs/Config +++ b/lfs/Config @@ -138,6 +138,14 @@ ifeq "$(BUILD_ARCH)" "aarch64" GOARCH = arm64 endif
+ifeq "$(BUILD_ARCH)" "armv5tel" + GOARCH = armv6l +endif + +ifeq "$(BUILD_ARCH)" "i586" + GOARCH = 386 +endif + ############################################################################### # Common Macro Definitions ############################################################################### diff --git a/lfs/go b/lfs/go index 6ebb37080..487ad8486 100644 --- a/lfs/go +++ b/lfs/go @@ -28,10 +28,10 @@ VER = 1.15.4
THISAPP = go-$(VER) DL_FILE = go$(VER).$(GOOS)-$(GOARCH).tar.gz -DL_FROM = $(URL_IPFIRE) +DL_FROM = https://golang.org/dl/ DIR_APP = $(DIR_SRC)/go TARGET = $(DIR_INFO)/$(THISAPP) -SUP_ARCH = x86_64 +SUP_ARCH = x86_64 i586 aarch64 armv5tel
############################################################################### # Top-level Rules @@ -41,7 +41,10 @@ objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = 8e9d11a16f03372c82c5134278a0bd7d +go$(VER).$(GOOS)-amd64.tar.gz_MD5 = 8e9d11a16f03372c82c5134278a0bd7d +go$(VER).$(GOOS)-386.tar.gz_MD5 = 8d1c3539c88710273f61b0c810b7448c +go$(VER).$(GOOS)-arm64.tar.gz_MD5 = b1846fb093f0261707bda44e158bc5be +go$(VER).$(GOOS)-armv6l.tar.gz_MD5 = cf04e0d84de6cbb7d224be1f42a83f02
install : $(TARGET)
Hello Holger,
This patch looks good so far, but the root files are missing.
Do you know what those are?
Otherwise this would be mergeable.
Best, -Michael
On 6 Jun 2021, at 18:48, Holger Sunke holger.sunke@posteo.de wrote:
lfs/Config | 8 ++++++++ lfs/go | 9 ++++++--- 2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/lfs/Config b/lfs/Config index 7d98e303b..c8be227a1 100644 --- a/lfs/Config +++ b/lfs/Config @@ -138,6 +138,14 @@ ifeq "$(BUILD_ARCH)" "aarch64" GOARCH = arm64 endif
+ifeq "$(BUILD_ARCH)" "armv5tel"
- GOARCH = armv6l
+endif
+ifeq "$(BUILD_ARCH)" "i586"
- GOARCH = 386
+endif
############################################################################### # Common Macro Definitions ############################################################################### diff --git a/lfs/go b/lfs/go index 6ebb37080..487ad8486 100644 --- a/lfs/go +++ b/lfs/go @@ -28,10 +28,10 @@ VER = 1.15.4
THISAPP = go-$(VER) DL_FILE = go$(VER).$(GOOS)-$(GOARCH).tar.gz -DL_FROM = $(URL_IPFIRE) +DL_FROM = https://golang.org/dl/ DIR_APP = $(DIR_SRC)/go TARGET = $(DIR_INFO)/$(THISAPP) -SUP_ARCH = x86_64 +SUP_ARCH = x86_64 i586 aarch64 armv5tel
############################################################################### # Top-level Rules @@ -41,7 +41,10 @@ objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = 8e9d11a16f03372c82c5134278a0bd7d +go$(VER).$(GOOS)-amd64.tar.gz_MD5 = 8e9d11a16f03372c82c5134278a0bd7d +go$(VER).$(GOOS)-386.tar.gz_MD5 = 8d1c3539c88710273f61b0c810b7448c +go$(VER).$(GOOS)-arm64.tar.gz_MD5 = b1846fb093f0261707bda44e158bc5be +go$(VER).$(GOOS)-armv6l.tar.gz_MD5 = cf04e0d84de6cbb7d224be1f42a83f02
install : $(TARGET)
-- 2.30.2
Hello Michael,
I don't know what the root files are, would you mind to explain?
Kind regards
Holger
Am 08.06.21 um 18:54 schrieb Michael Tremer:
Hello Holger,
This patch looks good so far, but the root files are missing.
Do you know what those are?
Otherwise this would be mergeable.
Best, -Michael
On 6 Jun 2021, at 18:48, Holger Sunke holger.sunke@posteo.de wrote:
lfs/Config | 8 ++++++++ lfs/go | 9 ++++++--- 2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/lfs/Config b/lfs/Config index 7d98e303b..c8be227a1 100644 --- a/lfs/Config +++ b/lfs/Config @@ -138,6 +138,14 @@ ifeq "$(BUILD_ARCH)" "aarch64" GOARCH = arm64 endif
+ifeq "$(BUILD_ARCH)" "armv5tel"
- GOARCH = armv6l
+endif
+ifeq "$(BUILD_ARCH)" "i586"
- GOARCH = 386
+endif
############################################################################### # Common Macro Definitions ############################################################################### diff --git a/lfs/go b/lfs/go index 6ebb37080..487ad8486 100644 --- a/lfs/go +++ b/lfs/go @@ -28,10 +28,10 @@ VER = 1.15.4
THISAPP = go-$(VER) DL_FILE = go$(VER).$(GOOS)-$(GOARCH).tar.gz -DL_FROM = $(URL_IPFIRE) +DL_FROM = https://golang.org/dl/ DIR_APP = $(DIR_SRC)/go TARGET = $(DIR_INFO)/$(THISAPP) -SUP_ARCH = x86_64 +SUP_ARCH = x86_64 i586 aarch64 armv5tel
############################################################################### # Top-level Rules @@ -41,7 +41,10 @@ objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = 8e9d11a16f03372c82c5134278a0bd7d +go$(VER).$(GOOS)-amd64.tar.gz_MD5 = 8e9d11a16f03372c82c5134278a0bd7d +go$(VER).$(GOOS)-386.tar.gz_MD5 = 8d1c3539c88710273f61b0c810b7448c +go$(VER).$(GOOS)-arm64.tar.gz_MD5 = b1846fb093f0261707bda44e158bc5be +go$(VER).$(GOOS)-armv6l.tar.gz_MD5 = cf04e0d84de6cbb7d224be1f42a83f02
install : $(TARGET)
-- 2.30.2
Hello,
On 9 Jun 2021, at 07:00, Holger Sunke holger.sunke@posteo.de wrote:
Hello Michael,
I don't know what the root files are, would you mind to explain?
It is explained here:
https://wiki.ipfire.org/devel/ipfire-2-x/addon-howto#package-definition
There is a log file which lists all files that are created and you will need to select the files that should be shipped in the package.
Let me know if you have any questions.
Best, -Michael
Kind regards
Holger
Am 08.06.21 um 18:54 schrieb Michael Tremer:
Hello Holger, This patch looks good so far, but the root files are missing. Do you know what those are? Otherwise this would be mergeable. Best, -Michael
On 6 Jun 2021, at 18:48, Holger Sunke holger.sunke@posteo.de wrote:
lfs/Config | 8 ++++++++ lfs/go | 9 ++++++--- 2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/lfs/Config b/lfs/Config index 7d98e303b..c8be227a1 100644 --- a/lfs/Config +++ b/lfs/Config @@ -138,6 +138,14 @@ ifeq "$(BUILD_ARCH)" "aarch64" GOARCH = arm64 endif
+ifeq "$(BUILD_ARCH)" "armv5tel"
- GOARCH = armv6l
+endif
+ifeq "$(BUILD_ARCH)" "i586"
- GOARCH = 386
+endif
############################################################################### # Common Macro Definitions ############################################################################### diff --git a/lfs/go b/lfs/go index 6ebb37080..487ad8486 100644 --- a/lfs/go +++ b/lfs/go @@ -28,10 +28,10 @@ VER = 1.15.4
THISAPP = go-$(VER) DL_FILE = go$(VER).$(GOOS)-$(GOARCH).tar.gz -DL_FROM = $(URL_IPFIRE) +DL_FROM = https://golang.org/dl/ DIR_APP = $(DIR_SRC)/go TARGET = $(DIR_INFO)/$(THISAPP) -SUP_ARCH = x86_64 +SUP_ARCH = x86_64 i586 aarch64 armv5tel
############################################################################### # Top-level Rules @@ -41,7 +41,10 @@ objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = 8e9d11a16f03372c82c5134278a0bd7d +go$(VER).$(GOOS)-amd64.tar.gz_MD5 = 8e9d11a16f03372c82c5134278a0bd7d +go$(VER).$(GOOS)-386.tar.gz_MD5 = 8d1c3539c88710273f61b0c810b7448c +go$(VER).$(GOOS)-arm64.tar.gz_MD5 = b1846fb093f0261707bda44e158bc5be +go$(VER).$(GOOS)-armv6l.tar.gz_MD5 = cf04e0d84de6cbb7d224be1f42a83f02
install : $(TARGET)
-- 2.30.2
I guess I have to build ipfire for each different arch to get the log files as source for the root files.
How do you build ipfire for all the archs? Do you use some kind of VMs?
Kind regards
Holger
On 08.06.21 18:54, Michael Tremer wrote:
Hello Holger,
This patch looks good so far, but the root files are missing.
Do you know what those are?
Otherwise this would be mergeable.
Best, -Michael
On 6 Jun 2021, at 18:48, Holger Sunke holger.sunke@posteo.de wrote:
lfs/Config | 8 ++++++++ lfs/go | 9 ++++++--- 2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/lfs/Config b/lfs/Config index 7d98e303b..c8be227a1 100644 --- a/lfs/Config +++ b/lfs/Config @@ -138,6 +138,14 @@ ifeq "$(BUILD_ARCH)" "aarch64" GOARCH = arm64 endif
+ifeq "$(BUILD_ARCH)" "armv5tel"
- GOARCH = armv6l
+endif
+ifeq "$(BUILD_ARCH)" "i586"
- GOARCH = 386
+endif
############################################################################### # Common Macro Definitions ############################################################################### diff --git a/lfs/go b/lfs/go index 6ebb37080..487ad8486 100644 --- a/lfs/go +++ b/lfs/go @@ -28,10 +28,10 @@ VER = 1.15.4
THISAPP = go-$(VER) DL_FILE = go$(VER).$(GOOS)-$(GOARCH).tar.gz -DL_FROM = $(URL_IPFIRE) +DL_FROM = https://golang.org/dl/ DIR_APP = $(DIR_SRC)/go TARGET = $(DIR_INFO)/$(THISAPP) -SUP_ARCH = x86_64 +SUP_ARCH = x86_64 i586 aarch64 armv5tel
############################################################################### # Top-level Rules @@ -41,7 +41,10 @@ objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = 8e9d11a16f03372c82c5134278a0bd7d +go$(VER).$(GOOS)-amd64.tar.gz_MD5 = 8e9d11a16f03372c82c5134278a0bd7d +go$(VER).$(GOOS)-386.tar.gz_MD5 = 8d1c3539c88710273f61b0c810b7448c +go$(VER).$(GOOS)-arm64.tar.gz_MD5 = b1846fb093f0261707bda44e158bc5be +go$(VER).$(GOOS)-armv6l.tar.gz_MD5 = cf04e0d84de6cbb7d224be1f42a83f02
install : $(TARGET)
-- 2.30.2
Hello Holger,
On 15 Jul 2021, at 20:32, Holger Sunke holger.sunke@posteo.de wrote:
I guess I have to build ipfire for each different arch to get the log files as source for the root files.
Yes, that would be the easiest way. For most packages this is not requires as the list of installed files is identical but compilers and other architecture-specific package tends to require this extra work.
How do you build ipfire for all the archs? Do you use some kind of VMs?
You can do either that or use qemu-user-static. This will emulate the other architecture for you instead.
So you would install qemu-user-static (https://packages.debian.org/buster/qemu-user-static) or whatever the equivalent is in our your distribution of choice and then run these commands:
Erase the old build:
./make.sh clean
Download a toolchain for the target architecture:
./make.sh —-target=aarch64 gettoolchain
And then you run the build:
./make.sh —-target=aarch64 build
You can then do this for armv6l in next, too.
The emulated build will take a little bit longer due to the emulation.
Let me know if this has worked.
Best, -Michael
Kind regards
Holger
On 08.06.21 18:54, Michael Tremer wrote:
Hello Holger, This patch looks good so far, but the root files are missing. Do you know what those are? Otherwise this would be mergeable. Best, -Michael
On 6 Jun 2021, at 18:48, Holger Sunke holger.sunke@posteo.de wrote:
lfs/Config | 8 ++++++++ lfs/go | 9 ++++++--- 2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/lfs/Config b/lfs/Config index 7d98e303b..c8be227a1 100644 --- a/lfs/Config +++ b/lfs/Config @@ -138,6 +138,14 @@ ifeq "$(BUILD_ARCH)" "aarch64" GOARCH = arm64 endif
+ifeq "$(BUILD_ARCH)" "armv5tel"
- GOARCH = armv6l
+endif
+ifeq "$(BUILD_ARCH)" "i586"
- GOARCH = 386
+endif
############################################################################### # Common Macro Definitions ############################################################################### diff --git a/lfs/go b/lfs/go index 6ebb37080..487ad8486 100644 --- a/lfs/go +++ b/lfs/go @@ -28,10 +28,10 @@ VER = 1.15.4
THISAPP = go-$(VER) DL_FILE = go$(VER).$(GOOS)-$(GOARCH).tar.gz -DL_FROM = $(URL_IPFIRE) +DL_FROM = https://golang.org/dl/ DIR_APP = $(DIR_SRC)/go TARGET = $(DIR_INFO)/$(THISAPP) -SUP_ARCH = x86_64 +SUP_ARCH = x86_64 i586 aarch64 armv5tel
############################################################################### # Top-level Rules @@ -41,7 +41,10 @@ objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = 8e9d11a16f03372c82c5134278a0bd7d +go$(VER).$(GOOS)-amd64.tar.gz_MD5 = 8e9d11a16f03372c82c5134278a0bd7d +go$(VER).$(GOOS)-386.tar.gz_MD5 = 8d1c3539c88710273f61b0c810b7448c +go$(VER).$(GOOS)-arm64.tar.gz_MD5 = b1846fb093f0261707bda44e158bc5be +go$(VER).$(GOOS)-armv6l.tar.gz_MD5 = cf04e0d84de6cbb7d224be1f42a83f02
install : $(TARGET)
-- 2.30.2
Hello Michael,
I think this should generally work, but currently I'm stuck with strange issues like these:
Jul 21 17:51:53: Building glibc glibc-2.32.tar.xz checksum OK + cd /usr/src/lfs + make -f glibc LFS_BASEDIR=/usr/src install ====================================== Installing glibc-2.32 ... Install started; saving file list to /usr/src/lsalr ... cd /usr/src/glibc-2.32 && patch -Np1 < /usr/src/src/patches/glibc-localedef-no-archive.patch patching file localedata/Makefile Hunk #1 succeeded at 440 with fuzz 1 (offset 217 lines). cd /usr/src/glibc-build && \ CFLAGS="-O2 -pipe -Wall -fexceptions -fPIC -fstack-clash-protection -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -Wno-error=maybe-uninitialized -fno-asynchronous-unwind-tables" \ /usr/src/glibc-2.32/configure --build=aarch64-unknown-linux-gnu --prefix=/usr --libexecdir=/usr/lib/glibc --enable-stack-protector=strong --disable-profile --enable-kernel=4.14.0 --enable-add-ons --without-selinux --enable-experimental-malloc --enable-bind-now --disable-crypt qemu: Unsupported syscall: 291 /tools_aarch64/bin/ls: cannot access '.': Function not implemented configure: error: working directory cannot be determined make: *** [glibc:114: /usr/src/log/glibc-2.32] Error 2
ERROR: Building glibc
[ FAIL ] Check /home/holger/development/ipfire/ipfire-2.x/log/_build.base.log for errors if applicable [ FAIL ]
I tried building in schroot using Ubuntu bionic and focal.
Did you already encounter these errors?
Kind regards Holger
Am 19.07.21 um 13:11 schrieb Michael Tremer:
Hello Holger,
On 15 Jul 2021, at 20:32, Holger Sunke holger.sunke@posteo.de wrote:
I guess I have to build ipfire for each different arch to get the log files as source for the root files.
Yes, that would be the easiest way. For most packages this is not requires as the list of installed files is identical but compilers and other architecture-specific package tends to require this extra work.
How do you build ipfire for all the archs? Do you use some kind of VMs?
You can do either that or use qemu-user-static. This will emulate the other architecture for you instead.
So you would install qemu-user-static (https://packages.debian.org/buster/qemu-user-static) or whatever the equivalent is in our your distribution of choice and then run these commands:
Erase the old build:
./make.sh clean
Download a toolchain for the target architecture:
./make.sh —-target=aarch64 gettoolchain
And then you run the build:
./make.sh —-target=aarch64 build
You can then do this for armv6l in next, too.
The emulated build will take a little bit longer due to the emulation.
Let me know if this has worked.
Best, -Michael
Kind regards
Holger
On 08.06.21 18:54, Michael Tremer wrote:
Hello Holger, This patch looks good so far, but the root files are missing. Do you know what those are? Otherwise this would be mergeable. Best, -Michael
On 6 Jun 2021, at 18:48, Holger Sunke holger.sunke@posteo.de wrote:
lfs/Config | 8 ++++++++ lfs/go | 9 ++++++--- 2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/lfs/Config b/lfs/Config index 7d98e303b..c8be227a1 100644 --- a/lfs/Config +++ b/lfs/Config @@ -138,6 +138,14 @@ ifeq "$(BUILD_ARCH)" "aarch64" GOARCH = arm64 endif
+ifeq "$(BUILD_ARCH)" "armv5tel"
- GOARCH = armv6l
+endif
+ifeq "$(BUILD_ARCH)" "i586"
- GOARCH = 386
+endif
############################################################################### # Common Macro Definitions ############################################################################### diff --git a/lfs/go b/lfs/go index 6ebb37080..487ad8486 100644 --- a/lfs/go +++ b/lfs/go @@ -28,10 +28,10 @@ VER = 1.15.4
THISAPP = go-$(VER) DL_FILE = go$(VER).$(GOOS)-$(GOARCH).tar.gz -DL_FROM = $(URL_IPFIRE) +DL_FROM = https://golang.org/dl/ DIR_APP = $(DIR_SRC)/go TARGET = $(DIR_INFO)/$(THISAPP) -SUP_ARCH = x86_64 +SUP_ARCH = x86_64 i586 aarch64 armv5tel
############################################################################### # Top-level Rules @@ -41,7 +41,10 @@ objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = 8e9d11a16f03372c82c5134278a0bd7d +go$(VER).$(GOOS)-amd64.tar.gz_MD5 = 8e9d11a16f03372c82c5134278a0bd7d +go$(VER).$(GOOS)-386.tar.gz_MD5 = 8d1c3539c88710273f61b0c810b7448c +go$(VER).$(GOOS)-arm64.tar.gz_MD5 = b1846fb093f0261707bda44e158bc5be +go$(VER).$(GOOS)-armv6l.tar.gz_MD5 = cf04e0d84de6cbb7d224be1f42a83f02
install : $(TARGET)
-- 2.30.2
Hello,
We had this one before on the list. I can’t find it though.
What distribution are you using? It looks like QEMU is too old. The statx syscall (291) isn’t supported.
-Michael
On 21 Jul 2021, at 18:55, Holger Sunke holger.sunke@posteo.de wrote:
Hello Michael,
I think this should generally work, but currently I'm stuck with strange issues like these:
Jul 21 17:51:53: Building glibc glibc-2.32.tar.xz checksum OK
- cd /usr/src/lfs
- make -f glibc LFS_BASEDIR=/usr/src install
====================================== Installing glibc-2.32 ... Install started; saving file list to /usr/src/lsalr ... cd /usr/src/glibc-2.32 && patch -Np1 < /usr/src/src/patches/glibc-localedef-no-archive.patch patching file localedata/Makefile Hunk #1 succeeded at 440 with fuzz 1 (offset 217 lines). cd /usr/src/glibc-build && \ CFLAGS="-O2 -pipe -Wall -fexceptions -fPIC -fstack-clash-protection -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -Wno-error=maybe-uninitialized -fno-asynchronous-unwind-tables" \ /usr/src/glibc-2.32/configure --build=aarch64-unknown-linux-gnu --prefix=/usr --libexecdir=/usr/lib/glibc --enable-stack-protector=strong --disable-profile --enable-kernel=4.14.0 --enable-add-ons --without-selinux --enable-experimental-malloc --enable-bind-now --disable-crypt qemu: Unsupported syscall: 291 /tools_aarch64/bin/ls: cannot access '.': Function not implemented configure: error: working directory cannot be determined make: *** [glibc:114: /usr/src/log/glibc-2.32] Error 2
ERROR: Building glibc [ FAIL ] Check /home/holger/development/ipfire/ipfire-2.x/log/_build.base.log for errors if applicable [ FAIL ]
I tried building in schroot using Ubuntu bionic and focal.
Did you already encounter these errors?
Kind regards Holger
Am 19.07.21 um 13:11 schrieb Michael Tremer:
Hello Holger,
On 15 Jul 2021, at 20:32, Holger Sunke holger.sunke@posteo.de wrote:
I guess I have to build ipfire for each different arch to get the log files as source for the root files.
Yes, that would be the easiest way. For most packages this is not requires as the list of installed files is identical but compilers and other architecture-specific package tends to require this extra work.
How do you build ipfire for all the archs? Do you use some kind of VMs?
You can do either that or use qemu-user-static. This will emulate the other architecture for you instead. So you would install qemu-user-static (https://packages.debian.org/buster/qemu-user-static) or whatever the equivalent is in our your distribution of choice and then run these commands: Erase the old build: ./make.sh clean Download a toolchain for the target architecture: ./make.sh —-target=aarch64 gettoolchain And then you run the build: ./make.sh —-target=aarch64 build You can then do this for armv6l in next, too. The emulated build will take a little bit longer due to the emulation. Let me know if this has worked. Best, -Michael
Kind regards
Holger
On 08.06.21 18:54, Michael Tremer wrote:
Hello Holger, This patch looks good so far, but the root files are missing. Do you know what those are? Otherwise this would be mergeable. Best, -Michael
On 6 Jun 2021, at 18:48, Holger Sunke holger.sunke@posteo.de wrote:
lfs/Config | 8 ++++++++ lfs/go | 9 ++++++--- 2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/lfs/Config b/lfs/Config index 7d98e303b..c8be227a1 100644 --- a/lfs/Config +++ b/lfs/Config @@ -138,6 +138,14 @@ ifeq "$(BUILD_ARCH)" "aarch64" GOARCH = arm64 endif
+ifeq "$(BUILD_ARCH)" "armv5tel"
- GOARCH = armv6l
+endif
+ifeq "$(BUILD_ARCH)" "i586"
- GOARCH = 386
+endif
############################################################################### # Common Macro Definitions ############################################################################### diff --git a/lfs/go b/lfs/go index 6ebb37080..487ad8486 100644 --- a/lfs/go +++ b/lfs/go @@ -28,10 +28,10 @@ VER = 1.15.4
THISAPP = go-$(VER) DL_FILE = go$(VER).$(GOOS)-$(GOARCH).tar.gz -DL_FROM = $(URL_IPFIRE) +DL_FROM = https://golang.org/dl/ DIR_APP = $(DIR_SRC)/go TARGET = $(DIR_INFO)/$(THISAPP) -SUP_ARCH = x86_64 +SUP_ARCH = x86_64 i586 aarch64 armv5tel
############################################################################### # Top-level Rules @@ -41,7 +41,10 @@ objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = 8e9d11a16f03372c82c5134278a0bd7d +go$(VER).$(GOOS)-amd64.tar.gz_MD5 = 8e9d11a16f03372c82c5134278a0bd7d +go$(VER).$(GOOS)-386.tar.gz_MD5 = 8d1c3539c88710273f61b0c810b7448c +go$(VER).$(GOOS)-arm64.tar.gz_MD5 = b1846fb093f0261707bda44e158bc5be +go$(VER).$(GOOS)-armv6l.tar.gz_MD5 = cf04e0d84de6cbb7d224be1f42a83f02
install : $(TARGET)
-- 2.30.2
Hello,
I'm using Ubuntu focal. After pulling a newer version of qemu and locally moving up the 'go' package in the make.sh script, I finally got the logs to create rootfiles for aarch64 and armv5tel.
What exact distro are you using? I could not manage do complete a build for aarch64 nor armv5tel as I ran into segmentation faults.
Kind reagards
Holger
Am 21.07.21 um 20:15 schrieb Michael Tremer:
Hello,
We had this one before on the list. I can’t find it though.
What distribution are you using? It looks like QEMU is too old. The statx syscall (291) isn’t supported.
-Michael
On 21 Jul 2021, at 18:55, Holger Sunke holger.sunke@posteo.de wrote:
Hello Michael,
I think this should generally work, but currently I'm stuck with strange issues like these:
Jul 21 17:51:53: Building glibc glibc-2.32.tar.xz checksum OK + cd /usr/src/lfs + make -f glibc LFS_BASEDIR=/usr/src install ====================================== Installing glibc-2.32 ... Install started; saving file list to /usr/src/lsalr ... cd /usr/src/glibc-2.32 && patch -Np1 < /usr/src/src/patches/glibc-localedef-no-archive.patch patching file localedata/Makefile Hunk #1 succeeded at 440 with fuzz 1 (offset 217 lines). cd /usr/src/glibc-build && \ CFLAGS="-O2 -pipe -Wall -fexceptions -fPIC -fstack-clash-protection -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -Wno-error=maybe-uninitialized -fno-asynchronous-unwind-tables" \ /usr/src/glibc-2.32/configure --build=aarch64-unknown-linux-gnu --prefix=/usr --libexecdir=/usr/lib/glibc --enable-stack-protector=strong --disable-profile --enable-kernel=4.14.0 --enable-add-ons --without-selinux --enable-experimental-malloc --enable-bind-now --disable-crypt qemu: Unsupported syscall: 291 /tools_aarch64/bin/ls: cannot access '.': Function not implemented configure: error: working directory cannot be determined make: *** [glibc:114: /usr/src/log/glibc-2.32] Error 2
ERROR: Building glibc [ FAIL ] Check /home/holger/development/ipfire/ipfire-2.x/log/_build.base.log for errors if applicable [ FAIL ]
I tried building in schroot using Ubuntu bionic and focal.
Did you already encounter these errors?
Kind regards Holger
Am 19.07.21 um 13:11 schrieb Michael Tremer:
Hello Holger,
On 15 Jul 2021, at 20:32, Holger Sunke holger.sunke@posteo.de wrote:
I guess I have to build ipfire for each different arch to get the log files as source for the root files.
Yes, that would be the easiest way. For most packages this is not requires as the list of installed files is identical but compilers and other architecture-specific package tends to require this extra work.
How do you build ipfire for all the archs? Do you use some kind of VMs?
You can do either that or use qemu-user-static. This will emulate the other architecture for you instead. So you would install qemu-user-static (https://packages.debian.org/buster/qemu-user-static) or whatever the equivalent is in our your distribution of choice and then run these commands: Erase the old build: ./make.sh clean Download a toolchain for the target architecture: ./make.sh —-target=aarch64 gettoolchain And then you run the build: ./make.sh —-target=aarch64 build You can then do this for armv6l in next, too. The emulated build will take a little bit longer due to the emulation. Let me know if this has worked. Best, -Michael
Kind regards
Holger
On 08.06.21 18:54, Michael Tremer wrote:
Hello Holger, This patch looks good so far, but the root files are missing. Do you know what those are? Otherwise this would be mergeable. Best, -Michael
On 6 Jun 2021, at 18:48, Holger Sunke holger.sunke@posteo.de wrote:
lfs/Config | 8 ++++++++ lfs/go | 9 ++++++--- 2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/lfs/Config b/lfs/Config index 7d98e303b..c8be227a1 100644 --- a/lfs/Config +++ b/lfs/Config @@ -138,6 +138,14 @@ ifeq "$(BUILD_ARCH)" "aarch64" GOARCH = arm64 endif
+ifeq "$(BUILD_ARCH)" "armv5tel"
- GOARCH = armv6l
+endif
+ifeq "$(BUILD_ARCH)" "i586"
- GOARCH = 386
+endif
############################################################################### # Common Macro Definitions ############################################################################### diff --git a/lfs/go b/lfs/go index 6ebb37080..487ad8486 100644 --- a/lfs/go +++ b/lfs/go @@ -28,10 +28,10 @@ VER = 1.15.4
THISAPP = go-$(VER) DL_FILE = go$(VER).$(GOOS)-$(GOARCH).tar.gz -DL_FROM = $(URL_IPFIRE) +DL_FROM = https://golang.org/dl/ DIR_APP = $(DIR_SRC)/go TARGET = $(DIR_INFO)/$(THISAPP) -SUP_ARCH = x86_64 +SUP_ARCH = x86_64 i586 aarch64 armv5tel
############################################################################### # Top-level Rules @@ -41,7 +41,10 @@ objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = 8e9d11a16f03372c82c5134278a0bd7d +go$(VER).$(GOOS)-amd64.tar.gz_MD5 = 8e9d11a16f03372c82c5134278a0bd7d +go$(VER).$(GOOS)-386.tar.gz_MD5 = 8d1c3539c88710273f61b0c810b7448c +go$(VER).$(GOOS)-arm64.tar.gz_MD5 = b1846fb093f0261707bda44e158bc5be +go$(VER).$(GOOS)-armv6l.tar.gz_MD5 = cf04e0d84de6cbb7d224be1f42a83f02
install : $(TARGET)
-- 2.30.2
Hey,
On 24 Jul 2021, at 20:13, Holger Sunke holger.sunke@posteo.de wrote:
Hello,
I'm using Ubuntu focal. After pulling a newer version of qemu and locally moving up the 'go' package in the make.sh script, I finally got the logs to create rootfiles for aarch64 and armv5tel.
What exact distro are you using? I could not manage do complete a build for aarch64 nor armv5tel as I ran into segmentation faults.
I am using Debian Buster with maybe a couple of backports. I didn’t test bullseye, yet, but all these including Ubuntu should be fine.
The segmentation faults can happen and you can just restart the build and it should eventually go through.
For the nightly builds with are using native systems on AWS with their Graviton 2 processors. AFAIK there is no “budget” alternative to that.
-Michael
Kind reagards
Holger
Am 21.07.21 um 20:15 schrieb Michael Tremer:
Hello, We had this one before on the list. I can’t find it though. What distribution are you using? It looks like QEMU is too old. The statx syscall (291) isn’t supported. -Michael
On 21 Jul 2021, at 18:55, Holger Sunke holger.sunke@posteo.de wrote:
Hello Michael,
I think this should generally work, but currently I'm stuck with strange issues like these:
Jul 21 17:51:53: Building glibc glibc-2.32.tar.xz checksum OK
- cd /usr/src/lfs
- make -f glibc LFS_BASEDIR=/usr/src install
====================================== Installing glibc-2.32 ... Install started; saving file list to /usr/src/lsalr ... cd /usr/src/glibc-2.32 && patch -Np1 < /usr/src/src/patches/glibc-localedef-no-archive.patch patching file localedata/Makefile Hunk #1 succeeded at 440 with fuzz 1 (offset 217 lines). cd /usr/src/glibc-build && \ CFLAGS="-O2 -pipe -Wall -fexceptions -fPIC -fstack-clash-protection -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -Wno-error=maybe-uninitialized -fno-asynchronous-unwind-tables" \ /usr/src/glibc-2.32/configure --build=aarch64-unknown-linux-gnu --prefix=/usr --libexecdir=/usr/lib/glibc --enable-stack-protector=strong --disable-profile --enable-kernel=4.14.0 --enable-add-ons --without-selinux --enable-experimental-malloc --enable-bind-now --disable-crypt qemu: Unsupported syscall: 291 /tools_aarch64/bin/ls: cannot access '.': Function not implemented configure: error: working directory cannot be determined make: *** [glibc:114: /usr/src/log/glibc-2.32] Error 2
ERROR: Building glibc [ FAIL ] Check /home/holger/development/ipfire/ipfire-2.x/log/_build.base.log for errors if applicable [ FAIL ]
I tried building in schroot using Ubuntu bionic and focal.
Did you already encounter these errors?
Kind regards Holger
Am 19.07.21 um 13:11 schrieb Michael Tremer:
Hello Holger,
On 15 Jul 2021, at 20:32, Holger Sunke holger.sunke@posteo.de wrote:
I guess I have to build ipfire for each different arch to get the log files as source for the root files.
Yes, that would be the easiest way. For most packages this is not requires as the list of installed files is identical but compilers and other architecture-specific package tends to require this extra work.
How do you build ipfire for all the archs? Do you use some kind of VMs?
You can do either that or use qemu-user-static. This will emulate the other architecture for you instead. So you would install qemu-user-static (https://packages.debian.org/buster/qemu-user-static) or whatever the equivalent is in our your distribution of choice and then run these commands: Erase the old build: ./make.sh clean Download a toolchain for the target architecture: ./make.sh —-target=aarch64 gettoolchain And then you run the build: ./make.sh —-target=aarch64 build You can then do this for armv6l in next, too. The emulated build will take a little bit longer due to the emulation. Let me know if this has worked. Best, -Michael
Kind regards
Holger
On 08.06.21 18:54, Michael Tremer wrote:
Hello Holger, This patch looks good so far, but the root files are missing. Do you know what those are? Otherwise this would be mergeable. Best, -Michael > On 6 Jun 2021, at 18:48, Holger Sunke holger.sunke@posteo.de wrote: > > --- > lfs/Config | 8 ++++++++ > lfs/go | 9 ++++++--- > 2 files changed, 14 insertions(+), 3 deletions(-) > > diff --git a/lfs/Config b/lfs/Config > index 7d98e303b..c8be227a1 100644 > --- a/lfs/Config > +++ b/lfs/Config > @@ -138,6 +138,14 @@ ifeq "$(BUILD_ARCH)" "aarch64" > GOARCH = arm64 > endif > > +ifeq "$(BUILD_ARCH)" "armv5tel" > + GOARCH = armv6l > +endif > + > +ifeq "$(BUILD_ARCH)" "i586" > + GOARCH = 386 > +endif > + > ############################################################################### > # Common Macro Definitions > ############################################################################### > diff --git a/lfs/go b/lfs/go > index 6ebb37080..487ad8486 100644 > --- a/lfs/go > +++ b/lfs/go > @@ -28,10 +28,10 @@ VER = 1.15.4 > > THISAPP = go-$(VER) > DL_FILE = go$(VER).$(GOOS)-$(GOARCH).tar.gz > -DL_FROM = $(URL_IPFIRE) > +DL_FROM = https://golang.org/dl/ > DIR_APP = $(DIR_SRC)/go > TARGET = $(DIR_INFO)/$(THISAPP) > -SUP_ARCH = x86_64 > +SUP_ARCH = x86_64 i586 aarch64 armv5tel > > ############################################################################### > # Top-level Rules > @@ -41,7 +41,10 @@ objects = $(DL_FILE) > > $(DL_FILE) = $(DL_FROM)/$(DL_FILE) > > -$(DL_FILE)_MD5 = 8e9d11a16f03372c82c5134278a0bd7d > +go$(VER).$(GOOS)-amd64.tar.gz_MD5 = 8e9d11a16f03372c82c5134278a0bd7d > +go$(VER).$(GOOS)-386.tar.gz_MD5 = 8d1c3539c88710273f61b0c810b7448c > +go$(VER).$(GOOS)-arm64.tar.gz_MD5 = b1846fb093f0261707bda44e158bc5be > +go$(VER).$(GOOS)-armv6l.tar.gz_MD5 = cf04e0d84de6cbb7d224be1f42a83f02 > > install : $(TARGET) > > -- > 2.30.2 >
--- config/node_exporter/node_exporter_options | 203 +++++++++++++++++++++ config/rootfiles/packages/node_exporter | 3 + lfs/node_exporter | 94 ++++++++++ make.sh | 1 + src/initscripts/packages/node_exporter | 42 +++++ src/paks/node_exporter/install.sh | 31 ++++ src/paks/node_exporter/uninstall.sh | 30 +++ src/paks/node_exporter/update.sh | 27 +++ 8 files changed, 431 insertions(+) create mode 100644 config/node_exporter/node_exporter_options create mode 100644 config/rootfiles/packages/node_exporter create mode 100644 lfs/node_exporter create mode 100644 src/initscripts/packages/node_exporter create mode 100644 src/paks/node_exporter/install.sh create mode 100644 src/paks/node_exporter/uninstall.sh create mode 100644 src/paks/node_exporter/update.sh
diff --git a/config/node_exporter/node_exporter_options b/config/node_exporter/node_exporter_options new file mode 100644 index 000000000..f614b1102 --- /dev/null +++ b/config/node_exporter/node_exporter_options @@ -0,0 +1,203 @@ +# Customize node_exporter startup command line flags by editing OPTIONS below: + +export OPTIONS="--web.listen-address=:9100" + +#Flags: +# -h, --help Show context-sensitive help (also try +# --help-long and --help-man). +# --collector.bcache.priorityStats +# Expose expensive priority stats. +# --collector.cpu.info Enables metric cpu_info +# --collector.cpu.info.flags-include=COLLECTOR.CPU.INFO.FLAGS-INCLUDE +# Filter the `flags` field in cpuInfo with a +# value that must be a regular expression +# --collector.cpu.info.bugs-include=COLLECTOR.CPU.INFO.BUGS-INCLUDE +# Filter the `bugs` field in cpuInfo with a value +# that must be a regular expression +# --collector.diskstats.ignored-devices="^(ram|loop|fd|(h|s|v|xv)d[a-z]|nvme\d+n\d+p)\d+$" +# Regexp of devices to ignore for diskstats. +# --collector.filesystem.ignored-mount-points="^/(dev|proc|sys|var/lib/docker/.+)($|/)" +# Regexp of mount points to ignore for filesystem +# collector. +# --collector.filesystem.ignored-fs-types="^(autofs|binfmt_misc|bpf|cgroup2?|configfs|debugfs|devpts|devtmpfs|fusectl|hugetlbfs|iso9660|mqueue|nsfs|overlay|proc|procfs|pstore|rpc_pipefs|securityfs|selinuxfs|squashfs|sysfs|tracefs)$" +# Regexp of filesystem types to ignore for +# filesystem collector. +# --collector.ipvs.backend-labels="local_address,local_port,remote_address,remote_port,proto,local_mark" +# Comma separated list for IPVS backend stats +# labels. +# --collector.netclass.ignored-devices="^$" +# Regexp of net devices to ignore for netclass +# collector. +# --collector.netdev.device-include=COLLECTOR.NETDEV.DEVICE-INCLUDE +# Regexp of net devices to include (mutually +# exclusive to device-exclude). +# --collector.netdev.device-exclude=COLLECTOR.NETDEV.DEVICE-EXCLUDE +# Regexp of net devices to exclude (mutually +# exclusive to device-include). +# --collector.netstat.fields="^(.*_(InErrors|InErrs)|Ip_Forwarding|Ip(6|Ext)_(InOctets|OutOctets)|Icmp6?_(InMsgs|OutMsgs)|TcpExt_(Listen.*|Syncookies.*|TCPSynRetrans)|Tcp_(ActiveOpens|InSegs|OutSegs|OutRsts|PassiveOpens|RetransSegs|CurrEstab)|Udp6?_(InDatagrams|OutDatagrams|NoPorts|RcvbufErrors|SndbufErrors))$" +# Regexp of fields to return for netstat +# collector. +# --collector.ntp.server="127.0.0.1" +# NTP server to use for ntp collector +# --collector.ntp.protocol-version=4 +# NTP protocol version +# --collector.ntp.server-is-local +# Certify that collector.ntp.server address is +# not a public ntp server +# --collector.ntp.ip-ttl=1 IP TTL to use while sending NTP query +# --collector.ntp.max-distance=3.46608s +# Max accumulated distance to the root +# --collector.ntp.local-offset-tolerance=1ms +# Offset between local clock and local ntpd time +# to tolerate +# --path.procfs="/proc" procfs mountpoint. +# --path.sysfs="/sys" sysfs mountpoint. +# --path.rootfs="/" rootfs mountpoint. +# --collector.perf.cpus="" List of CPUs from which perf metrics should be +# collected +# --collector.perf.tracepoint=COLLECTOR.PERF.TRACEPOINT ... +# perf tracepoint that should be collected +# --collector.powersupply.ignored-supplies="^$" +# Regexp of power supplies to ignore for +# powersupplyclass collector. +# --collector.qdisc.fixtures="" +# test fixtures to use for qdisc collector +# end-to-end testing +# --collector.runit.servicedir="/etc/service" +# Path to runit service directory. +# --collector.supervisord.url="http://localhost:9001/RPC2" +# XML RPC endpoint. +# --collector.systemd.unit-include=".+" +# Regexp of systemd units to include. Units must +# both match include and not match exclude to be +# included. +# --collector.systemd.unit-exclude=".+\.(automount|device|mount|scope|slice)" +# Regexp of systemd units to exclude. Units must +# both match include and not match exclude to be +# included. +# --collector.systemd.enable-task-metrics +# Enables service unit tasks metrics +# unit_tasks_current and unit_tasks_max +# --collector.systemd.enable-restarts-metrics +# Enables service unit metric +# service_restart_total +# --collector.systemd.enable-start-time-metrics +# Enables service unit metric +# unit_start_time_seconds +# --collector.textfile.directory="" +# Directory to read text files with metrics from. +# --collector.vmstat.fields="^(oom_kill|pgpg|pswp|pg.*fault).*" +# Regexp of fields to return for vmstat +# collector. +# --collector.wifi.fixtures="" +# test fixtures to use for wifi collector metrics +# --collector.arp Enable the arp collector (default: enabled). +# --collector.bcache Enable the bcache collector (default: enabled). +# --collector.bonding Enable the bonding collector (default: +# enabled). +# --collector.btrfs Enable the btrfs collector (default: enabled). +# --collector.buddyinfo Enable the buddyinfo collector (default: +# disabled). +# --collector.conntrack Enable the conntrack collector (default: +# enabled). +# --collector.cpu Enable the cpu collector (default: enabled). +# --collector.cpufreq Enable the cpufreq collector (default: +# enabled). +# --collector.diskstats Enable the diskstats collector (default: +# enabled). +# --collector.drbd Enable the drbd collector (default: disabled). +# --collector.edac Enable the edac collector (default: enabled). +# --collector.entropy Enable the entropy collector (default: +# enabled). +# --collector.fibrechannel Enable the fibrechannel collector (default: +# enabled). +# --collector.filefd Enable the filefd collector (default: enabled). +# --collector.filesystem Enable the filesystem collector (default: +# enabled). +# --collector.hwmon Enable the hwmon collector (default: enabled). +# --collector.infiniband Enable the infiniband collector (default: +# enabled). +# --collector.interrupts Enable the interrupts collector (default: +# disabled). +# --collector.ipvs Enable the ipvs collector (default: enabled). +# --collector.ksmd Enable the ksmd collector (default: disabled). +# --collector.loadavg Enable the loadavg collector (default: +# enabled). +# --collector.logind Enable the logind collector (default: +# disabled). +# --collector.mdadm Enable the mdadm collector (default: enabled). +# --collector.meminfo Enable the meminfo collector (default: +# enabled). +# --collector.meminfo_numa Enable the meminfo_numa collector (default: +# disabled). +# --collector.mountstats Enable the mountstats collector (default: +# disabled). +# --collector.netclass Enable the netclass collector (default: +# enabled). +# --collector.netdev Enable the netdev collector (default: enabled). +# --collector.netstat Enable the netstat collector (default: +# enabled). +# --collector.network_route Enable the network_route collector (default: +# disabled). +# --collector.nfs Enable the nfs collector (default: enabled). +# --collector.nfsd Enable the nfsd collector (default: enabled). +# --collector.ntp Enable the ntp collector (default: disabled). +# --collector.perf Enable the perf collector (default: disabled). +# --collector.powersupplyclass +# Enable the powersupplyclass collector (default: +# enabled). +# --collector.pressure Enable the pressure collector (default: +# enabled). +# --collector.processes Enable the processes collector (default: +# disabled). +# --collector.qdisc Enable the qdisc collector (default: disabled). +# --collector.rapl Enable the rapl collector (default: enabled). +# --collector.runit Enable the runit collector (default: disabled). +# --collector.schedstat Enable the schedstat collector (default: +# enabled). +# --collector.sockstat Enable the sockstat collector (default: +# enabled). +# --collector.softnet Enable the softnet collector (default: +# enabled). +# --collector.stat Enable the stat collector (default: enabled). +# --collector.supervisord Enable the supervisord collector (default: +# disabled). +# --collector.systemd Enable the systemd collector (default: +# disabled). +# --collector.tcpstat Enable the tcpstat collector (default: +# disabled). +# --collector.textfile Enable the textfile collector (default: +# enabled). +# --collector.thermal_zone Enable the thermal_zone collector (default: +# enabled). +# --collector.time Enable the time collector (default: enabled). +# --collector.timex Enable the timex collector (default: enabled). +# --collector.udp_queues Enable the udp_queues collector (default: +# enabled). +# --collector.uname Enable the uname collector (default: enabled). +# --collector.vmstat Enable the vmstat collector (default: enabled). +# --collector.wifi Enable the wifi collector (default: disabled). +# --collector.xfs Enable the xfs collector (default: enabled). +# --collector.zfs Enable the zfs collector (default: enabled). +# --collector.zoneinfo Enable the zoneinfo collector (default: +# disabled). +# --web.listen-address=":9100" +# Address on which to expose metrics and web +# interface. +# --web.telemetry-path="/metrics" +# Path under which to expose metrics. +# --web.disable-exporter-metrics +# Exclude metrics about the exporter itself +# (promhttp_*, process_*, go_*). +# --web.max-requests=40 Maximum number of parallel scrape requests. Use +# 0 to disable. +# --collector.disable-defaults +# Set all collectors to disabled by default. +# --web.config="" [EXPERIMENTAL] Path to config yaml file that +# can enable TLS or authentication. +# --log.level=info Only log messages with the given severity or +# above. One of: [debug, info, warn, error] +# --log.format=logfmt Output format of log messages. One of: [logfmt, +# json] +# --version Show application version. + diff --git a/config/rootfiles/packages/node_exporter b/config/rootfiles/packages/node_exporter new file mode 100644 index 000000000..994c8365b --- /dev/null +++ b/config/rootfiles/packages/node_exporter @@ -0,0 +1,3 @@ +usr/bin/node_exporter +etc/node_exporter_options +etc/rc.d/init.d/node_exporter diff --git a/lfs/node_exporter b/lfs/node_exporter new file mode 100644 index 000000000..942816754 --- /dev/null +++ b/lfs/node_exporter @@ -0,0 +1,94 @@ +############################################################################## +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007 Michael Tremer & Christian Schmidt # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see http://www.gnu.org/licenses/. # +# # +############################################################################### + +############################################################################### +# Definitions +############################################################################### + +include Config + +VER = 1.1.2 + +THISAPP = node_exporter-$(VER) +DL_FILE = $(THISAPP).tar.gz +DL_FROM = https://github.com/prometheus/node_exporter/archive/v$(VER)/ +DIR_APP = $(DIR_SRC)/$(THISAPP) +TARGET = $(DIR_INFO)/$(THISAPP) +SUP_ARCH = x86_64 i586 aarch64 armv5tel +PROG = node_exporter +PAK_VER = 1 + +DEPS = "" + +############################################################################### +# Top-level Rules +############################################################################### + +objects = $(DL_FILE) + +$(DL_FILE) = $(DL_FROM)/$(DL_FILE) + +$(DL_FILE)_MD5 = 33c2be846dbd502f9c0efab149a8cbc5 + +install : $(TARGET) +check : $(patsubst %,$(DIR_CHK)/%,$(objects)) + +download : $(patsubst %,$(DIR_DL)/%,$(objects)) + +md5 : $(subst %,%_MD5,$(objects)) + +dist : + @$(PAK) + +############################################################################### +# Downloading, checking, md5sum +############################################################################### + +$(patsubst %,$(DIR_CHK)/%,$(objects)) : + @$(CHECK) + +$(patsubst %,$(DIR_DL)/%,$(objects)) : + @$(LOAD) + +$(subst %,%_MD5,$(objects)) : + @$(MD5) + +############################################################################### +# Installation Details +############################################################################### + +$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) + @$(PREBUILD) + @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE) + cd $(DIR_APP) && make build $(MAKETUNING) $(EXTRA_MAKE) + + # install compiled binary + cd $(DIR_APP) && cp node_exporter /usr/bin + + # install configuration file + install -v -m 644 $(DIR_SRC)/config/node_exporter/node_exporter_options \ + /etc/node_exporter_options + + # Install initscript + $(call INSTALL_INITSCRIPT,node_exporter) + + @rm -rf $(DIR_APP) + @$(POSTBUILD) + diff --git a/make.sh b/make.sh index 4af0081e9..671f15558 100755 --- a/make.sh +++ b/make.sh @@ -1632,6 +1632,7 @@ buildipfire() { lfsmake2 socat lfsmake2 libcdada lfsmake2 pmacct + lfsmake2 node_exporter }
buildinstaller() { diff --git a/src/initscripts/packages/node_exporter b/src/initscripts/packages/node_exporter new file mode 100644 index 000000000..b9cbc6ab9 --- /dev/null +++ b/src/initscripts/packages/node_exporter @@ -0,0 +1,42 @@ +#!/bin/sh +######################################################################## +# Begin $rc_base/init.d/ +# +# Description : Prometheus Node Exporter daemon +# +######################################################################## + +. /etc/sysconfig/rc +. ${rc_functions} + +# read configurable OPTIONS +. /etc/node_exporter_options + +case "${1}" in + start) + boot_mesg "Starting..." + loadproc /usr/bin/node_exporter $OPTIONS > /dev/null 2>&1 & + ;; + + stop) + boot_mesg "Stopping..." + killproc /usr/bin/node_exporter + ;; + + restart) + ${0} stop + sleep 1 + ${0} start + ;; + + status) + statusproc /usr/bin/node_exporter + ;; + + *) + echo "Usage: ${0} {start|stop|restart|status}" + exit 1 + ;; +esac + +# End $rc_base/init.d/ diff --git a/src/paks/node_exporter/install.sh b/src/paks/node_exporter/install.sh new file mode 100644 index 000000000..e9272d7cb --- /dev/null +++ b/src/paks/node_exporter/install.sh @@ -0,0 +1,31 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2007 IPFire-Team info@ipfire.org. # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh +extract_files +restore_backup ${NAME} +start_service --background ${NAME} + +ln -svf ../init.d/node_exporter /etc/rc.d/rc0.d/K30node_exporter +ln -svf ../init.d/node_exporter /etc/rc.d/rc3.d/S40node_exporter +ln -svf ../init.d/node_exporter /etc/rc.d/rc6.d/K30node_exporter diff --git a/src/paks/node_exporter/uninstall.sh b/src/paks/node_exporter/uninstall.sh new file mode 100644 index 000000000..710baf8b4 --- /dev/null +++ b/src/paks/node_exporter/uninstall.sh @@ -0,0 +1,30 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2007 IPFire-Team info@ipfire.org. # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh +/etc/init.d/node_exporter stop +make_backup ${NAME} +remove_files + +rm -rfv /etc/rc.d/rc*.d/*node_exporter + diff --git a/src/paks/node_exporter/update.sh b/src/paks/node_exporter/update.sh new file mode 100644 index 000000000..99776659c --- /dev/null +++ b/src/paks/node_exporter/update.sh @@ -0,0 +1,27 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2007-2020 IPFire-Team info@ipfire.org. # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh +extract_backup_includes +./uninstall.sh +./install.sh
Hello,
This looks quite good, too.
Just a minor detail below...
On 6 Jun 2021, at 18:48, Holger Sunke holger.sunke@posteo.de wrote:
config/node_exporter/node_exporter_options | 203 +++++++++++++++++++++ config/rootfiles/packages/node_exporter | 3 + lfs/node_exporter | 94 ++++++++++ make.sh | 1 + src/initscripts/packages/node_exporter | 42 +++++ src/paks/node_exporter/install.sh | 31 ++++ src/paks/node_exporter/uninstall.sh | 30 +++ src/paks/node_exporter/update.sh | 27 +++ 8 files changed, 431 insertions(+) create mode 100644 config/node_exporter/node_exporter_options create mode 100644 config/rootfiles/packages/node_exporter create mode 100644 lfs/node_exporter create mode 100644 src/initscripts/packages/node_exporter create mode 100644 src/paks/node_exporter/install.sh create mode 100644 src/paks/node_exporter/uninstall.sh create mode 100644 src/paks/node_exporter/update.sh
diff --git a/config/node_exporter/node_exporter_options b/config/node_exporter/node_exporter_options new file mode 100644 index 000000000..f614b1102 --- /dev/null +++ b/config/node_exporter/node_exporter_options @@ -0,0 +1,203 @@ +# Customize node_exporter startup command line flags by editing OPTIONS below:
+export OPTIONS="--web.listen-address=:9100"
+#Flags: +# -h, --help Show context-sensitive help (also try +# --help-long and --help-man). +# --collector.bcache.priorityStats +# Expose expensive priority stats. +# --collector.cpu.info Enables metric cpu_info +# --collector.cpu.info.flags-include=COLLECTOR.CPU.INFO.FLAGS-INCLUDE +# Filter the `flags` field in cpuInfo with a +# value that must be a regular expression +# --collector.cpu.info.bugs-include=COLLECTOR.CPU.INFO.BUGS-INCLUDE +# Filter the `bugs` field in cpuInfo with a value +# that must be a regular expression +# --collector.diskstats.ignored-devices="^(ram|loop|fd|(h|s|v|xv)d[a-z]|nvme\d+n\d+p)\d+$" +# Regexp of devices to ignore for diskstats. +# --collector.filesystem.ignored-mount-points="^/(dev|proc|sys|var/lib/docker/.+)($|/)" +# Regexp of mount points to ignore for filesystem +# collector. +# --collector.filesystem.ignored-fs-types="^(autofs|binfmt_misc|bpf|cgroup2?|configfs|debugfs|devpts|devtmpfs|fusectl|hugetlbfs|iso9660|mqueue|nsfs|overlay|proc|procfs|pstore|rpc_pipefs|securityfs|selinuxfs|squashfs|sysfs|tracefs)$" +# Regexp of filesystem types to ignore for +# filesystem collector. +# --collector.ipvs.backend-labels="local_address,local_port,remote_address,remote_port,proto,local_mark" +# Comma separated list for IPVS backend stats +# labels. +# --collector.netclass.ignored-devices="^$" +# Regexp of net devices to ignore for netclass +# collector. +# --collector.netdev.device-include=COLLECTOR.NETDEV.DEVICE-INCLUDE +# Regexp of net devices to include (mutually +# exclusive to device-exclude). +# --collector.netdev.device-exclude=COLLECTOR.NETDEV.DEVICE-EXCLUDE +# Regexp of net devices to exclude (mutually +# exclusive to device-include). +# --collector.netstat.fields="^(.*_(InErrors|InErrs)|Ip_Forwarding|Ip(6|Ext)_(InOctets|OutOctets)|Icmp6?_(InMsgs|OutMsgs)|TcpExt_(Listen.*|Syncookies.*|TCPSynRetrans)|Tcp_(ActiveOpens|InSegs|OutSegs|OutRsts|PassiveOpens|RetransSegs|CurrEstab)|Udp6?_(InDatagrams|OutDatagrams|NoPorts|RcvbufErrors|SndbufErrors))$" +# Regexp of fields to return for netstat +# collector. +# --collector.ntp.server="127.0.0.1" +# NTP server to use for ntp collector +# --collector.ntp.protocol-version=4 +# NTP protocol version +# --collector.ntp.server-is-local +# Certify that collector.ntp.server address is +# not a public ntp server +# --collector.ntp.ip-ttl=1 IP TTL to use while sending NTP query +# --collector.ntp.max-distance=3.46608s +# Max accumulated distance to the root +# --collector.ntp.local-offset-tolerance=1ms +# Offset between local clock and local ntpd time +# to tolerate +# --path.procfs="/proc" procfs mountpoint. +# --path.sysfs="/sys" sysfs mountpoint. +# --path.rootfs="/" rootfs mountpoint. +# --collector.perf.cpus="" List of CPUs from which perf metrics should be +# collected +# --collector.perf.tracepoint=COLLECTOR.PERF.TRACEPOINT ... +# perf tracepoint that should be collected +# --collector.powersupply.ignored-supplies="^$" +# Regexp of power supplies to ignore for +# powersupplyclass collector. +# --collector.qdisc.fixtures="" +# test fixtures to use for qdisc collector +# end-to-end testing +# --collector.runit.servicedir="/etc/service" +# Path to runit service directory. +# --collector.supervisord.url="http://localhost:9001/RPC2" +# XML RPC endpoint. +# --collector.systemd.unit-include=".+" +# Regexp of systemd units to include. Units must +# both match include and not match exclude to be +# included. +# --collector.systemd.unit-exclude=".+\.(automount|device|mount|scope|slice)" +# Regexp of systemd units to exclude. Units must +# both match include and not match exclude to be +# included. +# --collector.systemd.enable-task-metrics +# Enables service unit tasks metrics +# unit_tasks_current and unit_tasks_max +# --collector.systemd.enable-restarts-metrics +# Enables service unit metric +# service_restart_total +# --collector.systemd.enable-start-time-metrics +# Enables service unit metric +# unit_start_time_seconds +# --collector.textfile.directory="" +# Directory to read text files with metrics from. +# --collector.vmstat.fields="^(oom_kill|pgpg|pswp|pg.*fault).*" +# Regexp of fields to return for vmstat +# collector. +# --collector.wifi.fixtures="" +# test fixtures to use for wifi collector metrics +# --collector.arp Enable the arp collector (default: enabled). +# --collector.bcache Enable the bcache collector (default: enabled). +# --collector.bonding Enable the bonding collector (default: +# enabled). +# --collector.btrfs Enable the btrfs collector (default: enabled). +# --collector.buddyinfo Enable the buddyinfo collector (default: +# disabled). +# --collector.conntrack Enable the conntrack collector (default: +# enabled). +# --collector.cpu Enable the cpu collector (default: enabled). +# --collector.cpufreq Enable the cpufreq collector (default: +# enabled). +# --collector.diskstats Enable the diskstats collector (default: +# enabled). +# --collector.drbd Enable the drbd collector (default: disabled). +# --collector.edac Enable the edac collector (default: enabled). +# --collector.entropy Enable the entropy collector (default: +# enabled). +# --collector.fibrechannel Enable the fibrechannel collector (default: +# enabled). +# --collector.filefd Enable the filefd collector (default: enabled). +# --collector.filesystem Enable the filesystem collector (default: +# enabled). +# --collector.hwmon Enable the hwmon collector (default: enabled). +# --collector.infiniband Enable the infiniband collector (default: +# enabled). +# --collector.interrupts Enable the interrupts collector (default: +# disabled). +# --collector.ipvs Enable the ipvs collector (default: enabled). +# --collector.ksmd Enable the ksmd collector (default: disabled). +# --collector.loadavg Enable the loadavg collector (default: +# enabled). +# --collector.logind Enable the logind collector (default: +# disabled). +# --collector.mdadm Enable the mdadm collector (default: enabled). +# --collector.meminfo Enable the meminfo collector (default: +# enabled). +# --collector.meminfo_numa Enable the meminfo_numa collector (default: +# disabled). +# --collector.mountstats Enable the mountstats collector (default: +# disabled). +# --collector.netclass Enable the netclass collector (default: +# enabled). +# --collector.netdev Enable the netdev collector (default: enabled). +# --collector.netstat Enable the netstat collector (default: +# enabled). +# --collector.network_route Enable the network_route collector (default: +# disabled). +# --collector.nfs Enable the nfs collector (default: enabled). +# --collector.nfsd Enable the nfsd collector (default: enabled). +# --collector.ntp Enable the ntp collector (default: disabled). +# --collector.perf Enable the perf collector (default: disabled). +# --collector.powersupplyclass +# Enable the powersupplyclass collector (default: +# enabled). +# --collector.pressure Enable the pressure collector (default: +# enabled). +# --collector.processes Enable the processes collector (default: +# disabled). +# --collector.qdisc Enable the qdisc collector (default: disabled). +# --collector.rapl Enable the rapl collector (default: enabled). +# --collector.runit Enable the runit collector (default: disabled). +# --collector.schedstat Enable the schedstat collector (default: +# enabled). +# --collector.sockstat Enable the sockstat collector (default: +# enabled). +# --collector.softnet Enable the softnet collector (default: +# enabled). +# --collector.stat Enable the stat collector (default: enabled). +# --collector.supervisord Enable the supervisord collector (default: +# disabled). +# --collector.systemd Enable the systemd collector (default: +# disabled). +# --collector.tcpstat Enable the tcpstat collector (default: +# disabled). +# --collector.textfile Enable the textfile collector (default: +# enabled). +# --collector.thermal_zone Enable the thermal_zone collector (default: +# enabled). +# --collector.time Enable the time collector (default: enabled). +# --collector.timex Enable the timex collector (default: enabled). +# --collector.udp_queues Enable the udp_queues collector (default: +# enabled). +# --collector.uname Enable the uname collector (default: enabled). +# --collector.vmstat Enable the vmstat collector (default: enabled). +# --collector.wifi Enable the wifi collector (default: disabled). +# --collector.xfs Enable the xfs collector (default: enabled). +# --collector.zfs Enable the zfs collector (default: enabled). +# --collector.zoneinfo Enable the zoneinfo collector (default: +# disabled). +# --web.listen-address=":9100" +# Address on which to expose metrics and web +# interface. +# --web.telemetry-path="/metrics" +# Path under which to expose metrics. +# --web.disable-exporter-metrics +# Exclude metrics about the exporter itself +# (promhttp_*, process_*, go_*). +# --web.max-requests=40 Maximum number of parallel scrape requests. Use +# 0 to disable. +# --collector.disable-defaults +# Set all collectors to disabled by default. +# --web.config="" [EXPERIMENTAL] Path to config yaml file that +# can enable TLS or authentication. +# --log.level=info Only log messages with the given severity or +# above. One of: [debug, info, warn, error] +# --log.format=logfmt Output format of log messages. One of: [logfmt, +# json] +# --version Show application version.
diff --git a/config/rootfiles/packages/node_exporter b/config/rootfiles/packages/node_exporter new file mode 100644 index 000000000..994c8365b --- /dev/null +++ b/config/rootfiles/packages/node_exporter @@ -0,0 +1,3 @@ +usr/bin/node_exporter +etc/node_exporter_options +etc/rc.d/init.d/node_exporter diff --git a/lfs/node_exporter b/lfs/node_exporter new file mode 100644 index 000000000..942816754 --- /dev/null +++ b/lfs/node_exporter @@ -0,0 +1,94 @@ +############################################################################## +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007 Michael Tremer & Christian Schmidt # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see http://www.gnu.org/licenses/. # +# # +###############################################################################
+############################################################################### +# Definitions +###############################################################################
+include Config
+VER = 1.1.2
+THISAPP = node_exporter-$(VER) +DL_FILE = $(THISAPP).tar.gz +DL_FROM = https://github.com/prometheus/node_exporter/archive/v$(VER)/ +DIR_APP = $(DIR_SRC)/$(THISAPP) +TARGET = $(DIR_INFO)/$(THISAPP) +SUP_ARCH = x86_64 i586 aarch64 armv5tel +PROG = node_exporter +PAK_VER = 1
+DEPS = ""
+############################################################################### +# Top-level Rules +###############################################################################
+objects = $(DL_FILE)
+$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
+$(DL_FILE)_MD5 = 33c2be846dbd502f9c0efab149a8cbc5
+install : $(TARGET) +check : $(patsubst %,$(DIR_CHK)/%,$(objects))
+download : $(patsubst %,$(DIR_DL)/%,$(objects))
+md5 : $(subst %,%_MD5,$(objects))
+dist :
- @$(PAK)
+############################################################################### +# Downloading, checking, md5sum +###############################################################################
+$(patsubst %,$(DIR_CHK)/%,$(objects)) :
- @$(CHECK)
+$(patsubst %,$(DIR_DL)/%,$(objects)) :
- @$(LOAD)
+$(subst %,%_MD5,$(objects)) :
- @$(MD5)
+############################################################################### +# Installation Details +###############################################################################
+$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
- @$(PREBUILD)
- @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
- cd $(DIR_APP) && make build $(MAKETUNING) $(EXTRA_MAKE)
- # install compiled binary
- cd $(DIR_APP) && cp node_exporter /usr/bin
- # install configuration file
- install -v -m 644 $(DIR_SRC)/config/node_exporter/node_exporter_options \
/etc/node_exporter_options
- # Install initscript
- $(call INSTALL_INITSCRIPT,node_exporter)
- @rm -rf $(DIR_APP)
- @$(POSTBUILD)
diff --git a/make.sh b/make.sh index 4af0081e9..671f15558 100755 --- a/make.sh +++ b/make.sh @@ -1632,6 +1632,7 @@ buildipfire() { lfsmake2 socat lfsmake2 libcdada lfsmake2 pmacct
- lfsmake2 node_exporter
}
buildinstaller() { diff --git a/src/initscripts/packages/node_exporter b/src/initscripts/packages/node_exporter new file mode 100644 index 000000000..b9cbc6ab9 --- /dev/null +++ b/src/initscripts/packages/node_exporter @@ -0,0 +1,42 @@ +#!/bin/sh +######################################################################## +# Begin $rc_base/init.d/ +# +# Description : Prometheus Node Exporter daemon +# +########################################################################
+. /etc/sysconfig/rc +. ${rc_functions}
+# read configurable OPTIONS +. /etc/node_exporter_options
+case "${1}" in
- start)
boot_mesg "Starting..."
The “Starting…” line normally has the name of the program.
loadproc /usr/bin/node_exporter $OPTIONS > /dev/null 2>&1 &
You are throwing away the output of loadproc as well as any potential error messages.
Does this program have a way to fork itself into the background?
;;
- stop)
boot_mesg "Stopping..."
Same here.
killproc /usr/bin/node_exporter
;;
- restart)
${0} stop
sleep 1
${0} start
;;
- status)
statusproc /usr/bin/node_exporter
;;
- *)
echo "Usage: ${0} {start|stop|restart|status}"
exit 1
;;
+esac
+# End $rc_base/init.d/ diff --git a/src/paks/node_exporter/install.sh b/src/paks/node_exporter/install.sh new file mode 100644 index 000000000..e9272d7cb --- /dev/null +++ b/src/paks/node_exporter/install.sh @@ -0,0 +1,31 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2007 IPFire-Team info@ipfire.org. # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh +extract_files +restore_backup ${NAME} +start_service --background ${NAME}
+ln -svf ../init.d/node_exporter /etc/rc.d/rc0.d/K30node_exporter +ln -svf ../init.d/node_exporter /etc/rc.d/rc3.d/S40node_exporter +ln -svf ../init.d/node_exporter /etc/rc.d/rc6.d/K30node_exporter diff --git a/src/paks/node_exporter/uninstall.sh b/src/paks/node_exporter/uninstall.sh new file mode 100644 index 000000000..710baf8b4 --- /dev/null +++ b/src/paks/node_exporter/uninstall.sh @@ -0,0 +1,30 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2007 IPFire-Team info@ipfire.org. # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh +/etc/init.d/node_exporter stop +make_backup ${NAME} +remove_files
+rm -rfv /etc/rc.d/rc*.d/*node_exporter
diff --git a/src/paks/node_exporter/update.sh b/src/paks/node_exporter/update.sh new file mode 100644 index 000000000..99776659c --- /dev/null +++ b/src/paks/node_exporter/update.sh @@ -0,0 +1,27 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2007-2020 IPFire-Team info@ipfire.org. # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh +extract_backup_includes +./uninstall.sh
+./install.sh
2.30.2
Hello Michael,
the node exporter does not have a daemon mode. I could alternatively pip the output into a log file:
loadproc /usr/bin/node_exporter $OPTIONS >> /var/log/node_exporter.log 2>&1 &
Should I add a third patch to do my fixes or adjust patch 1 & 2 each?
Kind regards
Holger
Am 08.06.21 um 18:56 schrieb Michael Tremer:
Hello,
This looks quite good, too.
Just a minor detail below...
On 6 Jun 2021, at 18:48, Holger Sunke holger.sunke@posteo.de wrote:
config/node_exporter/node_exporter_options | 203 +++++++++++++++++++++ config/rootfiles/packages/node_exporter | 3 + lfs/node_exporter | 94 ++++++++++ make.sh | 1 + src/initscripts/packages/node_exporter | 42 +++++ src/paks/node_exporter/install.sh | 31 ++++ src/paks/node_exporter/uninstall.sh | 30 +++ src/paks/node_exporter/update.sh | 27 +++ 8 files changed, 431 insertions(+) create mode 100644 config/node_exporter/node_exporter_options create mode 100644 config/rootfiles/packages/node_exporter create mode 100644 lfs/node_exporter create mode 100644 src/initscripts/packages/node_exporter create mode 100644 src/paks/node_exporter/install.sh create mode 100644 src/paks/node_exporter/uninstall.sh create mode 100644 src/paks/node_exporter/update.sh
diff --git a/config/node_exporter/node_exporter_options b/config/node_exporter/node_exporter_options new file mode 100644 index 000000000..f614b1102 --- /dev/null +++ b/config/node_exporter/node_exporter_options @@ -0,0 +1,203 @@ +# Customize node_exporter startup command line flags by editing OPTIONS below:
+export OPTIONS="--web.listen-address=:9100"
+#Flags: +# -h, --help Show context-sensitive help (also try +# --help-long and --help-man). +# --collector.bcache.priorityStats +# Expose expensive priority stats. +# --collector.cpu.info Enables metric cpu_info +# --collector.cpu.info.flags-include=COLLECTOR.CPU.INFO.FLAGS-INCLUDE +# Filter the `flags` field in cpuInfo with a +# value that must be a regular expression +# --collector.cpu.info.bugs-include=COLLECTOR.CPU.INFO.BUGS-INCLUDE +# Filter the `bugs` field in cpuInfo with a value +# that must be a regular expression +# --collector.diskstats.ignored-devices="^(ram|loop|fd|(h|s|v|xv)d[a-z]|nvme\d+n\d+p)\d+$" +# Regexp of devices to ignore for diskstats. +# --collector.filesystem.ignored-mount-points="^/(dev|proc|sys|var/lib/docker/.+)($|/)" +# Regexp of mount points to ignore for filesystem +# collector. +# --collector.filesystem.ignored-fs-types="^(autofs|binfmt_misc|bpf|cgroup2?|configfs|debugfs|devpts|devtmpfs|fusectl|hugetlbfs|iso9660|mqueue|nsfs|overlay|proc|procfs|pstore|rpc_pipefs|securityfs|selinuxfs|squashfs|sysfs|tracefs)$" +# Regexp of filesystem types to ignore for +# filesystem collector. +# --collector.ipvs.backend-labels="local_address,local_port,remote_address,remote_port,proto,local_mark" +# Comma separated list for IPVS backend stats +# labels. +# --collector.netclass.ignored-devices="^$" +# Regexp of net devices to ignore for netclass +# collector. +# --collector.netdev.device-include=COLLECTOR.NETDEV.DEVICE-INCLUDE +# Regexp of net devices to include (mutually +# exclusive to device-exclude). +# --collector.netdev.device-exclude=COLLECTOR.NETDEV.DEVICE-EXCLUDE +# Regexp of net devices to exclude (mutually +# exclusive to device-include). +# --collector.netstat.fields="^(.*_(InErrors|InErrs)|Ip_Forwarding|Ip(6|Ext)_(InOctets|OutOctets)|Icmp6?_(InMsgs|OutMsgs)|TcpExt_(Listen.*|Syncookies.*|TCPSynRetrans)|Tcp_(ActiveOpens|InSegs|OutSegs|OutRsts|PassiveOpens|RetransSegs|CurrEstab)|Udp6?_(InDatagrams|OutDatagrams|NoPorts|RcvbufErrors|SndbufErrors))$" +# Regexp of fields to return for netstat +# collector. +# --collector.ntp.server="127.0.0.1" +# NTP server to use for ntp collector +# --collector.ntp.protocol-version=4 +# NTP protocol version +# --collector.ntp.server-is-local +# Certify that collector.ntp.server address is +# not a public ntp server +# --collector.ntp.ip-ttl=1 IP TTL to use while sending NTP query +# --collector.ntp.max-distance=3.46608s +# Max accumulated distance to the root +# --collector.ntp.local-offset-tolerance=1ms +# Offset between local clock and local ntpd time +# to tolerate +# --path.procfs="/proc" procfs mountpoint. +# --path.sysfs="/sys" sysfs mountpoint. +# --path.rootfs="/" rootfs mountpoint. +# --collector.perf.cpus="" List of CPUs from which perf metrics should be +# collected +# --collector.perf.tracepoint=COLLECTOR.PERF.TRACEPOINT ... +# perf tracepoint that should be collected +# --collector.powersupply.ignored-supplies="^$" +# Regexp of power supplies to ignore for +# powersupplyclass collector. +# --collector.qdisc.fixtures="" +# test fixtures to use for qdisc collector +# end-to-end testing +# --collector.runit.servicedir="/etc/service" +# Path to runit service directory. +# --collector.supervisord.url="http://localhost:9001/RPC2" +# XML RPC endpoint. +# --collector.systemd.unit-include=".+" +# Regexp of systemd units to include. Units must +# both match include and not match exclude to be +# included. +# --collector.systemd.unit-exclude=".+\.(automount|device|mount|scope|slice)" +# Regexp of systemd units to exclude. Units must +# both match include and not match exclude to be +# included. +# --collector.systemd.enable-task-metrics +# Enables service unit tasks metrics +# unit_tasks_current and unit_tasks_max +# --collector.systemd.enable-restarts-metrics +# Enables service unit metric +# service_restart_total +# --collector.systemd.enable-start-time-metrics +# Enables service unit metric +# unit_start_time_seconds +# --collector.textfile.directory="" +# Directory to read text files with metrics from. +# --collector.vmstat.fields="^(oom_kill|pgpg|pswp|pg.*fault).*" +# Regexp of fields to return for vmstat +# collector. +# --collector.wifi.fixtures="" +# test fixtures to use for wifi collector metrics +# --collector.arp Enable the arp collector (default: enabled). +# --collector.bcache Enable the bcache collector (default: enabled). +# --collector.bonding Enable the bonding collector (default: +# enabled). +# --collector.btrfs Enable the btrfs collector (default: enabled). +# --collector.buddyinfo Enable the buddyinfo collector (default: +# disabled). +# --collector.conntrack Enable the conntrack collector (default: +# enabled). +# --collector.cpu Enable the cpu collector (default: enabled). +# --collector.cpufreq Enable the cpufreq collector (default: +# enabled). +# --collector.diskstats Enable the diskstats collector (default: +# enabled). +# --collector.drbd Enable the drbd collector (default: disabled). +# --collector.edac Enable the edac collector (default: enabled). +# --collector.entropy Enable the entropy collector (default: +# enabled). +# --collector.fibrechannel Enable the fibrechannel collector (default: +# enabled). +# --collector.filefd Enable the filefd collector (default: enabled). +# --collector.filesystem Enable the filesystem collector (default: +# enabled). +# --collector.hwmon Enable the hwmon collector (default: enabled). +# --collector.infiniband Enable the infiniband collector (default: +# enabled). +# --collector.interrupts Enable the interrupts collector (default: +# disabled). +# --collector.ipvs Enable the ipvs collector (default: enabled). +# --collector.ksmd Enable the ksmd collector (default: disabled). +# --collector.loadavg Enable the loadavg collector (default: +# enabled). +# --collector.logind Enable the logind collector (default: +# disabled). +# --collector.mdadm Enable the mdadm collector (default: enabled). +# --collector.meminfo Enable the meminfo collector (default: +# enabled). +# --collector.meminfo_numa Enable the meminfo_numa collector (default: +# disabled). +# --collector.mountstats Enable the mountstats collector (default: +# disabled). +# --collector.netclass Enable the netclass collector (default: +# enabled). +# --collector.netdev Enable the netdev collector (default: enabled). +# --collector.netstat Enable the netstat collector (default: +# enabled). +# --collector.network_route Enable the network_route collector (default: +# disabled). +# --collector.nfs Enable the nfs collector (default: enabled). +# --collector.nfsd Enable the nfsd collector (default: enabled). +# --collector.ntp Enable the ntp collector (default: disabled). +# --collector.perf Enable the perf collector (default: disabled). +# --collector.powersupplyclass +# Enable the powersupplyclass collector (default: +# enabled). +# --collector.pressure Enable the pressure collector (default: +# enabled). +# --collector.processes Enable the processes collector (default: +# disabled). +# --collector.qdisc Enable the qdisc collector (default: disabled). +# --collector.rapl Enable the rapl collector (default: enabled). +# --collector.runit Enable the runit collector (default: disabled). +# --collector.schedstat Enable the schedstat collector (default: +# enabled). +# --collector.sockstat Enable the sockstat collector (default: +# enabled). +# --collector.softnet Enable the softnet collector (default: +# enabled). +# --collector.stat Enable the stat collector (default: enabled). +# --collector.supervisord Enable the supervisord collector (default: +# disabled). +# --collector.systemd Enable the systemd collector (default: +# disabled). +# --collector.tcpstat Enable the tcpstat collector (default: +# disabled). +# --collector.textfile Enable the textfile collector (default: +# enabled). +# --collector.thermal_zone Enable the thermal_zone collector (default: +# enabled). +# --collector.time Enable the time collector (default: enabled). +# --collector.timex Enable the timex collector (default: enabled). +# --collector.udp_queues Enable the udp_queues collector (default: +# enabled). +# --collector.uname Enable the uname collector (default: enabled). +# --collector.vmstat Enable the vmstat collector (default: enabled). +# --collector.wifi Enable the wifi collector (default: disabled). +# --collector.xfs Enable the xfs collector (default: enabled). +# --collector.zfs Enable the zfs collector (default: enabled). +# --collector.zoneinfo Enable the zoneinfo collector (default: +# disabled). +# --web.listen-address=":9100" +# Address on which to expose metrics and web +# interface. +# --web.telemetry-path="/metrics" +# Path under which to expose metrics. +# --web.disable-exporter-metrics +# Exclude metrics about the exporter itself +# (promhttp_*, process_*, go_*). +# --web.max-requests=40 Maximum number of parallel scrape requests. Use +# 0 to disable. +# --collector.disable-defaults +# Set all collectors to disabled by default. +# --web.config="" [EXPERIMENTAL] Path to config yaml file that +# can enable TLS or authentication. +# --log.level=info Only log messages with the given severity or +# above. One of: [debug, info, warn, error] +# --log.format=logfmt Output format of log messages. One of: [logfmt, +# json] +# --version Show application version.
diff --git a/config/rootfiles/packages/node_exporter b/config/rootfiles/packages/node_exporter new file mode 100644 index 000000000..994c8365b --- /dev/null +++ b/config/rootfiles/packages/node_exporter @@ -0,0 +1,3 @@ +usr/bin/node_exporter +etc/node_exporter_options +etc/rc.d/init.d/node_exporter diff --git a/lfs/node_exporter b/lfs/node_exporter new file mode 100644 index 000000000..942816754 --- /dev/null +++ b/lfs/node_exporter @@ -0,0 +1,94 @@ +############################################################################## +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007 Michael Tremer & Christian Schmidt # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see http://www.gnu.org/licenses/. # +# # +###############################################################################
+############################################################################### +# Definitions +###############################################################################
+include Config
+VER = 1.1.2
+THISAPP = node_exporter-$(VER) +DL_FILE = $(THISAPP).tar.gz +DL_FROM = https://github.com/prometheus/node_exporter/archive/v$(VER)/ +DIR_APP = $(DIR_SRC)/$(THISAPP) +TARGET = $(DIR_INFO)/$(THISAPP) +SUP_ARCH = x86_64 i586 aarch64 armv5tel +PROG = node_exporter +PAK_VER = 1
+DEPS = ""
+############################################################################### +# Top-level Rules +###############################################################################
+objects = $(DL_FILE)
+$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
+$(DL_FILE)_MD5 = 33c2be846dbd502f9c0efab149a8cbc5
+install : $(TARGET) +check : $(patsubst %,$(DIR_CHK)/%,$(objects))
+download : $(patsubst %,$(DIR_DL)/%,$(objects))
+md5 : $(subst %,%_MD5,$(objects))
+dist :
- @$(PAK)
+############################################################################### +# Downloading, checking, md5sum +###############################################################################
+$(patsubst %,$(DIR_CHK)/%,$(objects)) :
- @$(CHECK)
+$(patsubst %,$(DIR_DL)/%,$(objects)) :
- @$(LOAD)
+$(subst %,%_MD5,$(objects)) :
- @$(MD5)
+############################################################################### +# Installation Details +###############################################################################
+$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
- @$(PREBUILD)
- @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
- cd $(DIR_APP) && make build $(MAKETUNING) $(EXTRA_MAKE)
- # install compiled binary
- cd $(DIR_APP) && cp node_exporter /usr/bin
- # install configuration file
- install -v -m 644 $(DIR_SRC)/config/node_exporter/node_exporter_options \
/etc/node_exporter_options
- # Install initscript
- $(call INSTALL_INITSCRIPT,node_exporter)
- @rm -rf $(DIR_APP)
- @$(POSTBUILD)
diff --git a/make.sh b/make.sh index 4af0081e9..671f15558 100755 --- a/make.sh +++ b/make.sh @@ -1632,6 +1632,7 @@ buildipfire() { lfsmake2 socat lfsmake2 libcdada lfsmake2 pmacct
- lfsmake2 node_exporter
}
buildinstaller() { diff --git a/src/initscripts/packages/node_exporter b/src/initscripts/packages/node_exporter new file mode 100644 index 000000000..b9cbc6ab9 --- /dev/null +++ b/src/initscripts/packages/node_exporter @@ -0,0 +1,42 @@ +#!/bin/sh +######################################################################## +# Begin $rc_base/init.d/ +# +# Description : Prometheus Node Exporter daemon +# +########################################################################
+. /etc/sysconfig/rc +. ${rc_functions}
+# read configurable OPTIONS +. /etc/node_exporter_options
+case "${1}" in
- start)
boot_mesg "Starting..."
The “Starting…” line normally has the name of the program.
loadproc /usr/bin/node_exporter $OPTIONS > /dev/null 2>&1 &
You are throwing away the output of loadproc as well as any potential error messages.
Does this program have a way to fork itself into the background?
;;
- stop)
boot_mesg "Stopping..."
Same here.
killproc /usr/bin/node_exporter
;;
- restart)
${0} stop
sleep 1
${0} start
;;
- status)
statusproc /usr/bin/node_exporter
;;
- *)
echo "Usage: ${0} {start|stop|restart|status}"
exit 1
;;
+esac
+# End $rc_base/init.d/ diff --git a/src/paks/node_exporter/install.sh b/src/paks/node_exporter/install.sh new file mode 100644 index 000000000..e9272d7cb --- /dev/null +++ b/src/paks/node_exporter/install.sh @@ -0,0 +1,31 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2007 IPFire-Team info@ipfire.org. # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh +extract_files +restore_backup ${NAME} +start_service --background ${NAME}
+ln -svf ../init.d/node_exporter /etc/rc.d/rc0.d/K30node_exporter +ln -svf ../init.d/node_exporter /etc/rc.d/rc3.d/S40node_exporter +ln -svf ../init.d/node_exporter /etc/rc.d/rc6.d/K30node_exporter diff --git a/src/paks/node_exporter/uninstall.sh b/src/paks/node_exporter/uninstall.sh new file mode 100644 index 000000000..710baf8b4 --- /dev/null +++ b/src/paks/node_exporter/uninstall.sh @@ -0,0 +1,30 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2007 IPFire-Team info@ipfire.org. # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh +/etc/init.d/node_exporter stop +make_backup ${NAME} +remove_files
+rm -rfv /etc/rc.d/rc*.d/*node_exporter
diff --git a/src/paks/node_exporter/update.sh b/src/paks/node_exporter/update.sh new file mode 100644 index 000000000..99776659c --- /dev/null +++ b/src/paks/node_exporter/update.sh @@ -0,0 +1,27 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2007-2020 IPFire-Team info@ipfire.org. # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh +extract_backup_includes +./uninstall.sh
+./install.sh
2.30.2
Hello,
On 9 Jun 2021, at 07:14, Holger Sunke holger.sunke@posteo.de wrote:
Hello Michael,
the node exporter does not have a daemon mode. I could alternatively pip the output into a log file:
loadproc /usr/bin/node_exporter $OPTIONS >> /var/log/node_exporter.log 2>&1 &
Hmm, so there are two problems here:
* loadproc shows [ OK ] or [ ERROR ] so that the user knows if the program was started successfully. That is now being thrown away.
* Anything useful that node_exporter would print is also being thrown away
This seems to become a common thing that they remove the fork mode, maybe we need a special version of loadproc() that can handle that.
Should I add a third patch to do my fixes or adjust patch 1 & 2 each?
Let’s work on Go first and get that merged and then come back to this one.
We need to have a solution first and then implement it.
-Michael
Kind regards
Holger
Am 08.06.21 um 18:56 schrieb Michael Tremer:
Hello, This looks quite good, too. Just a minor detail below...
On 6 Jun 2021, at 18:48, Holger Sunke holger.sunke@posteo.de wrote:
config/node_exporter/node_exporter_options | 203 +++++++++++++++++++++ config/rootfiles/packages/node_exporter | 3 + lfs/node_exporter | 94 ++++++++++ make.sh | 1 + src/initscripts/packages/node_exporter | 42 +++++ src/paks/node_exporter/install.sh | 31 ++++ src/paks/node_exporter/uninstall.sh | 30 +++ src/paks/node_exporter/update.sh | 27 +++ 8 files changed, 431 insertions(+) create mode 100644 config/node_exporter/node_exporter_options create mode 100644 config/rootfiles/packages/node_exporter create mode 100644 lfs/node_exporter create mode 100644 src/initscripts/packages/node_exporter create mode 100644 src/paks/node_exporter/install.sh create mode 100644 src/paks/node_exporter/uninstall.sh create mode 100644 src/paks/node_exporter/update.sh
diff --git a/config/node_exporter/node_exporter_options b/config/node_exporter/node_exporter_options new file mode 100644 index 000000000..f614b1102 --- /dev/null +++ b/config/node_exporter/node_exporter_options @@ -0,0 +1,203 @@ +# Customize node_exporter startup command line flags by editing OPTIONS below:
+export OPTIONS="--web.listen-address=:9100"
+#Flags: +# -h, --help Show context-sensitive help (also try +# --help-long and --help-man). +# --collector.bcache.priorityStats +# Expose expensive priority stats. +# --collector.cpu.info Enables metric cpu_info +# --collector.cpu.info.flags-include=COLLECTOR.CPU.INFO.FLAGS-INCLUDE +# Filter the `flags` field in cpuInfo with a +# value that must be a regular expression +# --collector.cpu.info.bugs-include=COLLECTOR.CPU.INFO.BUGS-INCLUDE +# Filter the `bugs` field in cpuInfo with a value +# that must be a regular expression +# --collector.diskstats.ignored-devices="^(ram|loop|fd|(h|s|v|xv)d[a-z]|nvme\d+n\d+p)\d+$" +# Regexp of devices to ignore for diskstats. +# --collector.filesystem.ignored-mount-points="^/(dev|proc|sys|var/lib/docker/.+)($|/)" +# Regexp of mount points to ignore for filesystem +# collector. +# --collector.filesystem.ignored-fs-types="^(autofs|binfmt_misc|bpf|cgroup2?|configfs|debugfs|devpts|devtmpfs|fusectl|hugetlbfs|iso9660|mqueue|nsfs|overlay|proc|procfs|pstore|rpc_pipefs|securityfs|selinuxfs|squashfs|sysfs|tracefs)$" +# Regexp of filesystem types to ignore for +# filesystem collector. +# --collector.ipvs.backend-labels="local_address,local_port,remote_address,remote_port,proto,local_mark" +# Comma separated list for IPVS backend stats +# labels. +# --collector.netclass.ignored-devices="^$" +# Regexp of net devices to ignore for netclass +# collector. +# --collector.netdev.device-include=COLLECTOR.NETDEV.DEVICE-INCLUDE +# Regexp of net devices to include (mutually +# exclusive to device-exclude). +# --collector.netdev.device-exclude=COLLECTOR.NETDEV.DEVICE-EXCLUDE +# Regexp of net devices to exclude (mutually +# exclusive to device-include). +# --collector.netstat.fields="^(.*_(InErrors|InErrs)|Ip_Forwarding|Ip(6|Ext)_(InOctets|OutOctets)|Icmp6?_(InMsgs|OutMsgs)|TcpExt_(Listen.*|Syncookies.*|TCPSynRetrans)|Tcp_(ActiveOpens|InSegs|OutSegs|OutRsts|PassiveOpens|RetransSegs|CurrEstab)|Udp6?_(InDatagrams|OutDatagrams|NoPorts|RcvbufErrors|SndbufErrors))$" +# Regexp of fields to return for netstat +# collector. +# --collector.ntp.server="127.0.0.1" +# NTP server to use for ntp collector +# --collector.ntp.protocol-version=4 +# NTP protocol version +# --collector.ntp.server-is-local +# Certify that collector.ntp.server address is +# not a public ntp server +# --collector.ntp.ip-ttl=1 IP TTL to use while sending NTP query +# --collector.ntp.max-distance=3.46608s +# Max accumulated distance to the root +# --collector.ntp.local-offset-tolerance=1ms +# Offset between local clock and local ntpd time +# to tolerate +# --path.procfs="/proc" procfs mountpoint. +# --path.sysfs="/sys" sysfs mountpoint. +# --path.rootfs="/" rootfs mountpoint. +# --collector.perf.cpus="" List of CPUs from which perf metrics should be +# collected +# --collector.perf.tracepoint=COLLECTOR.PERF.TRACEPOINT ... +# perf tracepoint that should be collected +# --collector.powersupply.ignored-supplies="^$" +# Regexp of power supplies to ignore for +# powersupplyclass collector. +# --collector.qdisc.fixtures="" +# test fixtures to use for qdisc collector +# end-to-end testing +# --collector.runit.servicedir="/etc/service" +# Path to runit service directory. +# --collector.supervisord.url="http://localhost:9001/RPC2" +# XML RPC endpoint. +# --collector.systemd.unit-include=".+" +# Regexp of systemd units to include. Units must +# both match include and not match exclude to be +# included. +# --collector.systemd.unit-exclude=".+\.(automount|device|mount|scope|slice)" +# Regexp of systemd units to exclude. Units must +# both match include and not match exclude to be +# included. +# --collector.systemd.enable-task-metrics +# Enables service unit tasks metrics +# unit_tasks_current and unit_tasks_max +# --collector.systemd.enable-restarts-metrics +# Enables service unit metric +# service_restart_total +# --collector.systemd.enable-start-time-metrics +# Enables service unit metric +# unit_start_time_seconds +# --collector.textfile.directory="" +# Directory to read text files with metrics from. +# --collector.vmstat.fields="^(oom_kill|pgpg|pswp|pg.*fault).*" +# Regexp of fields to return for vmstat +# collector. +# --collector.wifi.fixtures="" +# test fixtures to use for wifi collector metrics +# --collector.arp Enable the arp collector (default: enabled). +# --collector.bcache Enable the bcache collector (default: enabled). +# --collector.bonding Enable the bonding collector (default: +# enabled). +# --collector.btrfs Enable the btrfs collector (default: enabled). +# --collector.buddyinfo Enable the buddyinfo collector (default: +# disabled). +# --collector.conntrack Enable the conntrack collector (default: +# enabled). +# --collector.cpu Enable the cpu collector (default: enabled). +# --collector.cpufreq Enable the cpufreq collector (default: +# enabled). +# --collector.diskstats Enable the diskstats collector (default: +# enabled). +# --collector.drbd Enable the drbd collector (default: disabled). +# --collector.edac Enable the edac collector (default: enabled). +# --collector.entropy Enable the entropy collector (default: +# enabled). +# --collector.fibrechannel Enable the fibrechannel collector (default: +# enabled). +# --collector.filefd Enable the filefd collector (default: enabled). +# --collector.filesystem Enable the filesystem collector (default: +# enabled). +# --collector.hwmon Enable the hwmon collector (default: enabled). +# --collector.infiniband Enable the infiniband collector (default: +# enabled). +# --collector.interrupts Enable the interrupts collector (default: +# disabled). +# --collector.ipvs Enable the ipvs collector (default: enabled). +# --collector.ksmd Enable the ksmd collector (default: disabled). +# --collector.loadavg Enable the loadavg collector (default: +# enabled). +# --collector.logind Enable the logind collector (default: +# disabled). +# --collector.mdadm Enable the mdadm collector (default: enabled). +# --collector.meminfo Enable the meminfo collector (default: +# enabled). +# --collector.meminfo_numa Enable the meminfo_numa collector (default: +# disabled). +# --collector.mountstats Enable the mountstats collector (default: +# disabled). +# --collector.netclass Enable the netclass collector (default: +# enabled). +# --collector.netdev Enable the netdev collector (default: enabled). +# --collector.netstat Enable the netstat collector (default: +# enabled). +# --collector.network_route Enable the network_route collector (default: +# disabled). +# --collector.nfs Enable the nfs collector (default: enabled). +# --collector.nfsd Enable the nfsd collector (default: enabled). +# --collector.ntp Enable the ntp collector (default: disabled). +# --collector.perf Enable the perf collector (default: disabled). +# --collector.powersupplyclass +# Enable the powersupplyclass collector (default: +# enabled). +# --collector.pressure Enable the pressure collector (default: +# enabled). +# --collector.processes Enable the processes collector (default: +# disabled). +# --collector.qdisc Enable the qdisc collector (default: disabled). +# --collector.rapl Enable the rapl collector (default: enabled). +# --collector.runit Enable the runit collector (default: disabled). +# --collector.schedstat Enable the schedstat collector (default: +# enabled). +# --collector.sockstat Enable the sockstat collector (default: +# enabled). +# --collector.softnet Enable the softnet collector (default: +# enabled). +# --collector.stat Enable the stat collector (default: enabled). +# --collector.supervisord Enable the supervisord collector (default: +# disabled). +# --collector.systemd Enable the systemd collector (default: +# disabled). +# --collector.tcpstat Enable the tcpstat collector (default: +# disabled). +# --collector.textfile Enable the textfile collector (default: +# enabled). +# --collector.thermal_zone Enable the thermal_zone collector (default: +# enabled). +# --collector.time Enable the time collector (default: enabled). +# --collector.timex Enable the timex collector (default: enabled). +# --collector.udp_queues Enable the udp_queues collector (default: +# enabled). +# --collector.uname Enable the uname collector (default: enabled). +# --collector.vmstat Enable the vmstat collector (default: enabled). +# --collector.wifi Enable the wifi collector (default: disabled). +# --collector.xfs Enable the xfs collector (default: enabled). +# --collector.zfs Enable the zfs collector (default: enabled). +# --collector.zoneinfo Enable the zoneinfo collector (default: +# disabled). +# --web.listen-address=":9100" +# Address on which to expose metrics and web +# interface. +# --web.telemetry-path="/metrics" +# Path under which to expose metrics. +# --web.disable-exporter-metrics +# Exclude metrics about the exporter itself +# (promhttp_*, process_*, go_*). +# --web.max-requests=40 Maximum number of parallel scrape requests. Use +# 0 to disable. +# --collector.disable-defaults +# Set all collectors to disabled by default. +# --web.config="" [EXPERIMENTAL] Path to config yaml file that +# can enable TLS or authentication. +# --log.level=info Only log messages with the given severity or +# above. One of: [debug, info, warn, error] +# --log.format=logfmt Output format of log messages. One of: [logfmt, +# json] +# --version Show application version.
diff --git a/config/rootfiles/packages/node_exporter b/config/rootfiles/packages/node_exporter new file mode 100644 index 000000000..994c8365b --- /dev/null +++ b/config/rootfiles/packages/node_exporter @@ -0,0 +1,3 @@ +usr/bin/node_exporter +etc/node_exporter_options +etc/rc.d/init.d/node_exporter diff --git a/lfs/node_exporter b/lfs/node_exporter new file mode 100644 index 000000000..942816754 --- /dev/null +++ b/lfs/node_exporter @@ -0,0 +1,94 @@ +############################################################################## +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007 Michael Tremer & Christian Schmidt # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see http://www.gnu.org/licenses/. # +# # +###############################################################################
+############################################################################### +# Definitions +###############################################################################
+include Config
+VER = 1.1.2
+THISAPP = node_exporter-$(VER) +DL_FILE = $(THISAPP).tar.gz +DL_FROM = https://github.com/prometheus/node_exporter/archive/v$(VER)/ +DIR_APP = $(DIR_SRC)/$(THISAPP) +TARGET = $(DIR_INFO)/$(THISAPP) +SUP_ARCH = x86_64 i586 aarch64 armv5tel +PROG = node_exporter +PAK_VER = 1
+DEPS = ""
+############################################################################### +# Top-level Rules +###############################################################################
+objects = $(DL_FILE)
+$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
+$(DL_FILE)_MD5 = 33c2be846dbd502f9c0efab149a8cbc5
+install : $(TARGET) +check : $(patsubst %,$(DIR_CHK)/%,$(objects))
+download : $(patsubst %,$(DIR_DL)/%,$(objects))
+md5 : $(subst %,%_MD5,$(objects))
+dist :
- @$(PAK)
+############################################################################### +# Downloading, checking, md5sum +###############################################################################
+$(patsubst %,$(DIR_CHK)/%,$(objects)) :
- @$(CHECK)
+$(patsubst %,$(DIR_DL)/%,$(objects)) :
- @$(LOAD)
+$(subst %,%_MD5,$(objects)) :
- @$(MD5)
+############################################################################### +# Installation Details +###############################################################################
+$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
- @$(PREBUILD)
- @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
- cd $(DIR_APP) && make build $(MAKETUNING) $(EXTRA_MAKE)
- # install compiled binary
- cd $(DIR_APP) && cp node_exporter /usr/bin
- # install configuration file
- install -v -m 644 $(DIR_SRC)/config/node_exporter/node_exporter_options \
/etc/node_exporter_options
- # Install initscript
- $(call INSTALL_INITSCRIPT,node_exporter)
- @rm -rf $(DIR_APP)
- @$(POSTBUILD)
diff --git a/make.sh b/make.sh index 4af0081e9..671f15558 100755 --- a/make.sh +++ b/make.sh @@ -1632,6 +1632,7 @@ buildipfire() { lfsmake2 socat lfsmake2 libcdada lfsmake2 pmacct
- lfsmake2 node_exporter
}
buildinstaller() { diff --git a/src/initscripts/packages/node_exporter b/src/initscripts/packages/node_exporter new file mode 100644 index 000000000..b9cbc6ab9 --- /dev/null +++ b/src/initscripts/packages/node_exporter @@ -0,0 +1,42 @@ +#!/bin/sh +######################################################################## +# Begin $rc_base/init.d/ +# +# Description : Prometheus Node Exporter daemon +# +########################################################################
+. /etc/sysconfig/rc +. ${rc_functions}
+# read configurable OPTIONS +. /etc/node_exporter_options
+case "${1}" in
- start)
boot_mesg "Starting..."
The “Starting…” line normally has the name of the program.
loadproc /usr/bin/node_exporter $OPTIONS > /dev/null 2>&1 &
You are throwing away the output of loadproc as well as any potential error messages. Does this program have a way to fork itself into the background?
;;
- stop)
boot_mesg "Stopping..."
Same here.
killproc /usr/bin/node_exporter
;;
- restart)
${0} stop
sleep 1
${0} start
;;
- status)
statusproc /usr/bin/node_exporter
;;
- *)
echo "Usage: ${0} {start|stop|restart|status}"
exit 1
;;
+esac
+# End $rc_base/init.d/ diff --git a/src/paks/node_exporter/install.sh b/src/paks/node_exporter/install.sh new file mode 100644 index 000000000..e9272d7cb --- /dev/null +++ b/src/paks/node_exporter/install.sh @@ -0,0 +1,31 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2007 IPFire-Team info@ipfire.org. # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh +extract_files +restore_backup ${NAME} +start_service --background ${NAME}
+ln -svf ../init.d/node_exporter /etc/rc.d/rc0.d/K30node_exporter +ln -svf ../init.d/node_exporter /etc/rc.d/rc3.d/S40node_exporter +ln -svf ../init.d/node_exporter /etc/rc.d/rc6.d/K30node_exporter diff --git a/src/paks/node_exporter/uninstall.sh b/src/paks/node_exporter/uninstall.sh new file mode 100644 index 000000000..710baf8b4 --- /dev/null +++ b/src/paks/node_exporter/uninstall.sh @@ -0,0 +1,30 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2007 IPFire-Team info@ipfire.org. # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh +/etc/init.d/node_exporter stop +make_backup ${NAME} +remove_files
+rm -rfv /etc/rc.d/rc*.d/*node_exporter
diff --git a/src/paks/node_exporter/update.sh b/src/paks/node_exporter/update.sh new file mode 100644 index 000000000..99776659c --- /dev/null +++ b/src/paks/node_exporter/update.sh @@ -0,0 +1,27 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2007-2020 IPFire-Team info@ipfire.org. # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh +extract_backup_includes +./uninstall.sh
+./install.sh
2.30.2