|
|
| Author |
Message |
draug
Joined: 05 Sep 2007 Posts: 1
|
Posted: Wed Sep 05, 2007 1:00 am Post subject: CPU Temperature |
|
|
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!
| Description: |
|
| Filesize: |
13.77 KB |
| Viewed: |
2173 Time(s) |

|
| Description: |
|
 Download |
| Filename: |
cpu-temperature.pl |
| Filesize: |
219 Bytes |
| Downloaded: |
192 Time(s) |
| Description: |
|
 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
|
Posted: Sun Sep 09, 2007 8:52 pm Post subject: |
|
|
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
|
Posted: Wed Sep 26, 2007 5:21 am Post subject: Problem template temperature |
|
|
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
|
Posted: Wed Sep 26, 2007 3:40 pm Post subject: using ipmitool |
|
|
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 |
|
 |
|