jablonka.czprosek.czf

hotsanic

Subversion Repositories:
[/] [trunk/] [modules/] [crusader/] [platform/] [default.pm] - Diff between revs 13 and 14

Show entire file Ignore whitespace

Rev 13 Rev 14
Line 46... Line 46...
push @IFMACS,"$dev,$mac"; push @IFMACS,"$dev,$mac";
} }
} }
   
foreach $device (@IFACES) { foreach $device (@IFACES) {
my $rate = 0; my $power = 0;
my $tempin = 0; my $tempin = 0;
my $signal = 0; my $signal = 0;
my $noise = 0; my $voltage = 0;
my $mode = 0;  
   
$command = "cat /tmp/crusader.txt"; $command = "cat /tmp/crusader.txt";
open (FILE,"$command|"); open (FILE,"$command|");
while(<FILE>) { while(<FILE>) {
$var=$_; $var=$_;
#print "line: $_\n"; print "line: $_\n";
if ($var =~ /^(\d*)\s*(\d*)\s*(\d*)\s*(\d*)\s*([\w\.]*)\s*([\w\.]*)\s*([\w\.]*)\s*([\w\.]*)\s*([\w\.]*)/) { if ($var =~ /^(\d*)\s*(\d*)\s*(\d*)\s*(\d*)\s*([\w\.]*)\s*([\w\.]*)\s*([\w\.]*)\s*([\w\.]*)\s*([\w\.]*)/) {
$signal = $2; $signal = $2;
  $power = $5 * 10;
  $voltage = $7 * 10;
$tempin = $9 * 10; $tempin = $9 * 10;
#print "signal: $signal\n"; #print "signal: $signal\n";
#print "tempin: $tempin\n"; #print "tempin: $tempin\n";
} }
} # while } # while
close(FILE); close(FILE);
$rate=$rate*1;  
   
if ( ! -e "rrd/$device.rrd" ) { system("./makerrd","$device","U") } if ( ! -e "rrd/$device.rrd" ) { system("./makerrd","$device","U") }
RRDs::update "rrd/$device.rrd",time.":".$rate.":".$tempin.":".$signal.":".$noise; RRDs::update "rrd/$device.rrd",time.":".$power.":".$tempin.":".$signal.":".$voltage;
if ($ERROR = RRDs::error) { print time," ",$MODNAME,": unable to update `$device.rrd': $ERROR"; } if ($ERROR = RRDs::error) { print time," ",$MODNAME,": unable to update `$device.rrd': $ERROR"; }
} # foreach } # foreach
   
#uncomment this for debug output to temp.txt #uncomment this for debug output to temp.txt
#all print will be done into the file #all print will be done into the file

Powered by WebSVN 2.2.1