2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00
contrib-munin/plugins/other/hddtemp

63 lines
1.7 KiB
Plaintext
Raw Normal View History

2008-07-09 16:57:58 +02:00
#!/bin/sh
#
2011-02-08 13:56:50 +01:00
# Plugin to monitor harddrive temperatures through SMART.
2008-07-09 16:57:58 +02:00
#
2011-02-08 13:56:50 +01:00
# This plugin is an alternative to hddtemp_smartctl, which is
# the preferred one.
2008-07-09 16:57:58 +02:00
#
2011-02-08 13:56:50 +01:00
# client-conf.d/-options:
#
# drives -- List drives to monitor. E.g. "hda hdc".
#
# $Log$
# Revision 1.4.2.1 2005/01/25 21:00:01 jimmyo
# Added plugin generic/hddtemp_smartctl, made by Lupe Christoph. Made it the default hddtemp plugin.
#
# Revision 1.4 2004/11/10 16:00:39 jimmyo
# Applied patch from Nicolas Stransky to generic/hddtemp, to fetch temp more elegantly (SF#1052845).
#
# Revision 1.3 2004/05/20 19:02:36 jimmyo
# Set categories on a bunch of plugins
#
# Revision 1.2 2004/01/29 19:39:00 jimmyo
# Generic plugins now use printf instead of echo -n, as this is more portable (SF#885564)
#
# Revision 1.1 2004/01/02 18:50:00 jimmyo
# Renamed occurrances of lrrd -> munin
#
# Revision 1.1.1.1 2004/01/02 15:18:07 jimmyo
# Import of LRRD CVS tree after renaming to Munin
#
# Revision 1.2 2003/12/18 19:16:00 jimmyo
# Changes from Alexandre
#
# Revision 1.1 2003/12/18 19:04:37 jimmyo
# New plugin: Alexandre Dupouy contributed "hddtemp".
#
#
#%# family=contrib
2008-07-09 16:57:58 +02:00
2011-10-18 20:06:33 +02:00
hddtemp=${hddtemp:-/usr/sbin/hddtemp}
2008-07-09 16:57:58 +02:00
2011-02-08 13:56:50 +01:00
if [ "$1" = "autoconf" ]; then
2011-10-18 20:06:33 +02:00
if [ -x "$hddtemp" ]; then
2011-02-08 13:56:50 +01:00
echo yes
exit 0
else
echo no
exit 1
fi
2008-07-09 16:57:58 +02:00
fi
2011-02-08 13:56:50 +01:00
if [ "$1" = "config" ]; then
2008-07-09 16:57:58 +02:00
2011-02-08 13:56:50 +01:00
echo 'graph_title HDD temperature'
echo 'graph_args --base 1000 -l 0'
echo 'graph_vlabel temp in <20>C'
echo 'graph_category sensors'
2011-10-18 20:06:33 +02:00
for a in $drives ; do echo $a.label $a `$hddtemp -q /dev/$a | cut -d: -f 2` ; done
2011-02-08 13:56:50 +01:00
exit 0
2008-07-09 16:57:58 +02:00
fi
2011-10-18 20:06:33 +02:00
for a in $drives ; do printf "$a.value $($hddtemp -n -q /dev/$a)\n" ; done