View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 2 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Sat Nov 28, 2009 6:42 pm 
Offline
Joined: Fri Nov 04, 2005 7:11 am
Posts: 61
RRD is a very cool LinHes extra that lets you easily monitor various aspects of your system from the LinHes webpage.

I noticed that motherboard temperatures weren't displaying in the RRDTool page and made some changes to my system to get the temperatures displayed and to improve the look of the display. I thought the temperature graphs were difficult to read, so I added a color gradient under the temperature lines to make the data easier to understand. (RRDtools can be added from the service menu btw.)

1. Check and see if mbmon has temperature data for your system.
Code:
mbmon -r -c 1


2. If it does, make rrd_mbtemp.pl executable (as root).
Code:
chmod +x /usr/bin/rrd_mbtemp.pl


3. Edit /usr/bin/rrd_mbtemp.pl
a. Redefine the locations to be R6 compatible.
Code:
# define location of rrdtool databases
my $rrd = '/var/lib/rrd';
# define location of images
my $img = '/data/srv/httpd/htdocs/rrd';


b. Comment out any components that you didn't get data for in step 1.
Code:
# Note TEMP0 = T 1, TEMP1 = T 2, TEMP2 = T 3
&ProcessHDD("mbtemp", "T 1", "Motherboard");
#&ProcessHDD("cputemp", "T 2", "CPU");
#&ProcessHDD("ambtemp", "T 3", "Case ambient");


c. Change the size, color and labels of the graph to match the others on the RRDTool page.
Code:
        RRDs::graph "$img/$_[0]-$_[1].png",
                "--lazy",
                "-s -1$_[1]",
                "--color", "SHADEA#EAE9EE",
                "--color", "SHADEB#EAE9EE",
                "--color", "BACK#EAE9EE",
                "-t $_[2] Temperature - $_[1]",
                "-h", "100", "-w", "600",


d. Add a color gradient below the temperature line to make the graph more attractive. (A good perl coder could shorten this section up substantially.)
Code:
      # This CDEF section defines a variable for every 5 degree increment of temperature
      # between 5 and 130 degrees. Undefined/unknown variables are set to zero.
      "CDEF:tempz=temp,130,LT,temp,130,IF",
      "CDEF:tempzNoUnk=temp,UN,0,tempz,IF",
      "CDEF:tempy=temp,125,LT,temp,125,IF",
      "CDEF:tempyNoUnk=temp,UN,0,tempy,IF",
      "CDEF:tempx=temp,120,LT,temp,120,IF",
      "CDEF:tempxNoUnk=temp,UN,0,tempx,IF",
      "CDEF:tempw=temp,115,LT,temp,115,IF",
      "CDEF:tempwNoUnk=temp,UN,0,tempw,IF",
      "CDEF:tempv=temp,110,LT,temp,110,IF",
      "CDEF:tempvNoUnk=temp,UN,0,tempv,IF",
      "CDEF:tempu=temp,105,LT,temp,105,IF",
      "CDEF:tempuNoUnk=temp,UN,0,tempu,IF",
      "CDEF:tempt=temp,100,LT,temp,100,IF",
      "CDEF:temptNoUnk=temp,UN,0,tempt,IF",
      "CDEF:temps=temp,95,LT,temp,95,IF",
      "CDEF:tempsNoUnk=temp,UN,0,temps,IF",
      "CDEF:tempr=temp,90,LT,temp,90,IF",
      "CDEF:temprNoUnk=temp,UN,0,tempr,IF",
      "CDEF:tempq=temp,85,LT,temp,85,IF",
      "CDEF:tempqNoUnk=temp,UN,0,tempq,IF",
      "CDEF:tempp=temp,80,LT,temp,80,IF",
      "CDEF:temppNoUnk=temp,UN,0,tempp,IF",
      "CDEF:tempo=temp,75,LT,temp,75,IF",
      "CDEF:tempoNoUnk=temp,UN,0,tempo,IF",
      "CDEF:tempn=temp,70,LT,temp,70,IF",
      "CDEF:tempnNoUnk=temp,UN,0,tempn,IF",
      "CDEF:tempm=temp,65,LT,temp,65,IF",
      "CDEF:tempmNoUnk=temp,UN,0,tempm,IF",
      "CDEF:templ=temp,60,LT,temp,60,IF",
      "CDEF:templNoUnk=temp,UN,0,templ,IF",
      "CDEF:tempk=temp,55,LT,temp,55,IF",
      "CDEF:tempkNoUnk=temp,UN,0,tempk,IF",
      "CDEF:tempj=temp,50,LT,temp,50,IF",
      "CDEF:tempjNoUnk=temp,UN,0,tempj,IF",
      "CDEF:tempi=temp,45,LT,temp,45,IF",
      "CDEF:tempiNoUnk=temp,UN,0,tempi,IF",
      "CDEF:temph=temp,40,LT,temp,40,IF",
      "CDEF:temphNoUnk=temp,UN,0,temph,IF",
      "CDEF:tempg=temp,35,LT,temp,35,IF",
      "CDEF:tempgNoUnk=temp,UN,0,tempg,IF",
      "CDEF:tempf=temp,30,LT,temp,30,IF",
      "CDEF:tempfNoUnk=temp,UN,0,tempf,IF",
      "CDEF:tempe=temp,25,LT,temp,25,IF",
      "CDEF:tempeNoUnk=temp,UN,0,tempe,IF",
      "CDEF:tempd=temp,20,LT,temp,20,IF",
      "CDEF:tempdNoUnk=temp,UN,0,tempd,IF",
      "CDEF:tempc=temp,15,LT,temp,15,IF",
      "CDEF:tempcNoUnk=temp,UN,0,tempc,IF",
      "CDEF:tempb=temp,10,LT,temp,10,IF",
      "CDEF:tempbNoUnk=temp,UN,0,tempb,IF",
      "CDEF:tempa=temp,5,LT,temp,5,IF",
      "CDEF:tempaNoUnk=temp,UN,0,tempa,IF",

      # This section defines a color gradient for displaying the temperature data
      "AREA:tempzNoUnk#ff0000",
      "AREA:tempyNoUnk#ff0000",
      "AREA:tempxNoUnk#ff0000",
      "AREA:tempwNoUnk#ff0000",
      "AREA:tempvNoUnk#ff1b00",
      "AREA:tempuNoUnk#ff4100",
      "AREA:temptNoUnk#ff6600",
      "AREA:tempsNoUnk#ff8e00",
      "AREA:temprNoUnk#ffb500",
      "AREA:tempqNoUnk#ffdb00",
      "AREA:temppNoUnk#fdff00",
      "AREA:tempoNoUnk#d7ff00",
      "AREA:tempnNoUnk#b0ff00",
      "AREA:tempmNoUnk#8aff00",
      "AREA:templNoUnk#65ff00",
      "AREA:tempkNoUnk#3eff00",
      "AREA:tempjNoUnk#17ff00",
      "AREA:tempiNoUnk#00ff10",
      "AREA:temphNoUnk#00ff36",
      "AREA:tempgNoUnk#00ff5c",
      "AREA:tempfNoUnk#00ff83",
      "AREA:tempeNoUnk#00ffa8",
      "AREA:tempdNoUnk#00ffd0",
      "AREA:tempcNoUnk#00fff4",
      "AREA:tempbNoUnk#00e4ff",
      "AREA:tempaNoUnk#00beff",

                # Line along the top of the gradient graph
      "LINE2:temp#0000FF:$_[2] ($_[0])",


6. Edit /usr/bin/run_rrd.sh to include running mbtemp
Code:
RRD='hddtemp disk traffic mem cpu usage ups mbtemp'


7. Edit /data/srv/httpd/htdocs/rrd/index-rrd.html to include the new graphs. Include a section for mbtemp, cputemp and ambtemp, appropriate for what you found in steps 1 and 3b. I didn't have data for cputemp and ambtemp, so I only added the following:
Code:
<FONT=BOLD>Motherboard Temperature</FONT>
<P>
<IMG SRC = "mbtemp-day.png">
<IMG SRC = "mbtemp-week.png">
<IMG SRC = "mbtemp-month.png">
<IMG SRC = "mbtemp-year.png">
</P>


8. Every 5 minutes, the rrd graphs get updated. Just hit refresh on your browser to see the new graph(s).
http://your_myth_address/rrd/index.html

9. Edit /usr/bin/rrd_hddtemp.pl to make the graphs compatible with the rest of the page.
a. Edit and or comment out the appropriate drives to match your equipment.
Code:
# process data for each specified HDD (add/delete as required)
&ProcessHDD("sda", "400GB WD");
&ProcessHDD("sdb", "1TB Seagate");
#&ProcessHDD("hdc", "40GB Seagate");
#&ProcessHDD("hdd", "secondary slave");


b. Change the background colors, graph size and label.
Code:
       RRDs::graph "$img/$_[0]-$_[1].png",
                "--lazy",
                "-s -1$_[1]",
                "--color", "SHADEA#EAE9EE",
                "--color", "SHADEB#EAE9EE",
                "--color", "BACK#EAE9EE",
                "-t Temperature of $_[2] (/dev/$_[0]) - $_[1]",
                "-h", "100", "-w", "600",


c. Add the gradient colors under the temperature line. (A good perl coder could shorten this section substantially.)
Code:
                # This CDEF section defines a variable for every 5 degree increment of temperature
                # between 5 and 130 degrees. Undefined/unknown variables are set to zero.
      "CDEF:tempz=temp,130,LT,temp,130,IF",
      "CDEF:tempzNoUnk=temp,UN,0,tempz,IF",
      "CDEF:tempy=temp,125,LT,temp,125,IF",
      "CDEF:tempyNoUnk=temp,UN,0,tempy,IF",
      "CDEF:tempx=temp,120,LT,temp,120,IF",
      "CDEF:tempxNoUnk=temp,UN,0,tempx,IF",
      "CDEF:tempw=temp,115,LT,temp,115,IF",
      "CDEF:tempwNoUnk=temp,UN,0,tempw,IF",
      "CDEF:tempv=temp,110,LT,temp,110,IF",
      "CDEF:tempvNoUnk=temp,UN,0,tempv,IF",
      "CDEF:tempu=temp,105,LT,temp,105,IF",
      "CDEF:tempuNoUnk=temp,UN,0,tempu,IF",
      "CDEF:tempt=temp,100,LT,temp,100,IF",
      "CDEF:temptNoUnk=temp,UN,0,tempt,IF",
      "CDEF:temps=temp,95,LT,temp,95,IF",
      "CDEF:tempsNoUnk=temp,UN,0,temps,IF",
      "CDEF:tempr=temp,90,LT,temp,90,IF",
      "CDEF:temprNoUnk=temp,UN,0,tempr,IF",
      "CDEF:tempq=temp,85,LT,temp,85,IF",
      "CDEF:tempqNoUnk=temp,UN,0,tempq,IF",
      "CDEF:tempp=temp,80,LT,temp,80,IF",
      "CDEF:temppNoUnk=temp,UN,0,tempp,IF",
      "CDEF:tempo=temp,75,LT,temp,75,IF",
      "CDEF:tempoNoUnk=temp,UN,0,tempo,IF",
      "CDEF:tempn=temp,70,LT,temp,70,IF",
      "CDEF:tempnNoUnk=temp,UN,0,tempn,IF",
      "CDEF:tempm=temp,65,LT,temp,65,IF",
      "CDEF:tempmNoUnk=temp,UN,0,tempm,IF",
      "CDEF:templ=temp,60,LT,temp,60,IF",
      "CDEF:templNoUnk=temp,UN,0,templ,IF",
      "CDEF:tempk=temp,55,LT,temp,55,IF",
      "CDEF:tempkNoUnk=temp,UN,0,tempk,IF",
      "CDEF:tempj=temp,50,LT,temp,50,IF",
      "CDEF:tempjNoUnk=temp,UN,0,tempj,IF",
      "CDEF:tempi=temp,45,LT,temp,45,IF",
      "CDEF:tempiNoUnk=temp,UN,0,tempi,IF",
      "CDEF:temph=temp,40,LT,temp,40,IF",
      "CDEF:temphNoUnk=temp,UN,0,temph,IF",
      "CDEF:tempg=temp,35,LT,temp,35,IF",
      "CDEF:tempgNoUnk=temp,UN,0,tempg,IF",
      "CDEF:tempf=temp,30,LT,temp,30,IF",
      "CDEF:tempfNoUnk=temp,UN,0,tempf,IF",
      "CDEF:tempe=temp,25,LT,temp,25,IF",
      "CDEF:tempeNoUnk=temp,UN,0,tempe,IF",
      "CDEF:tempd=temp,20,LT,temp,20,IF",
      "CDEF:tempdNoUnk=temp,UN,0,tempd,IF",
      "CDEF:tempc=temp,15,LT,temp,15,IF",
      "CDEF:tempcNoUnk=temp,UN,0,tempc,IF",
      "CDEF:tempb=temp,10,LT,temp,10,IF",
      "CDEF:tempbNoUnk=temp,UN,0,tempb,IF",
      "CDEF:tempa=temp,5,LT,temp,5,IF",
      "CDEF:tempaNoUnk=temp,UN,0,tempa,IF",

                # This section defines a color gradient for displaying the temperature data
      "AREA:tempzNoUnk#ff0000",
      "AREA:tempyNoUnk#ff0000",
      "AREA:tempxNoUnk#ff0000",
      "AREA:tempwNoUnk#ff0000",
      "AREA:tempvNoUnk#ff1b00",
      "AREA:tempuNoUnk#ff4100",
      "AREA:temptNoUnk#ff6600",
      "AREA:tempsNoUnk#ff8e00",
      "AREA:temprNoUnk#ffb500",
      "AREA:tempqNoUnk#ffdb00",
      "AREA:temppNoUnk#fdff00",
      "AREA:tempoNoUnk#d7ff00",
      "AREA:tempnNoUnk#b0ff00",
      "AREA:tempmNoUnk#8aff00",
      "AREA:templNoUnk#65ff00",
      "AREA:tempkNoUnk#3eff00",
      "AREA:tempjNoUnk#17ff00",
      "AREA:tempiNoUnk#00ff10",
      "AREA:temphNoUnk#00ff36",
      "AREA:tempgNoUnk#00ff5c",
      "AREA:tempfNoUnk#00ff83",
      "AREA:tempeNoUnk#00ffa8",
      "AREA:tempdNoUnk#00ffd0",
      "AREA:tempcNoUnk#00fff4",
      "AREA:tempbNoUnk#00e4ff",
      "AREA:tempaNoUnk#00beff",

                # Line along the top of the gradient graph
      "LINE2:temp#0000FF:$_[2] (/dev/$_[0])",


Enjoy. The color gradients make the temperature displays look much better. Once you get accustomed to the scale, you can absorb the temperature data much more easily. The color coding that I used isn't specific to any particular device, it just looked good to me. It is easy enough to customize using the gimp to draw a gradient and sampling the colors along the gradient with an eye dropper tool.

I posted copies of my rrd_mbtemp.pl, rrd_hddtemp.pl, run_rrd.sh and index-rrd.html over on flyspray if anyone wants to see them.
http://linhes.org/flyspray/index.php?do=details&task_id=586

_________________
BE: R8.4, HVR2250, MCE media center remote, GigaByte GA-EP43-UD3L, 2gb ram

FE: Linhes 8.4, Mythbuntu, Linux Mint DE


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 14, 2009 9:28 pm 
Offline
Joined: Wed Jun 06, 2007 3:29 am
Posts: 38
Location: Australia
Thanks for the howto rsay :D

Worked nicely on my ASUS M3N78-EM (TEMP2 = CPU and TEMP0 = Chipset).

Would have needed far more time than I have available to work this out all by myself...


HTD.


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: Baidu [Spider] and 3 guests


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 post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu