Unix Cpu Temperature and Fan Speed from mbmon or healthd
Moderators: Developers, Moderators
Unix Cpu Temperature and Fan Speed from mbmon or healthd
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):
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):
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 :/
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 :/
-
- Cacti User
- Posts: 175
- Joined: Sun May 27, 2007 5:42 pm
I try to do a parse perl script with "inspirate" Qstats parse hls_query.pl
If you don't use this script :
Qstat give :
And the script hls_query.pl return :
I want to do the same with mbmon -r
The -r option give this results :
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 :
If someone can correct it
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
Code: Select all
www:/usr/share/cacti/site/scripts# perl hls_query.pl 91.121.25.199:27015
player_count:0 max_players:16
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
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]." ";
- rony
- Developer/Forum Admin
- Posts: 6022
- Joined: Mon Nov 17, 2003 6:35 pm
- Location: Michigan, USA
- Contact:
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]
[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]
Who is online
Users browsing this forum: No registered users and 0 guests