.IP "\fB\-\-all\fR"
Use all available capabilities.
.
-.IP "\fB\-\-ovs\fR"
-Use only Open vSwitch relevant capabilities.
-.
.IP "\fB\-\-capabilities\fR"
List \fBovs\-bugtool\fR capabilities.
.
.IP "\fB\-\-entries=\fIlist\fR"
Use the capabilities specified in a comma-separated list.
.
+.IP "\fB\-\-log\-days=\fIdays\fR"
+Include the logs rotated in the previous \fIdays\fR days in the debug bundle.
+The number of log files included has a big impact on the eventual bundle size.
+The default value is 20 days.
+.
.IP "\fB\-\-output=\fIfiletype\fR"
Generate a debug bundle with the specified file type. Options include
\fBtar\fR, \fBtar.gz\fR, \fBtar.bz2\fR, and \fBzip\fR.
.
+.IP "\fB\-\-ovs\fR"
+Use only Open vSwitch relevant capabilities.
+.
.IP "\fB\-\-silent\fR"
Suppress output.
.
output_type = 'tar.bz2'
output_fd = -1
+ # Default value for the number of rotated logs.
+ log_days = 20
+
if argv is None:
argv = sys.argv
(options, params) = getopt.gnu_getopt(
argv, 'sy', ['capabilities', 'silent', 'yestoall', 'entries=',
'output=', 'outfd=', 'outfile=', 'all', 'unlimited',
- 'debug', 'ovs'])
+ 'debug', 'ovs', 'log-days='])
except getopt.GetoptError, opterr:
print >>sys.stderr, opterr
return 2
only_ovs_info = True
collect_all_info = False
+ if k == '--log-days':
+ log_days = int(v) + 1
+
if len(params) != 1:
print >>sys.stderr, "Invalid additional arguments", str(params)
return 2
'ovs-xapi-sync.log', 'ovs-monitor-ipsec.log']])
for cap, logs in [system_logs, ovs_logs]:
file_output(cap, logs)
- file_output(cap, ['%s.%d' % (f, n) for n in range(20) for f in logs])
- file_output(cap, ['%s.%d.gz' % (f, n) for n in range(20) for f in logs])
+ file_output(cap,
+ ['%s.%d' % (f, n) for n in range(log_days) for f in logs])
+ file_output(cap,
+ ['%s.%d.gz' % (f, n) for n in range(log_days) for f in logs])
if not os.path.exists('/var/log/dmesg') and not os.path.exists('/var/log/boot'):
cmd_output(CAP_SYSTEM_LOGS, [DMESG])