smartctl
This commit is contained in:
parent
7f443cfdd4
commit
5a49533460
2 changed files with 3 additions and 9 deletions
|
@ -16,15 +16,9 @@ do
|
||||||
|
|
||||||
temp=$(smartctl -n idle -A --json=c $device | jq .temperature.current)
|
temp=$(smartctl -n idle -A --json=c $device | jq .temperature.current)
|
||||||
|
|
||||||
|
# hdd might be sleeping
|
||||||
if [[ $temp == ?(-)+([0-9]) ]]
|
if [[ $temp == ?(-)+([0-9]) ]]
|
||||||
then
|
then
|
||||||
echo "smartctl,host=${node.name},device=$device temperature=<%text>${temp}</%text>i $(date --utc +%s%N)"
|
echo "smartctl,host=${node.name},device=$device temperature=${temp} $(date --utc +%s%N)"
|
||||||
elif [[ $temp == null ]]
|
|
||||||
then
|
|
||||||
# hdd might be sleeping
|
|
||||||
continue
|
|
||||||
else
|
|
||||||
# hdd might be unsupported
|
|
||||||
continue
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
|
@ -16,7 +16,7 @@ defaults = {
|
||||||
f'sudo /usr/local/share/icinga/plugins/smartctl',
|
f'sudo /usr/local/share/icinga/plugins/smartctl',
|
||||||
],
|
],
|
||||||
'data_format': 'influx',
|
'data_format': 'influx',
|
||||||
'interval': '60s',
|
'interval': '20s',
|
||||||
}],
|
}],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue