aboutsummaryrefslogtreecommitdiff
path: root/munin/plugins/hddtemp-simple
blob: bc13e0132fe56fe1397e27c48d20d6e49b5131a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
#
# hddtemp munin plugin
# feedback: rhatto at riseup.net | gpl
#
# configuration example:
#
#  [hddtemp]
#  user root
#  env.devices hda hdb
#  env.hddtemp /path/to/hddtemp
#

if [ "$1" == "config" ]; then
  cat << EOF
graph_title HDD Temperatures
graph_vlabel Celsius
graph_category sensors
EOF
  for dev in $devices; do
    echo $dev.label $dev
  done
  exit 0
else
  if [ -z "$hddtemp" ]; then
    hddtemp="/usr/sbin/hddtemp" 
  fi
  for device in $devices; do
    echo $device.value `$hddtemp -n /dev/$device`
  done
fi