graph your harddisk temperature

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
klavs
Posts: 18
Joined: Tue Oct 01, 2002 8:36 am

graph your harddisk temperature

Post by klavs »

Hi guys,

Just wrote a small script to graph my harddisk temperature - a nice way to see how well they are doing - I found my discs going just outside of operating temperatures during backup :(

Documented it here - as this forum is not searchable by google - and everyone should be able to find this - this script can be used for more than just Cacti :)
http://vsen.dk/monitoring

Have fun.
faked
Posts: 3
Joined: Fri Dec 03, 2004 4:45 pm

HDDTEMP --> another way to do the same

Post by faked »

first of all - I'm not a native English speaker........


I found out another way to get your harddisk temperature, using the unix hddtemp program (visit http://www.guzu.net/linux/hddtemp.php - some binary packages available too)

First you have to allow your cacti user to get the drive temperature. I assume you have sudo:
* run visudo as root
* edit to get something like this (I'm monitoring two drives: /dev/hdc and /dev/hdd)

Code: Select all

www-data ALL=NOPASSWD:/usr/sbin/hddtemp -n /dev/hdc
www-data ALL=NOPASSWD:/usr/sbin/hddtemp -n /dev/hdd
* save and exit with <escape> <:> <wq>
* create a script hddtemp.sh in you /cacti/scripts/ dir:

Code: Select all

#!/bin/sh
#sudo /usr/sbin/hddtemp -n $1
this returns the actual temperature of the specified drive in degrees Celsius without unit within 2 seconds.
* save and exit
* now go to your cacti website, create a new data input method. Specify to call the script like this:

Code: Select all

path/to/cacti/cacti/scripts/hddtemp.sh <drivevar>
* save the data input method, enter it again and create an input field to enter the drive in the data source, and an output field to write the temperature to. Make sure to set the drive path input variable to be entered in the data source
* save.
* create a new data source for every drive, using the input method we just created. Specify the harddisk drive path like /dev/hdx (there has to be some way for scsi drives too)
* now create graphs to display your harddisk temperatures using the data sources you just created.
* have fun!

[EDIT]

view my results: http://eedenvan.demon.nl/cacti/graph.ph ... raph_id=19
Last edited by faked on Tue Dec 07, 2004 3:18 pm, edited 1 time in total.
Guest

Post by Guest »

That's exactly how I use ;)

And then I've added this to my sudoers file:
Defaults syslog=auth
Defaults:<cactiuser> !syslog

to NOT log everytime cactiuser runs hdtemp.sh :)
jeep05

Post by jeep05 »

can I use the result of "acpi -t" in order to draw a grap ?
jeep05

Post by jeep05 »

exactly :

$ acpi -t | cut -b 21-24
51.0
fvant
Posts: 2
Joined: Mon Dec 05, 2005 10:31 am

Post by fvant »

I see this working locally, but how would i monitor hdtemps on remote machines ?

EDIT:
this script workd for me. Taking hostname and full device path (/dev/hde) as arguments.

Code: Select all

nc $1 7634 | sed -e 's/^|//' -e 's/||/\n/g' | awk -F \| --assign=drive=$2 '$1 == drive {print $3}'
redcap
Posts: 18
Joined: Mon Jan 23, 2006 5:49 am

Post by redcap »

I don't manage to get the hddtemp graphs working with the explanation above.
Does anybody have some templates available wich I can import?

Thanks in advance
Redcap
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: graph your harddisk temperature

Post by gandalf »

klavs wrote:Documented it here - as this forum is not searchable by google -
:o What about "+harddisk +temperature site:forums.cacti.net"?
Reinhard
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests