Linux ntp monitor perl

Version 1
    Click to view larger image

    Linux ntp monitor perl. Shows offeset, drift, noise, jitter and stability. Testet with ntp 4.3p3 on suse linux.

    @ntp_str = `ntpq -c rv $ARGV[0]`;       # execute "ntpq -c rv <node>"

    #print @ntp_str;

    $ntp_str = split(/,/,@ntp_str);

    #print "$ntp_str[7]\n";
    #print "$ntp_str[8]\n";

    $var1 = $ntp_str[7].$ntp_str[8];
    @var1 = split (/,/, $var1);

    print @var1;

    $offset = @var1[2];
    $offset =~ s/ offset=//i;
    print "$offset\n";

    $drift = @var1[3];
    $drift =~ s/ frequency=//i;
    print "$drift\n";

    $noise = @var1[4];
    $noise =~ s/ sys_jitter=//i;
    print "$noise\n";

    $jitter = @var1[5];
    $jitter =~ s/clk_jitter=//i;
    $jitter =~ tr/\r\n//d;
    print "$jitter\n";

    $stab = @var1[6];
    $stab =~ s/ clk_wander=//i;
    $stab =~ tr/\r\n//d;

    $stab = substr($stab,0,-1);
    print "$stab\n";