diff -ruN nagios-plugins-1.3.1/plugins-scripts/check_ntp.pl nagios-plugins-1.3.1-new/plugins-scripts/check_ntp.pl --- nagios-plugins-1.3.1/plugins-scripts/check_ntp.pl 2003-05-19 11:16:05.000000000 +0100 +++ nagios-plugins-1.3.1-new/plugins-scripts/check_ntp.pl 2003-07-14 19:46:20.000000000 +0100 @@ -57,12 +57,19 @@ # # Patch for for regex for stratum1 refid. +BEGIN { + if ($0 =~ m/^(.*?)[\/\\]([^\/\\]+)$/) { + $runtimedir = $1; + $PROGNAME = $2; + } +} + require 5.004; use POSIX; use strict; use Getopt::Long; use vars qw($opt_V $opt_h $opt_H $opt_w $opt_c $opt_j $opt_k $verbose $PROGNAME $def_jitter); -use lib utils.pm; +use lib $main::runtimedir; use utils qw($TIMEOUT %ERRORS &print_revision &support); $PROGNAME="check_ntp"; @@ -262,7 +269,7 @@ } # match sys.peer or pps.peer - if (/^(\*|o)([-0-9.\s]+)\s+([-0-9A-Za-z.]+)\s+([-0-9.]+)\s+([lumb]+)\s+([-0-9m.]+)\s+([-0-9.]+)\s+([-0-9.]+)\s+([-0-9.]+)\s+([-0-9.]+)\s+([-0-9.]+)/) { + if (/^(\*|o)([-0-9.\s]+)\s+([-0-9A-Za-z.]+)\s+([-0-9.]+)\s+([lumb]+)\s+([-0-9m.]+)\s+([-0-9.m]+)\s+([-0-9.]+)\s+([-0-9.]+)\s+([-0-9.]+)\s+([-0-9.]+)/) { $syspeer = $2; $stratum = $4; $jitter = $11;