jablonka.czprosek.czf

hotsanic

Subversion Repositories:
[/] [branches/] [HotSaNIC-0.5.0-pre6/] [modules/] [sensors/] [platform/] [linux.pm] - Blame information for rev 1

 

Line No. Rev Author Line
11simandlpackage HotSaNICmod::OSdep;
2 
3use RRDs;
4 
5sub version {
6 ($VERSION = '$Revision: 1.9 $') =~ s/.*(\d+\.\d+).*/$1/;
7 return "$^O.pm $VERSION";
8 }
9 
10sub sample {
11 my %args=@_;
12 
13 foreach $entry (@{$args{SENSOR}}) {
14 my (undef,undef,$item,$dbname,undef,undef,undef,$num,$scale,$add)=HotSaNICmod::common::get_names($entry);
15 ($file)=split /\s+/,$item;
16 if (-e $file) {
17 open(DEVFILE,"$item") || HotSaNIClog::error("Unable to open $item.");
18 my $line=<DEVFILE>;
19 chomp $line;
20 close DEVFILE;
21 my @array=split /\s+/,$line;
22 my $value=$array[$num-1]*$scale+$add;
23 
24 HotSaNICmod::do_rrd($dbname,"50000",time,$value);
25 }
26 }
27 }
28 
291;
30 

Powered by WebSVN 2.2.1