diff --git a/xen-bugtool b/xen-bugtool index c61a953f..1039c032 100755 --- a/xen-bugtool +++ b/xen-bugtool @@ -1067,6 +1067,10 @@ exclude those logs from the archive. 'vgscan-log']]) tree_output(CAP_XENSERVER_INSTALL, INSTALLED_REPOS_DIR) tree_output(CAP_XENSERVER_INSTALL, UPDATE_APPLIED_DIR) + func_output(CAP_XENSERVER_CONFIG, 'snmp_xs_conf', snmp_xs_conf) + func_output(CAP_XENSERVER_CONFIG, 'snmpd_xs_conf', snmpd_xs_conf) + func_output(CAP_XENSERVER_CONFIG, 'snmpd_conf', snmpd_conf) + func_output(CAP_XENSERVER_CONFIG, 'snmpd', snmpd) try: load_plugins() @@ -1516,6 +1520,38 @@ def multipathd_topology(cap): return stdout +def snmp_xs_conf(cap): + sed_snmp_xs_conf = ['sed', + '-e', 's#\(community *= *\).*#\\1********#', + '-e', 's#\(authentication_key *= *\).*#\\1********#', + '-e', 's#\(privacy_key *= *\).*#\\1********#', + '/etc/snmp/snmp.xs.conf'] + pipe = Popen(sed_snmp_xs_conf, bufsize=1, stdin=PIPE, stdout=PIPE, stderr=dev_null) + stdout, _ = pipe.communicate() + return stdout + +def snmpd_xs_conf(cap): + sed_snmpd_xs_conf = ['sed', + '-e', 's#\(com2sec\( \+\S\+\)\{2\} \+\).*#\\1********#', + '/etc/snmp/snmpd.xs.conf'] + pipe = Popen(sed_snmpd_xs_conf, bufsize=1, stdin=PIPE, stdout=PIPE, stderr=dev_null) + stdout, _ = pipe.communicate() + return stdout + +def snmpd_conf(cap): + sed_snmpd_conf = ['sed', + '-e', 's#\(usmUser\( \+\S\+\)\{7\} \+\)\S\+\( \+\S\+ \+\)\S\+\( \+\S\+\)#\\1********\\3********\\4#', + '/var/lib/net-snmp/snmpd.conf'] + pipe = Popen(sed_snmpd_conf, bufsize=1, stdin=PIPE, stdout=PIPE, stderr=dev_null) + stdout, _ = pipe.communicate() + return stdout + +def snmpd(cap): + cat_snmpd = ['cat', '/etc/sysconfig/snmpd'] + pipe = Popen(cat_snmpd, bufsize=1, stdin=PIPE, stdout=PIPE, stderr=dev_null) + stdout, _ = pipe.communicate() + return stdout + def dp_list(): output = StringIO.StringIO() procs = [ProcOutput([OVS_DPCTL, 'dump-dps'], caps[CAP_NETWORK_STATUS][MAX_TIME], output)]