1
0
mirror of https://github.com/librenms/librenms-agent.git synced 2024-05-09 09:54:52 +00:00

Fixing agent-local hddtemp script (#436)

This commit is contained in:
bnerickson
2022-11-13 02:06:10 -08:00
committed by GitHub
parent c2b00adcdd
commit c09263d04e

View File

@ -28,9 +28,9 @@ if [ "${hddtemp}" != "" ]; then
if [ -x "${hddtemp}" ]; then
if type parallel > /dev/null 2>&1; then
# When available, use GNU parallel for a significant performance boost. hddtemp runs serially(!)
output=$(parallel "${hddtemp}" -w -q ::: "${disks}" 2>/dev/null)
output=$(parallel "${hddtemp}" -w -q ::: ${disks} 2>/dev/null)
else
output=$(${hddtemp} -w -q "${disks}" 2>/dev/null)
output=$(${hddtemp} -w -q ${disks} 2>/dev/null)
fi
content=$(echo "$output" | awk '{ if ($0 !~ /not available/) { print $0 } }' | awk -F": " 'BEGIN{ ORS="" }{ print "|"$1"|"$2"|"$3"|";} ' | sed 's/[° ]C|/|C|/g' | sed 's/[° ]F|/|F|/g' | tr -cd '\12\14\40-\176')
if [ "${content}" != "" ]; then