hotsanic |
Subversion Repositories: |
Compare with Previous - Blame - Download
package HotSaNICmod::OSdep;
use RRDs;
sub version {
($VERSION = '$Revision: 1.9 $') =~ s/.*(\d+\.\d+).*/$1/;
return "$^O.pm $VERSION";
}
sub sample {
my %args=@_;
foreach $entry (@{$args{SENSOR}}) {
my (undef,undef,$item,$dbname,undef,undef,undef,$num,$scale,$add)=HotSaNICmod::common::get_names($entry);
($file)=split /\s+/,$item;
if (-e $file) {
open(DEVFILE,"$item") || HotSaNIClog::error("Unable to open $item.");
my $line=<DEVFILE>;
chomp $line;
close DEVFILE;
my @array=split /\s+/,$line;
my $value=$array[$num-1]*$scale+$add;
HotSaNICmod::do_rrd($dbname,"50000",time,$value);
}
}
}
1;