This commit is contained in:
mwiegand 2021-10-30 20:43:01 +02:00
parent 7f443cfdd4
commit 5a49533460
2 changed files with 3 additions and 9 deletions

View file

@ -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

View file

@ -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',
}], }],
}, },
}, },