From c2770b6d8f6e0e306f320cad9540af7a5b04c858 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Thu, 24 Aug 2023 21:41:02 +0200 Subject: add nftables exporter --- prom-exporter-nftables/Makefile | 18 ++++++++++++++++++ prom-exporter-nftables/debian/changelog | 5 +++++ prom-exporter-nftables/debian/compat | 1 + prom-exporter-nftables/debian/control | 12 ++++++++++++ prom-exporter-nftables/debian/install | 1 + prom-exporter-nftables/debian/rules | 16 ++++++++++++++++ prom-exporter-nftables/debian/source/format | 1 + prom-exporter-nftables/sha256sums.txt | 1 + 8 files changed, 55 insertions(+) create mode 100644 prom-exporter-nftables/Makefile create mode 100644 prom-exporter-nftables/debian/changelog create mode 100644 prom-exporter-nftables/debian/compat create mode 100644 prom-exporter-nftables/debian/control create mode 100644 prom-exporter-nftables/debian/install create mode 100755 prom-exporter-nftables/debian/rules create mode 100644 prom-exporter-nftables/debian/source/format create mode 100644 prom-exporter-nftables/sha256sums.txt diff --git a/prom-exporter-nftables/Makefile b/prom-exporter-nftables/Makefile new file mode 100644 index 0000000..35a70f7 --- /dev/null +++ b/prom-exporter-nftables/Makefile @@ -0,0 +1,18 @@ +VERSION := "invalid" +GITHUB_BASEURL := "https://github.com/metal-stack/nftables-exporter/releases/download" + +.PHONY: clean + +all: amd64/nftables-exporter + +amd64/nftables-exporter: nftables-exporter-v$(VERSION) + mkdir -p $(shell echo $@ | sed 's#/.*##') + cp $< $@ + +nftables-exporter-v$(VERSION): + wget -nc --progress=dot:mega "$(GITHUB_BASEURL)/v$(VERSION)/nftables-exporter" -O "$@" + sha256sum -c --ignore-missing sha256sums.txt + +clean: + rm -rf amd64 + rm -f nftables-exporter-v$(VERSION) diff --git a/prom-exporter-nftables/debian/changelog b/prom-exporter-nftables/debian/changelog new file mode 100644 index 0000000..cc01425 --- /dev/null +++ b/prom-exporter-nftables/debian/changelog @@ -0,0 +1,5 @@ +prom-exporter-nftables (0.2.7-1) unstable; urgency=medium + + * Initial release. + + -- Christian Pointner Thu, 24 Aug 2023 21:40:07 +0200 diff --git a/prom-exporter-nftables/debian/compat b/prom-exporter-nftables/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/prom-exporter-nftables/debian/compat @@ -0,0 +1 @@ +9 diff --git a/prom-exporter-nftables/debian/control b/prom-exporter-nftables/debian/control new file mode 100644 index 0000000..c86007a --- /dev/null +++ b/prom-exporter-nftables/debian/control @@ -0,0 +1,12 @@ +Source: prom-exporter-nftables +Maintainer: Christian Pointner +Section: utils +Priority: optional +Standards-Version: 3.9.2 +Build-Depends: debhelper (>= 9), wget, ca-certificates + +Package: prom-exporter-nftables +Architecture: amd64 i386 arm64 +Depends: ${misc:Depends} +Conflicts: prometheus-nftables-exporter +Description: prometheus nftables-exporter (binary only) diff --git a/prom-exporter-nftables/debian/install b/prom-exporter-nftables/debian/install new file mode 100644 index 0000000..6daaa9d --- /dev/null +++ b/prom-exporter-nftables/debian/install @@ -0,0 +1 @@ +usr/bin/prometheus-nftables-exporter diff --git a/prom-exporter-nftables/debian/rules b/prom-exporter-nftables/debian/rules new file mode 100755 index 0000000..a7aae55 --- /dev/null +++ b/prom-exporter-nftables/debian/rules @@ -0,0 +1,16 @@ +#!/usr/bin/make -f +include /usr/share/dpkg/pkg-info.mk +%: + dh $@ + +override_dh_auto_configure: + +override_dh_auto_build: + make VERSION=$(DEB_VERSION_UPSTREAM) $(DEB_BUILD_ARCH)/nftables-exporter + +override_dh_auto_install: + install -d $$(pwd)/debian/tmp/usr/bin/ + install -m 755 $$(pwd)/$(DEB_BUILD_ARCH)/nftables-exporter $$(pwd)/debian/tmp/usr/bin/prometheus-nftables-exporter + +override_dh_auto_clean: + make VERSION=$(DEB_VERSION_UPSTREAM) clean diff --git a/prom-exporter-nftables/debian/source/format b/prom-exporter-nftables/debian/source/format new file mode 100644 index 0000000..d3827e7 --- /dev/null +++ b/prom-exporter-nftables/debian/source/format @@ -0,0 +1 @@ +1.0 diff --git a/prom-exporter-nftables/sha256sums.txt b/prom-exporter-nftables/sha256sums.txt new file mode 100644 index 0000000..0d80c92 --- /dev/null +++ b/prom-exporter-nftables/sha256sums.txt @@ -0,0 +1 @@ +a2d86b066ce2e2d13f37969fdf1dc47012fa2ba691a72594ca721305c611c9da nftables-exporter-v0.2.7 -- cgit v1.2.3