Merge branch 'master' into og-proctitle

This commit is contained in:
Oliver Gorwits
2014-08-06 20:45:22 +01:00

View File

@@ -45,12 +45,17 @@ use Pod::Usage;
use Getopt::Long; use Getopt::Long;
Getopt::Long::Configure ("bundling"); Getopt::Long::Configure ("bundling");
my ($device, $port, $extra, $debug) = (undef, undef, undef, 0); my ($device, $port, $extra, $debug);
my ($infotrace, $snmptrace, $sqltrace) = (0, 0, 0);
my $result = GetOptions( my $result = GetOptions(
'device|d=s' => \$device, 'device|d=s' => \$device,
'port|p=s' => \$port, 'port|p=s' => \$port,
'extra|e=s' => \$extra, 'extra|e=s' => \$extra,
'debug|D+' => \$debug, 'debug|D' => \$debug,
'infotrace|I+' => \$infotrace,
'snmptrace|S+' => \$snmptrace,
'sqltrace|Q+' => \$sqltrace,
) or pod2usage( ) or pod2usage(
-msg => 'error: bad options', -msg => 'error: bad options',
-verbose => 0, -verbose => 0,
@@ -61,12 +66,9 @@ my $CONFIG = config();
$CONFIG->{logger} = 'console'; $CONFIG->{logger} = 'console';
$CONFIG->{log} = ($debug ? 'debug' : 'info'); $CONFIG->{log} = ($debug ? 'debug' : 'info');
$ENV{INFO_TRACE} = 1 if $debug > 1; $ENV{INFO_TRACE} = $infotrace;
$ENV{DBIC_TRACE} = 1 if $debug > 2; $ENV{DBIC_TRACE_PROFILE} = 'console'; $ENV{SNMP_TRACE} = $snmptrace;
$ENV{SNMP_TRACE} = 1 if $debug > 3; $ENV{DBIC_TRACE} = $sqltrace; $ENV{DBIC_TRACE_PROFILE} = 'console';
$ENV{INFO_TRACE} = 2 if $debug > 4;
$ENV{SNMP_TRACE} = 2 if $debug > 5;
$ENV{SNMP_TRACE} = 3 if $debug > 6;
# reconfigure logging to force console output # reconfigure logging to force console output
Dancer::Logger->init('console', $CONFIG); Dancer::Logger->init('console', $CONFIG);
@@ -171,10 +173,7 @@ netdisco-do - Run any Netdisco job from the command-line.
=head1 SYNOPSIS =head1 SYNOPSIS
~/bin/netdisco-do <action> [-D] [-d <device> [-p <port>] [-e <extra>]] ~/bin/netdisco-do <action> [-DISQ] [-d <device> [-p <port>] [-e <extra>]]
Regardless of Netdisco configuration, debug level logging is enabled if the
C<-D> flag is given (up to seven times).
=head1 DESCRIPTION =head1 DESCRIPTION
@@ -248,38 +247,26 @@ Set the PoE on/off status on a device port. Requires the C<-d> parameter
=head1 DEBUG LEVELS =head1 DEBUG LEVELS
The debug flag "C<-D>" can be specified up to seven times, and enables the The flags "C<-DISQ>" can be specified, multiple times, and enable the
following items in order: following items in order:
=over 4 =over 4
=item 1 =item C<-D>
Netdisco debug log level Netdisco debug log level
=item 2 =item C<-I> or C<-II>
L<SNMP::Info> logging L<SNMP::Info> trace level (1 or 2).
=item 3 =item C<-S> or C<-SS> or C<-SSS>
L<DBIx::Class> logging L<SNMP> (net-snmp) trace level (1, 2 or 3).
=item 4 =item C<-Q>
L<SNMP> (net-snmp) logging L<DBIx::Class> trace enabled.
=item 5
Even more L<SNMP::Info> logging
=item 6
Even more L<SNMP> (net-snmp) logging
=item 7
Even more than more L<SNMP> (net-snmp) logging
=back =back