From 5a495334609f7dfd189202eba3bb8fe8f7c1a966 Mon Sep 17 00:00:00 2001 From: mwiegand Date: Sat, 30 Oct 2021 20:43:01 +0200 Subject: [PATCH] smartctl --- bundles/smartctl/files/telegraf_plugin | 10 ++-------- bundles/smartctl/metadata.py | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/bundles/smartctl/files/telegraf_plugin b/bundles/smartctl/files/telegraf_plugin index 8099131..c3688fa 100644 --- a/bundles/smartctl/files/telegraf_plugin +++ b/bundles/smartctl/files/telegraf_plugin @@ -16,15 +16,9 @@ do temp=$(smartctl -n idle -A --json=c $device | jq .temperature.current) + # hdd might be sleeping if [[ $temp == ?(-)+([0-9]) ]] then - echo "smartctl,host=${node.name},device=$device temperature=<%text>${temp}i $(date --utc +%s%N)" - elif [[ $temp == null ]] - then - # hdd might be sleeping - continue - else - # hdd might be unsupported - continue + echo "smartctl,host=${node.name},device=$device temperature=${temp} $(date --utc +%s%N)" fi done diff --git a/bundles/smartctl/metadata.py b/bundles/smartctl/metadata.py index 6d7794c..f28838a 100644 --- a/bundles/smartctl/metadata.py +++ b/bundles/smartctl/metadata.py @@ -16,7 +16,7 @@ defaults = { f'sudo /usr/local/share/icinga/plugins/smartctl', ], 'data_format': 'influx', - 'interval': '60s', + 'interval': '20s', }], }, },