summaryrefslogtreecommitdiffstats
path: root/collectors/charts.d.plugin/hddtemp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--collectors/charts.d.plugin/hddtemp/Makefile.inc13
-rw-r--r--collectors/charts.d.plugin/hddtemp/README.md28
-rw-r--r--collectors/charts.d.plugin/hddtemp/hddtemp.chart.sh (renamed from charts.d/hddtemp.chart.sh)13
-rw-r--r--collectors/charts.d.plugin/hddtemp/hddtemp.conf (renamed from conf.d/charts.d/hddtemp.conf)0
4 files changed, 49 insertions, 5 deletions
diff --git a/collectors/charts.d.plugin/hddtemp/Makefile.inc b/collectors/charts.d.plugin/hddtemp/Makefile.inc
new file mode 100644
index 000000000..2bd29e5b1
--- /dev/null
+++ b/collectors/charts.d.plugin/hddtemp/Makefile.inc
@@ -0,0 +1,13 @@
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+# THIS IS NOT A COMPLETE Makefile
+# IT IS INCLUDED BY ITS PARENT'S Makefile.am
+# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT
+
+# install these files
+dist_charts_DATA += hddtemp/hddtemp.chart.sh
+dist_chartsconfig_DATA += hddtemp/hddtemp.conf
+
+# do not install these files, but include them in the distribution
+dist_noinst_DATA += hddtemp/README.md hddtemp/Makefile.inc
+
diff --git a/collectors/charts.d.plugin/hddtemp/README.md b/collectors/charts.d.plugin/hddtemp/README.md
new file mode 100644
index 000000000..98f18900c
--- /dev/null
+++ b/collectors/charts.d.plugin/hddtemp/README.md
@@ -0,0 +1,28 @@
+> THIS MODULE IS OBSOLETE.
+> USE THE PYTHON ONE - IT SUPPORTS MULTIPLE JOBS AND IT IS MORE EFFICIENT
+
+# hddtemp
+
+The plugin will collect temperatures from disks
+
+It will create one chart with all active disks
+
+1. **temperature in Celsius**
+
+### configuration
+
+hddtemp needs to be running in daemonized mode
+
+```sh
+# host with daemonized hddtemp
+hddtemp_host="localhost"
+
+# port on which hddtemp is showing data
+hddtemp_port="7634"
+
+# array of included disks
+# the default is to include all
+hddtemp_disks=()
+```
+
+---
diff --git a/charts.d/hddtemp.chart.sh b/collectors/charts.d.plugin/hddtemp/hddtemp.chart.sh
index 3aada1751..e90310981 100644
--- a/charts.d/hddtemp.chart.sh
+++ b/collectors/charts.d.plugin/hddtemp/hddtemp.chart.sh
@@ -1,9 +1,10 @@
+# shellcheck shell=bash
# no need for shebang - this file is loaded from charts.d.plugin
+# SPDX-License-Identifier: GPL-3.0-or-later
# netdata
# real-time performance and health monitoring, done right!
# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
-# GPL v3+
#
# contributed by @paulfantom with PR #511
@@ -30,13 +31,14 @@ hddtemp_create() {
local all
all=$(nc $hddtemp_host $hddtemp_port )
unset hddtemp_disks
- hddtemp_disks=( `grep -Po '/dev/[^|]+' <<< "$all" | cut -c 6-` )
+ # shellcheck disable=SC2190,SC2207
+ hddtemp_disks=( $(grep -Po '/dev/[^|]+' <<< "$all" | cut -c 6-) )
fi
# local disk_names
# disk_names=(`sed -e 's/||/\n/g;s/^|//' <<< "$all" | cut -d '|' -f2 | tr ' ' '_'`)
echo "CHART hddtemp.temperature 'disks_temp' 'temperature' 'Celsius' 'Disks temperature' 'hddtemp.temp' line $((hddtemp_priority)) $hddtemp_update_every"
- for i in `seq 0 $((${#hddtemp_disks[@]}-1))`; do
+ for i in $(seq 0 $((${#hddtemp_disks[@]}-1))); do
# echo "DIMENSION ${hddtemp_disks[i]} ${disk_names[i]} absolute 1 1"
echo "DIMENSION ${hddtemp_disks[$i]} '' absolute 1 1"
done
@@ -44,13 +46,14 @@ hddtemp_create() {
}
# _update is called continuously, to collect the values
-hddtemp_last=0
-hddtemp_count=0
+#hddtemp_last=0
+#hddtemp_count=0
hddtemp_update() {
# local all=( `nc $hddtemp_host $hddtemp_port | sed -e 's/||/\n/g;s/^|//' | cut -d '|' -f3` )
# local all=( `nc $hddtemp_host $hddtemp_port | awk 'BEGIN { FS="|" };{i=4; while (i <= NF) {print $i+0;i+=5;};}'` )
OLD_IFS=$IFS
set -f
+ # shellcheck disable=SC2207
IFS="|" all=( $(nc $hddtemp_host $hddtemp_port 2>/dev/null) )
set +f
IFS=$OLD_IFS
diff --git a/conf.d/charts.d/hddtemp.conf b/collectors/charts.d.plugin/hddtemp/hddtemp.conf
index b6037b40e..b6037b40e 100644
--- a/conf.d/charts.d/hddtemp.conf
+++ b/collectors/charts.d.plugin/hddtemp/hddtemp.conf