package HotSaNICmod::OSdep; use RRDs; sub version { ($VERSION = '$Revision: 1.3 $') =~ s/.*(\d+\.\d+).*/$1/; return "$^O.pm $VERSION"; } sub sample { my %args=@_; # read mbmon data into a hash my $mbmon_bin = "/usr/pkg/bin/mbmon"; open MBMON, "$mbmon_bin -rc1 |" || HotSaNIClog::error("Unable to open $mbmon_min."); my @lines=; close MBMON; my %mbmon=(); foreach my $line (@lines) { ( $key = $line ) =~ s/^(\w*) .+$/$1/; ( $value = $line ) =~ s/^.*:\s*(.*)$/$1/; chomp $key; chomp $value; $mbmon{$key}=$value; } 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 ( $item = "mbmon" ) { my $value = $mbmon{$dbname} *$scale + $add; HotSaNICmod::do_rrd($dbname,"50000",time,$value); } elsif (-e $file) { open(DEVFILE,"$item") || HotSaNIClog::error("Unable to open $item."); my @lines=; close DEVFILE; my $value = $lines[$num]; chomp $value; $value =~ s/^.*:\s*(.*)$/$1/; $value = $value*$scale + $add; HotSaNICmod::do_rrd($dbname,"50000",time,$value); } } } 1; WebSVN - hotsanic - Blame - Rev 9 - /branches/HotSaNIC-0.5.0-pre6/modules/sensors/platform/netbsd.pm
  jablonka.czprosek.czf

hotsanic

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

 

Line No. Rev Author Line

Powered by WebSVN 2.2.1