node exporter: add hostname dependent docker count and default value for smartd script

This commit is contained in:
lucas committed 2026-10-12 19:19:15 +00:00
1 parent d5e627325d
commit 01ab319eea
2 files changed
+13 -2

No files matched your search

+6 -1
View File
@@ -11,7 +11,12 @@ for dev in $(smartctl --scan-open | awk '{print $1}'); do
| head -1 \
| awk '{print $(NF-1)}')
echo $name: $LAST
# Skip devices without self-test history
if [[ "${LAST}" == "-" ]]; then
HOURS=$(smartctl -a "$DEV" 2>/dev/null | awk '/Power_On_Hours/ {print $10}')
LAST=${HOURS:- -1}
fi
echo $name: $LAST
echo "smart_last_selftest_poweron_hours{device=\"$name\"} $LAST" >> "$OUT"
done