From 7a50deb3989955863205c0a8ef03c5e826ec03f3 Mon Sep 17 00:00:00 2001 From: Peca Nesovanovic <59750439+Npeca75@users.noreply.github.com> Date: Mon, 26 Feb 2024 17:48:21 +0100 Subject: [PATCH] [ups-nut] Add temperature readout (#508) * Add temperature readout expose Battery Temperature value * Update ups-nut.sh --- snmp/ups-nut.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/snmp/ups-nut.sh b/snmp/ups-nut.sh index e8dd3a824..b75580a4b 100755 --- a/snmp/ups-nut.sh +++ b/snmp/ups-nut.sh @@ -39,3 +39,7 @@ do fi done +UPSTEMP="ups\.temperature: [0-9.]+" +OUT=$(echo "$TMP" | grep -Eo "$UPSTEMP" | awk '{print $2}' | LANG=C sort | head -n 1) +[ -n "$OUT" ] && echo "$OUT" || echo "Unknown" +