Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


CPU Temperature

 
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates
Author Message
draug



Joined: 05 Sep 2007
Posts: 1

PostPosted: Wed Sep 05, 2007 1:00 am    Post subject: CPU Temperature Reply with quote

Yo!

Since I could not find any working template for displaying CPU temperature, I wrote my own very simple script and created templates for it and decided to share them.

I used the ipmitool for querying the temperature.

Perl Script:
Code:

#!/usr/bin/perl -w

my $command = "ipmitool sensor";

#execute command
my @output = `$command`;

if ($output[0] =~ /^Temp[\s]+\|\s([0-9]+\.[0-9]+)/)
{
   print "cpu-temperature:$1";
} else {
   print "cpu-temperature:0";
}


Very simple.
I added both the script and the template to this post.

Import the template using the cacti console
and cp the script to the cacti scripts folder (/var/www/cacti/scripts/) and
/usr/local/bin

If your cacti scripts folder is somewhere else, you have to make appropriate changes to the data source entry of the template in the cacti console.

Enjoy!



cpu_temperature.png
 Description:
 Filesize:  13.77 KB
 Viewed:  2173 Time(s)

cpu_temperature.png



cpu-temperature.pl
 Description:
CPU Temperature Script

Download
 Filename:  cpu-temperature.pl
 Filesize:  219 Bytes
 Downloaded:  192 Time(s)


cacti_graph_template_cpu_temperature_graph.xml
 Description:
CPU Temperature Template

Download
 Filename:  cacti_graph_template_cpu_temperature_graph.xml
 Filesize:  6.87 KB
 Downloaded:  254 Time(s)

Back to top
N3NCY
Cacti User


Joined: 22 Sep 2005
Posts: 242
Location: Landenberg, PA

PostPosted: Sun Sep 09, 2007 8:52 pm    Post subject: Reply with quote

You need to have IPMItool installed:
http://ipmitool.sourceforge.net/

On FreeBSD you can install this by:
cd /usr/ports/sysutils/ipmitool
make install clean
Back to top
ferrero_sergio



Joined: 11 Sep 2007
Posts: 27

PostPosted: Wed Sep 26, 2007 5:21 am    Post subject: Problem template temperature Reply with quote

I have imported it in the cacti and the script this one inserted in the folder of scripts, the graph goes out for me but values do not go out for me, always one finds 0.
The machines that I monitor are Sun, this insole(staff) costs(suits) also for these machines??

In addition the ipdmitools I have it installed and when I throw(launch) the poller.php mistake goes out for me neither in the .pl nor anything

Very thanks!!!
Back to top
loufridkis



Joined: 26 Sep 2007
Posts: 1

PostPosted: Wed Sep 26, 2007 3:40 pm    Post subject: using ipmitool Reply with quote

I installed ipmitool with:
> yum install OpenIPMI-tools

This worked fine. But when I try to run it I get:
> ipmitool sensor
>> Could not open device at /dev/ipmi0 or /dev/ipmi/0 or /dev/ipmidev/0: No such file or
>> directory
>> Get Device ID command failed
>> Unable to open SDR for reading

But the man page says that OpenIPMI is correct for Linux, which is what i am running. Here is my system information:
>uname -s
>>Linux

>uname -o
>>GNU/Linux

>uname -i
>>i386

>uname -m
>>i686

>cat /etc/issue
>>CentOS release 4.3 (Final)

>rpm -qa|grep release
>>centos-release-4-3.2
>>rpmforge-release-0.3.6-1.el4.rf
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates All times are GMT - 5 Hours
Page 1 of 1

 



Powered by phpBB © 2001, 2005 phpBB Group