summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO16
-rw-r--r--PKGBUILD35
-rw-r--r--iptables-exporter.service17
3 files changed, 68 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..4cb212ac34f0
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,16 @@
+pkgbase = iptables-exporter-bin
+ pkgdesc = Prometheus exporter for iptables metrics (binary, not built from source)
+ pkgver = 0.1.0
+ pkgrel = 1
+ url = https://github.com/retailnext/iptables_exporter
+ arch = x86_64
+ license = Apache
+ provides = iptables-exporter
+ conflicts = iptables-exporter
+ source = iptables-exporter.service
+ md5sums = 7697c3ce8640e1e4c2b077c40bc09571
+ source_x86_64 = https://github.com/retailnext/iptables_exporter/releases/download/v0.1.0/iptables_exporter-0.1.0.linux-amd64.tar.gz
+ md5sums_x86_64 = 1ed90b84cd9579b9ac7e8a9737492199
+
+pkgname = iptables-exporter-bin
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..df9edceb43c6
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,35 @@
+# Maintainer: Dave Ingram <aur[at]dmi.me.uk>
+
+pkgname=iptables-exporter-bin
+pkgver=0.1.0
+pkgrel=1
+pkgdesc="Prometheus exporter for iptables metrics (binary, not built from source)"
+arch=('x86_64')
+url="https://github.com/retailnext/iptables_exporter"
+license=('Apache')
+depends=()
+makedepends=()
+provides=('iptables-exporter')
+conflicts=('iptables-exporter')
+source=( 'iptables-exporter.service' )
+source_x86_64=( "$url/releases/download/v${pkgver}/iptables_exporter-${pkgver}.linux-amd64.tar.gz")
+md5sums=('7697c3ce8640e1e4c2b077c40bc09571')
+md5sums_x86_64=('1ed90b84cd9579b9ac7e8a9737492199')
+
+package() {
+ case "$CARCH" in
+ 'x86_64') ARCH='amd64';;
+ 'armv6h') ARCH='armv6';;
+ 'armv7h') ARCH='armv7';;
+ 'aarch64') ARCH='arm64';;
+ esac
+ cd "${srcdir}/iptables_exporter-${pkgver}.linux-${ARCH}"
+
+ # Install Binary
+ install -D -m0755 iptables_exporter \
+ "${pkgdir}/usr/bin/iptables_exporter"
+
+ # Install SystemD Service File
+ install -D -m0644 "${srcdir}/iptables-exporter.service" \
+ "${pkgdir}/usr/lib/systemd/system/iptables-exporter.service"
+}
diff --git a/iptables-exporter.service b/iptables-exporter.service
new file mode 100644
index 000000000000..f85f28ee7ee5
--- /dev/null
+++ b/iptables-exporter.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=iptables exporter for Prometheus
+After=network.target
+
+[Service]
+User=nobody
+Group=nobody
+NoNewPrivileges=true
+ProtectHome=true
+ProtectSystem=strict
+CapabilityBoundingSet=CAP_DAC_READ_SEARCH CAP_NET_ADMIN CAP_NET_RAW
+AmbientCapabilities=CAP_DAC_READ_SEARCH CAP_NET_ADMIN CAP_NET_RAW
+Restart=on-failure
+ExecStart=/usr/bin/iptables_exporter
+
+[Install]
+WantedBy=multi-user.target