[crux-commits] ports/contrib (refs/remotes/origin/3.6): prometheus-node_exporter: initial commit, version 1.0.1

crux at crux.nu crux at crux.nu
Sat Apr 10 19:06:04 UTC 2021


commit bfe3968a55b5257fb8c638ff186736501d9051a6
Author: Tim Biermann <tbier at posteo.de>
Date:   Fri Jan 8 00:08:18 2021 +0000

    prometheus-node_exporter: initial commit, version 1.0.1

diff --git a/prometheus-node_exporter/.footprint b/prometheus-node_exporter/.footprint
new file mode 100644
index 000000000..7bb7f4509
--- /dev/null
+++ b/prometheus-node_exporter/.footprint
@@ -0,0 +1,6 @@
+drwxr-xr-x	root/root	etc/
+drwxr-xr-x	root/root	etc/rc.d/
+-rwxr-xr-x	root/root	etc/rc.d/prometheus-node_exporter
+drwxr-xr-x	root/root	usr/
+drwxr-xr-x	root/root	usr/bin/
+-rwxr-xr-x	root/root	usr/bin/prometheus-node-exporter
diff --git a/prometheus-node_exporter/.signature b/prometheus-node_exporter/.signature
new file mode 100644
index 000000000..e8d4d0af1
--- /dev/null
+++ b/prometheus-node_exporter/.signature
@@ -0,0 +1,6 @@
+untrusted comment: verify with /etc/ports/contrib.pub
+RWSagIOpLGJF31rBU1ODjLfIUbanIuAKrGTw9FcNPyaUb6aPmLBhLl5vJmN4q7spapPo7TYfrZzra+aG4ULuq0mJzSlKmYX+Ygc=
+SHA256 (Pkgfile) = 64c1c246121b6599c8ce1cbb6fe8d52e06d878d8804db7e0375f894acbdad2e0
+SHA256 (.footprint) = f8a7066cda52f587e5aad610950d17c8c0ea2d313cfe5b52ddd36fb8c17bf180
+SHA256 (prometheus-node_exporter-1.0.1.tar.gz) = a841bf3e236376840be9e1d8e6c4a38196be6f3957b0982d1c7970a5e416b0ad
+SHA256 (prometheus-node_exporter.service) = aaca590035b67fa97af4ee9628d4fd7aa37e846b2a72d96517cb0bf900521bd0
diff --git a/prometheus-node_exporter/Pkgfile b/prometheus-node_exporter/Pkgfile
new file mode 100644
index 000000000..50d56d185
--- /dev/null
+++ b/prometheus-node_exporter/Pkgfile
@@ -0,0 +1,33 @@
+# Description: exporter for machine metrics
+# URL: https://github.com/prometheus/node_exporter
+# Maintainer: Tim Biermann, tbier at posteo dot de
+# Depends on: go
+
+name=prometheus-node_exporter
+version=1.0.1
+release=1
+source=(https://github.com/prometheus/node_exporter/archive/v$version/$name-$version.tar.gz
+  prometheus-node_exporter.service)
+
+build() {
+  cd node_exporter-$version
+
+  GOLDFLAGS="-X github.com/prometheus/common/version.Version=$version
+    -X github.com/prometheus/common/version.Revision=CRUX
+    -X github.com/prometheus/common/version.Branch=master
+    -X github.com/prometheus/common/version.BuildUser=$USER@$HOSTNAME
+    -X github.com/prometheus/common/version.BuildDate=$(date -u "+%Y%m%d-%H:%M:%S" ${SOURCE_DATE_EPOCH:+-d @$SOURCE_DATE_EPOCH})"
+
+  go build \
+    -trimpath \
+    -buildmode=pie \
+    -mod=readonly \
+    -modcacherw \
+    -ldflags "$GOLDFLAGS" \
+    .
+
+  install -Dm755 node_exporter $PKG/usr/bin/prometheus-node-exporter
+
+  ## install rc file
+  install -Dm 755 $SRC/prometheus-node_exporter.service $PKG/etc/rc.d/prometheus-node_exporter
+}
diff --git a/prometheus-node_exporter/prometheus-node_exporter.service b/prometheus-node_exporter/prometheus-node_exporter.service
new file mode 100755
index 000000000..c1178bf04
--- /dev/null
+++ b/prometheus-node_exporter/prometheus-node_exporter.service
@@ -0,0 +1,35 @@
+#!/bin/sh
+#
+# /etc/rc.d/prometheus-node-exporter: start/stop prometheus-node-exporter daemon
+#
+
+SSD=/sbin/start-stop-daemon
+PROG=/usr/bin/prometheus-node-exporter
+OPTS="--collector.processes"
+
+case $1 in
+start)
+	$SSD --start -b --exec $PROG -- $OPTS
+	;;
+stop)
+	$SSD --stop --retry 10 --exec $PROG
+	;;
+restart)
+	$0 stop
+	$0 start
+	;;
+status)
+	$SSD --status --exec $PROG
+	case $? in
+	0) echo "$PROG is running with pid $(pidof $PROG)" ;;
+	1) echo "$PROG is not running but the pid file $PID exists" ;;
+	3) echo "$PROG is not running" ;;
+	4) echo "Unable to determine the program status" ;;
+	esac
+	;;
+*)
+	echo "usage: $0 [start|stop|restart|status]"
+	;;
+esac
+
+# End of file


More information about the crux-commits mailing list