We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a2b43e1 commit 6c93e9dCopy full SHA for 6c93e9d
path-timestamp.sh
@@ -0,0 +1,16 @@
1
+#!/bin/sh
2
+
3
+# Expose timestamp of given path
4
+#
5
+# Usage: add this to crontab:
6
7
+# */5 * * * * prometheus path-timestamp.sh /var/lib/prometheus | sponge /var/lib/node_exporter/path-timestamp.prom
8
9
+# Author: Antoine Beaupré <[email protected]>
10
11
+echo "# HELP node_path_modification_timestamp_seconds Last change timestamp"
12
+echo "# TYPE node_path_modification_timestamp_seconds gauge"
13
+for path in "$@"; do
14
+ printf 'node_path_modification_timestamp_seconds{path="%s"}' "$path"
15
+ stat -c %Y "$path"
16
+done
0 commit comments