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

hddtemp, ignore devices not supporting SMART (#153)

This commit is contained in:
arrmo
2017-12-04 14:11:17 -06:00
committed by Neil Lathwood
parent 7fb48df857
commit 3b9d632a8d

View File

@ -32,7 +32,7 @@ if [ "${hddtemp}" != "" ]; then
else
output=`${hddtemp} -w -q ${disks} 2>/dev/null`
fi
content=`echo "$output" | awk -F": " 'BEGIN{ ORS="" }{ print "|"$1"|"$2"|"$3"|";} ' | sed 's/[° ]C|/|C|/g' | sed 's/[° ]F|/|F|/g' | tr -cd '\12\14\40-\176'`
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
echo '<<<hddtemp>>>'
echo ${content}