Package: munin-node
Version: 1.2.5-1
Severity: wishlist

Heya,

unfortunately hddtemp_smartctl is only able to recognize IDE disks. This
 renders the plugin useless for most new servers. Also I guess it won't
be able to detect PATA disk drives as soon as you're using the new
libata drivers for them.

My suggestion here would be to change the plugin to poll the drive
temperature from the hddtemp daemon, which supports sata and ide drives
just fine.

Out of personal needs I've hacked together a little plugin which uses
netcat to get the data from the daemon. Netcat is probably not to
optimal way to do this as the package depends on a lot of perl stuff -
but it's very fast and just works well for me. Please bear with me as I
didn't even read any plugin documentation, I just read a few other
plugins and thought that's the right way to do it. If you like it please
integrate it into the package. I'm willing to fix any issues - but I
won't be able to rewrite it in Perl within the next time as I just don't
know enough Perl to do it in a few minutes. If you want to have a python
version instead - not a problem at all.

Comments are appreciated!


Cheers,

Bernd


-- 
Bernd Zeimetz
<[EMAIL PROTECTED]>                         <http://bzed.de/>
#!/bin/bash

# hddtemp for munin
#
# Copyright (C) 2007  Bernd Zeimetz <[EMAIL PROTECTED]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

#%# family=auto
#%# capabilities=autoconf


# This plugin needs two things to work:
#
#  * netcat
#  * a running and configured hddtemp deamon
#
# It doesn't have any configureable options.
#
# Comments are appreciated.
#
#     Bernd Zeimetz <[EMAIL PROTECTED]>
#  -- Sun, 22 Apr 2007 03:40:20 +0200

function dev_temp_list() {
        #yes, that's a hack.
        echo "$@" | \
          sed 
's,^|,,g;s,|$,,g;s,|[A-Z]$,,g;s,|[A-Z]||,\n,g;s,/dev/,,g;s,|[^\n]*|, ,g'
}

temp_out=`netcat localhost 7634 2>/dev/null`
if [ $? -gt 0 ]; then
        exit 1
fi

if [ "$1" = "autoconf" ]; then
        echo yes
        exit 0
fi

if [ "$1" = "config" ]; then

        deg_type=`echo ${temp_out} | sed 's,|$,,g;s,.*|,,g'`

        echo 'graph_title HDD temperatures'
        echo 'graph_args --base 1000 -l 0'
        echo "graph_vlabel temp in °${deg_type}"
        echo 'graph_category sensors'
        echo 'graph_info This graph shows the temperature of all harddrives 
which are monitored by the hddtemp daemon.'
        dev_temp_list ${temp_out} | while read hdd temp; do
                echo "${hdd}.label ${hdd}"
        done
        exit 0

fi

dev_temp_list ${temp_out} | while read hdd temp; do
        echo "${hdd}.value ${temp}"
done
exit 0

Reply via email to