From 6e37bb6e01f3ffe2eca7d771f3a16585d567df14 Mon Sep 17 00:00:00 2001 From: Tim Connors Date: Sat, 28 Sep 2024 22:05:08 +1000 Subject: [PATCH] allow user to set warning and critical for digitemp_ plugin --- plugins/node.d/digitemp_ | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/plugins/node.d/digitemp_ b/plugins/node.d/digitemp_ index 2c59a8fa30..15afc86344 100755 --- a/plugins/node.d/digitemp_ +++ b/plugins/node.d/digitemp_ @@ -11,8 +11,11 @@ digitemp The following environment variables are used by this plugin: - digitemprc - config file to use. (Default /etc/digitemp.conf) + [digitemp] + env.digitemprc - config file to use. (Default /etc/digitemp.conf) This must be generated with digitemp_ -i + env.warning - Warning temperature + env.critical - Critical temperature =head1 USAGE @@ -49,6 +52,8 @@ with this program; if not, write to the Free Software Foundation, Inc., digitemp_bin=${0##*/} model=${digitemp_bin##*_} digitemprc=${digitemprc:-/etc/digitemp.conf} +warning=${warning:-25} +critical=${critical:-30} get_sensor_data() { @@ -101,8 +106,8 @@ if [ "$1" = "config" ]; then echo "sensor$serial.label sensor #$sensor" echo "sensor$serial.type GAUGE" echo "sensor$serial.info Temperature from sensor #$sensor" - echo "sensor$serial.critical 30" - echo "sensor$serial.warning 25" + echo "sensor$serial.critical $critical" + echo "sensor$serial.warning $warning" done exit 0 fi