[ntp:questions] "Trapping" in ntpd

Danny Mayer mayer at ntp.isc.org
Tue Oct 9 02:51:46 UTC 2007

Rob wrote:
> Thanks Steve.  It looks like we are both having problems with the -l
> option used in ntptrap. 
> I also noticed that there is a bug with the -n option.
> [rob at myarch ~]$ perl ntptrap -?
> Unknown option: ?
> usage: ntptrap [-n] [-p <port>] [-l <logfile>] [host] ...
> [rob at myarch ~]$ perl ntptrap -n
> Unknown option: n
> usage: ntptrap [-n] [-p <port>] [-l <logfile>] [host] ...
> Hmm.  Both usage and the readme state that the -n option exists.
> It is supposed to not set a trap (in those cases where a trap has already
> been set presumably vioa ntpdc).
> Oh well.. Not a big deal. Since ntptrap is the only trapping monitoring program, I see little need
> for the -n option.
> To get around the -l bug, one can just do:

It's happening because of the following code. I'm not sure where the
Getopts function is coming from but it's not reading the command line
options properly:

$opt_l = "/dev/null";	# where to write debug messages to
$opt_p = 0;		# port to use locally - (0 does mean: will be choosen by

&usage unless &Getopts('l:p:');
&Getopts if 0;	# make -w happy

@Hosts = ($#ARGV < $[) ? ("localhost") : @ARGV;

;# setup for debug output

More information about the questions mailing list