hotsanic |
Subversion Repositories: |
Compare with Previous - Blame - Download
package HotSaNICmod::OSdep;
use lib "../../lib";
my $MODNAME;
sub version {
($VERSION = '$Revision: 1.6 $') =~ s/.*(\d+\.\d+).*/$1/;
return "default.pm $VERSION";
}
sub sample {
my %args=@_;
$MODNAME=$args{MODNAME};
foreach $entry (@{$args{HOST}}) {
my ($host,undef,undef,$dbname,undef,undef,undef)=HotSaNICmod::common::get_names($entry,"");
my $command="$args{NTPCOMMAND} -c sysinfo $host";
open FILE,"$command|" || HotSaNIClog::error("unable to run '$command': $!");
while (<FILE>) {
chomp;
(my $var,$value)=split /:\s+/;
$value=~s/[a-zA-Z ]*//g;
$str=$value if $var eq "stratum";
$dst=$value if $var eq "root distance";
$dps=$value if $var eq "root dispersion";
$frq=$value if $var eq "frequency";
$stb=$value if $var eq "stability";
}
close FILE;
HotSaNICmod::do_rrd($dbname,"U",time,$dps,$dst,$frq,$stb,$str);
}
}
1;