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: Wed Jun 16, 2010 10:48 pm 
Joined: Wed Jun 06, 2007 3:29 am
Posts: 38
Location: Australia
Have been fiddling around attempting to add my nVidia gpu temperature to the RRD charts provided in R6, and against all seems to work :D


If anyone else is interested, I made a few little mods to and just saved it as

I imagine it should work with any nvidia gpu that displays a temperature in nvidia-settings??

# copyright Martin Pot 2003

use RRDs;

# define location of rrdtool databases

my $rrd = '/var/lib/rrd';
# define location of images
my $img = '/data/srv/httpd/htdocs/rrd';

# process data for each specified HDD (add/delete as required)
&ProcessHDD("gpu", "nVidia 8300 IGP");
#&ProcessHDD("sdb", "slave");
#&ProcessHDD("hdc", "40GB Seagate");
#&ProcessHDD("hdd", "secondary slave");

sub ProcessHDD
# process HDD
# inputs: $_[0]: hdd (ie, hda, etc)
#         $_[1]: hdd description

        # get hdd temp for master drive on secondary IDE channel
        my $temp=`nvidia-settings -c :0 -q gpucoretemp -t`;
        # remove eol chars and white space
        $temp =~ s/[\n ]//g;

        print "$_[1] ($_[0]) temp: $temp degrees C\n";

        # if rrdtool database doesn't exist, create it
        if (! -e "$rrd/$_[0].rrd")
                print "creating rrd database for $_[0]...\n";
                RRDs::create "$rrd/$_[0].rrd",
                        "-s 300",

        # insert value into rrd
        RRDs::update "$rrd/$_[0].rrd",
                "-t", "temp",

        # create graphs
        &CreateGraph($_[0], "day", $_[1]);
        &CreateGraph($_[0], "week", $_[1]);
        &CreateGraph($_[0], "month", $_[1]);
        &CreateGraph($_[0], "year", $_[1]);

sub CreateGraph
# creates graph
# inputs: $_[0]: hdd name (ie, hda, etc)
#         $_[1]: interval (ie, day, week, month, year)
#         $_[2]: hdd description

        RRDs::graph "$img/$_[0]-$_[1].png",
                "-s -1$_[1]",
                "--color", "SHADEA#EAE9EE",
                "--color", "SHADEB#EAE9EE",
                "--color", "BACK#EAE9EE",
                "-t Temperature of $_[2] ($_[0]) - $_[1]",
                "-h", "100", "-w", "600",
                "-a", "PNG",
                "-v degrees C",

                # 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.

                # This section defines a color gradient for displaying the temperature data

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

                "GPRINT:temp:MIN:  Min\\: %2.lf",
                "GPRINT:temp:MAX: Max\\: %2.lf",
                "GPRINT:temp:AVERAGE: Avg\\: %4.1lf",
                "GPRINT:temp:LAST: Current\\: %2.lf degrees C\\n";
        if ($ERROR = RRDs::error) { print "$0: unable to generate $_[0] graph: $ERROR\n"; }

If you follow rsay's instructions (mostly 6. and 7.) here:, it isn't too hard to add.


 Post subject:
PostPosted: Wed Sep 15, 2010 8:42 pm 
Joined: Fri Nov 04, 2005 7:11 am
Posts: 61

Its working great for me.

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

FE: Linhes 8.4, Mythbuntu, Linux Mint DE


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: Google [Bot] and 2 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:  
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu