Most of the brainwork here is Martin's. I just adapted his work. I'm an absolute newbie at PERL programming (actually this was my first acquaintance with the language) so my part of the coding must be awful and I won't win any prices for speed of execution or compactness of the code. I tried however to make the code easily understandable so it won't be to hard to modify. I've also put in some debugging options to make it easy to understand where the scripts go wrong (I made frequent use of this feature myself).

I will be short on the prerequisites, you will of course need RRDtool and lm-sensors installed.

For the rest you can follow the instructions on Martin Pot's webpage http://martybugs.net/linux/hddtemp.cgi.

The hddtemp.cgi script at the bottom of this page should be a plug-in replacement for Martin's original. If you want to keep his script just give mine a different name, but stick it in the same place.

The lmsensor.pl script should be put in the same place as Martin's rrd_hddtemp.pl script http://martybugs.net/linux/download/rrd_hddtemp.txt and treated the same way. The script is documented. You can run it from the command line with debug options to check the parsing and to generate the sensor options for your specific setup. Selecting a sensor to log is just a matter of uncommenting a line.

This is the output of the sensor command on my computer. If yours looks similar, the scripts should work.

smsc47m192-i2c-0-2d
Adapter: SMBus I801 adapter at 2000
+2.5V:       +2.54 V  (min =  +0.00 V, max =  +3.32 V)   
VCore:       +1.15 V  (min =  +0.00 V, max =  +2.99 V)   
+3.3V:       +3.28 V  (min =  +0.00 V, max =  +4.38 V)   
+5V:         +4.97 V  (min =  +0.00 V, max =  +6.64 V)   
+12V:       +12.19 V  (min =  +0.00 V, max = +15.94 V)   
VCC:         +3.28 V  (min =  +0.00 V, max =  +4.38 V)   
+1.5V:       +1.56 V  (min =  +0.00 V, max =  +1.99 V)   
+1.8V:       +1.77 V  (min =  +0.00 V, max =  +2.39 V)   
Chip Temp:   +33.0°C  (low  = -127.0°C, high = +127.0°C)  
CPU Temp:    +40.0°C  (low  = +38.0°C, high = +45.0°C)  
Sys Temp:    +38.0°C  (low  = -127.0°C, high = +127.0°C)  
cpu0_vid:   +2.050 V

smsc47m1-isa-0680
Adapter: ISA adapter
fan1:          0 RPM  (min = 1280 RPM, div = 4)  ALARM
fan2:       6144 RPM  (min = 1280 RPM, div = 4)

This is the output when you run the lmsensor.pl script with debugoptions= 2 from the commandline.

[root@mybox bin]# lmsensor.pl -d 2
<----- Copy the following output and past it into the %monitor array ----->

		#'+2.5V', 'Magenta',
		#'VCore', 'Default',
		#'+3.3V', 'Default',
		#'+5V', 'Default',
		#'+12V', 'Default',
		#'VCC', 'Default',
		#'+1.5V', 'Default',
		#'+1.8V', 'Default',
		#'Chip Temp', 'Red',
		#'CPU Temp', 'Green',
		#'Sys Temp', 'Default',
		#'cpu0_vid', 'Default',
		#'fan1', 'Default',
		#'fan2', 'Dark Faded Red'

Copy and past this into the script. Uncomment the sensor lines you want to monitor and your in business.

This is what it looks like when you get it working. Nothing fancy, but it suits my purpose.

Sensors

Summary

CPU Temp

Clicking on one of the graphs in the summary page will bring up the trend page for that sensor

Sensors Multi Column

For those with a widescreen monitor, you can use the sensormc.cgi script for 2 or more columns

F.R. Reedeker

Last modified 10 years ago Last modified on Apr 4, 2009, 10:18:48 PM

Attachments (6)

Download all attachments as: .zip


NOTE: The content of this website is accessible with any browser. The graphical design though relies completely on CSS2 styles. If you see this text, this means that your browser does not support CSS2. Consider upgrading to a standard conformant browser like Mozilla Firefox or Opera but also Apple's Safari or KDE's Konqueror for example. It may also be that you are looking at a mirror page which did not copy the CSS for this page. Or if some pictu res are missing, then the mirror may not have picked up the contents of the inc directory.