Unix Cpu Temperature and Fan Speed from mbmon or healthd

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
bff7755a
Posts: 2
Joined: Tue May 01, 2007 6:26 am

Unix Cpu Temperature and Fan Speed from mbmon or healthd

Post by bff7755a »

I writed some scripts for hardware monitoring.

Perl scripts:

MBMON Parser Perl Script
healthd Parser Perl Script

Graph Templates:
CPU Temperature Graph Template
Fan Speed Graph Template

Screenshots (I will update them when collect more data):

Image
Image
Julia41
Posts: 3
Joined: Sun Aug 19, 2007 10:41 am

Post by Julia41 »

The links doesn't work :/
Edit :
Link is :
http://unix-blog.com/data/cacti/cacti_g ... rature.xml
http://unix-blog.com/data/cacti/cacti_g ... _speed.xml

For the template, but I can't find the perl parser for mbmon :/
super-hornet
Cacti User
Posts: 175
Joined: Sun May 27, 2007 5:42 pm

Post by super-hornet »

Yup.. both script Link is not there.

SH
Julia41
Posts: 3
Joined: Sun Aug 19, 2007 10:41 am

Post by Julia41 »

I try to do a parse perl script with "inspirate" Qstats parse hls_query.pl
If you don't use this script :
Qstat give :

Code: Select all

www:/usr/share/cacti/site/scripts# qstat -a2s 91.121.25.199:27015
ADDRESS           PLAYERS      MAP   RESPONSE TIME    NAME
91.121.25.199:27015    0/16  awp_map      5 / 0  cstrike TEam Prout
And the script hls_query.pl return :

Code: Select all

www:/usr/share/cacti/site/scripts# perl hls_query.pl 91.121.25.199:27015
player_count:0 max_players:16
I want to do the same with mbmon -r
The -r option give this results :

Code: Select all

www:/usr/share/cacti/site/scripts# mbmon -r
TEMP0 : 35.0
TEMP1 : 17.0
TEMP2 : 30.0
FAN0  :    0
FAN1  :    0
FAN2  :    0
VC0   :  +1.15
VC1   :  +3.33
V33   :  +3.04
V50P  :  +4.95
V12P  : +11.13
V12N  :  -0.00
V50N  :  -0.00
I don't know the perl scripting, but at the begin I think modified hls_query.pl to work with mbmon it's very difficult, but my currently script doesn't work :

Code: Select all

#!/usr/bin/perl
# $ mbmon -r
# TEMP0 : 35.0
# TEMP1 : 22.0
# TEMP2 : 29.0
# FAN0  :    0
# FAN1  : 10546
# FAN2  :    0
# VC0   :  +1.23
# VC1   :  +3.33
# V33   :  +3.04
# V50P  :  +4.95
# V12P  : +11.13
# V12N  :  -0.00
# V50N  :  -0.00

$response = `mbmon -r`;
#@response = split('__',$response);
$response[1] =~ s/:/-/gi;
$response[2] =~ s/:/-/gi;
$response[3] =~ s/:/-/gi;
$response[4] =~ s/:/-/gi;
$response[5] =~ s/:/-/gi;
$response[6] =~ s/:/-/gi;
$response[7] =~ s/:/-/gi;
$response[8] =~ s/:/-/gi;
$response[9] =~ s/:/-/gi;
$response[10] =~ s/:/-/gi;
$response[11] =~ s/:/-/gi;
print "TEMP0:".$response[1]." ";
print "TEMP1:".$response[2]." ";
print "TEMP2:".$response[3]." ";
print "FAN0:".$response[4]." ";
print "FAN1:".$response[5]." ";
print "FAN2:".$response[6]." ";
print "VC0:".$response[7]." ";
print "VC1:".$response[8]." ";
print "V33:".$response[9]." ";
print "V50P:".$response[10]." ";
print "V12P:".$response[11]." ";
If someone can correct it :)
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

May you please post the result of a single run of that very script?
Reinhard
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Try this script instead.... Btw, didn't test, just wrote it off the top of my head.

Code: Select all

#!/usr/bin/perl

use strict;
my $mbmon = `which mbmon`;
my $output = "";

# Execute command
open(FH, $mbmon . " -r |") || die "Unable to open mbmon command";
foreach (<FH>) {
        if ($_ =~ /^(\S+)\s*\:\s*(\S+)$/) {
                $output .= $1 . ":" . $2 . " ";
        }
}
close (FH);

# Output Results
if ($output) {
        $output =~ s/ $/\n/;
        print $output;
        exit 0;
}
print "U\n";
exit 1;

[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
User avatar
vmicovic
Posts: 48
Joined: Wed Aug 15, 2007 9:57 am

Post by vmicovic »

links for download this perl scritps?
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests