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:
@ -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}
|
||||
|
Reference in New Issue
Block a user