jablonka.czprosek.czf

hotsanic

Subversion Repositories:
[/] [branches/] [HotSaNIC-0.5.0-pre6/] [modules/] [ntp/] [platform/] [default.pm] - Blame information for rev 18

 

Line No. Rev Author Line
11simandlpackage HotSaNICmod::OSdep;
2 
3use lib "../../lib";
4 
5my $MODNAME;
6 
7sub version {
8 ($VERSION = '$Revision: 1.6 $') =~ s/.*(\d+\.\d+).*/$1/;
9 return "default.pm $VERSION";
10 }
11 
12sub sample {
13 my %args=@_;
14 $MODNAME=$args{MODNAME};
15 
16 foreach $entry (@{$args{HOST}}) {
17 my ($host,undef,undef,$dbname,undef,undef,undef)=HotSaNICmod::common::get_names($entry,"");
18 my $command="$args{NTPCOMMAND} -c sysinfo $host";
19 open FILE,"$command|" || HotSaNIClog::error("unable to run '$command': $!");
20 while (<FILE>) {
21 chomp;
22 (my $var,$value)=split /:\s+/;
23 $value=~s/[a-zA-Z ]*//g;
24 $str=$value if $var eq "stratum";
25 $dst=$value if $var eq "root distance";
26 $dps=$value if $var eq "root dispersion";
27 $frq=$value if $var eq "frequency";
28 $stb=$value if $var eq "stability";
29 }
30 close FILE;
31 
32 HotSaNICmod::do_rrd($dbname,"U",time,$dps,$dst,$frq,$stb,$str);
33 }
34 }
35 
361;
37 
38 

Powered by WebSVN 2.2.1