Skip to content

Commit

Permalink
allow user to set warning and critical for digitemp_ plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
spacelama committed Sep 28, 2024
1 parent 86616d4 commit 6e37bb6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions plugins/node.d/digitemp_
Original file line number Diff line number Diff line change
Expand Up @@ -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_<model> -i
env.warning - Warning temperature
env.critical - Critical temperature
=head1 USAGE
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6e37bb6

Please sign in to comment.