Commit 0da353a4 authored by Olav Kvittem's avatar Olav Kvittem

netgetopt.pl migrert

parent 2720009a
......@@ -46,12 +46,12 @@ $DEFAULT_PORT = 1234;
#my oh my,more globals
my ($rtmp,$period,$last,$debug,$swfurl,$pageurl,$flash_version,$reconnect);
require "newgetopt.pl";
use Getopt::Long;
@opts=('list', 'man', 'net', 'rtp', 'mpeg', 'pcap', 'crude', 'bins=s', 'log', 'nperiod=s', 'period=s', 'last=s', 'packets=s', 'src=s', 'flow_key=s', 'flow_no=s', 'flow_min=s', 'nohead', 'dump=s', 'format=s', 'id=s', 'sum=s', 'ttl', 'rtt=s', 'codec=s', 'log', 'verbose', 'v', 'h', 'debug', 'av','xml=s', 'rtmp','tcp', 'port=s','swfurl=s','pageurl=s','flashversion=s','new','q','exclude=s','report=s', 'filename','test','ipv6','p=s','name=s','tcp_t','wait=s', 'version');
@opts=( 'list' => \$opt_list, 'man' => \$opt_man, 'net' => \$opt_net, 'rtp' => \$opt_rtp, 'mpeg' => \$opt_mpeg, 'pcap' => \$opt_pcap, 'crude' => \$opt_crude, 'bins=s' => \$opt_bins, 'log' => \$opt_log, 'nperiod=s' => \$opt_nperiod, 'period=s' => \$opt_period, 'last=s' => \$opt_last, 'packets=s' => \$opt_packets, 'src=s' => \$opt_src, 'flow_key=s' => \$opt_flow_key, 'flow_no=s' => \$opt_flow_no, 'flow_min=s' => \$opt_flow_min, 'nohead' => \$opt_nohead, 'dump=s' => \$opt_dump, 'format=s' => \$opt_format, 'id=s' => \$opt_id, 'sum=s' => \$opt_sum, 'ttl' => \$opt_ttl, 'rtt=s' => \$opt_rtt, 'codec=s' => \$opt_codec, 'log' => \$opt_log, 'verbose' => \$opt_verbose, 'v' => \$opt_v, 'h' => \$opt_h, 'debug' => \$opt_debug, 'av' => \$opt_av, 'xml=s' => \$opt_xml, 'rtmp' => \$opt_rtmp, 'tcp' => \$opt_tcp, 'port=s' => \$opt_port, 'swfurl=s' => \$opt_swfurl, 'pageurl=s' => \$opt_pageurl, 'flashversion=s' => \$opt_flashversion, 'new' => \$opt_new, 'q' => \$opt_q, 'exclude=s' => \$opt_exclude, 'report=s' => \$opt_report, 'filename' => \$opt_filename, 'test' => \$opt_test, 'ipv6' => \$opt_ipv6, 'p=s' => \$opt_p, 'name=s' => \$opt_name, 'tcp_t' => \$opt_tcp_t, 'wait=s' => \$opt_wait, 'version' => \$opt_version );
&NGetOpt(@opts) || die pod2usage(1);
GetOptions(@opts) || die pod2usage(1);
die pod2usage(1) if $opt_h;
die 'Version is $Rev: 46 $' if $opt_version;
$continous= ! $opt_packets;
......
......@@ -8,16 +8,14 @@ use Data::Dumper;
# use IO::Select;
# use Fcntl qw(F_GETFL F_SETFL O_NONBLOCK);
# use DateTime;
require "newgetopt.pl";
@opts=( 'bb=s', 'debug', 'dump', 'v', 'h', 'help' );
use Getopt::Long;
@opts=( 'bb=s' => \$opt_bb, 'debug' => \$opt_debug, 'dump' => \$opt_dump, 'v' => \$opt_v, 'h' => \$opt_h, 'help' => \$opt_help);
my $usage="Usage $0 [-debug] [-v] [-h]
-bb <hostname> - XYMON/BB host to receive reports
";
my $rc=&NGetOpt(@opts);
my $rc=GetOptions(@opts);
die $usage if not $rc or $opt_h or $opt_help;
my $bb_host = $opt_bb || `hostname -f`;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment