Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Measuring HD temperature with SNMP/SMART
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
fvant
Guru
Guru


Joined: 08 Jun 2003
Posts: 328
Location: Leiden, The Netherlands

PostPosted: Sun Jun 05, 2005 8:11 pm    Post subject: Measuring HD temperature with SNMP/SMART Reply with quote

I'd like to measure my HDs temperature (SMART enabled and hdtemp works) with SNMP so i can monitor them with Cacti.

Somebody who has done that before on this forum ?
Back to top
View user's profile Send private message
DeathAndTaxes
Tux's lil' helper
Tux's lil' helper


Joined: 27 Mar 2003
Posts: 124

PostPosted: Mon Jun 06, 2005 5:16 pm    Post subject: Reply with quote

Yeah, you have to build a script that outputs data in a specific format, then get into cacti and tell it to use the script as a "data input method", then set up a data source that uses the data input method you set up, then you build a graph using the data from the data source you set up. It doesn't sound simple, and it's even harder to set up in real life. ;-)

Here's the script I use. It uses smartctl to poll the device, then I grep out 'temp' and then I use awk to only print the value I'm interested in (in my case, it's the 10th string on the line):

Code:
#!/bin/sh
TEMPHDA=`/usr/sbin/smartctl -a /dev/hda | grep -i temp | awk '{print \$10}'`
TEMPHDB=`/usr/sbin/smartctl -a /dev/hdb | grep -i temp | awk '{print \$10}'`
TEMPHDC=`/usr/sbin/smartctl -a /dev/hdc | grep -i temp | awk '{print \$10}'`
TEMPHDD=`/usr/sbin/smartctl -a /dev/hdd | grep -i temp | awk '{print \$10}'`
TEMPHDE=`/usr/sbin/smartctl -a /dev/hde | grep -i temp | awk '{print \$10}'`
echo hda:$TEMPHDA hdb:$TEMPHDB hdc:$TEMPHDC hdd:$TEMPHDD hde:$TEMPHDE


As you can see, I monitor 5 drives but you can just comment out whatever you don't need. You'll also need to figure out if yours outputs in celcius or farenheit. Mine says something like temp_celcius via smartctl, but it's actually farenheit...Go figure.
Back to top
View user's profile Send private message
fvant
Guru
Guru


Joined: 08 Jun 2003
Posts: 328
Location: Leiden, The Netherlands

PostPosted: Wed Jun 08, 2005 12:15 pm    Post subject: Reply with quote

sure i can write my own script but i was hoping the SMART data could be read directly by net-snmp, just like the lm_sensor data iow SMART data is made available via OIDs.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum