Module: check_mk
Branch: master
Commit: b26884801bb1458f02537e7b645c6706dc02457d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b26884801bb145…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Dec 17 10:59:56 2014 +0100
Changed output style of --snmptranslate
---
modules/check_mk.py | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 8c2881e..6bf5620 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -4396,7 +4396,7 @@ def do_snmptranslate(walk):
output = process.read()
result = output.split("\n")[0::2]
for idx, line in enumerate(result):
- result_lines.append((line, lines[idx]))
+ result_lines.append((line.strip(), lines[idx].strip()))
except Exception, e:
print e
@@ -4422,13 +4422,8 @@ def do_snmptranslate(walk):
sys.stderr.write("\rfinished. \n")
# Output formatted
- longest_translation = 40
for translation, line in translated_lines:
- longest_translation = max(longest_translation, len(translation))
-
- format_string = "%%-%ds %%s" % longest_translation
- for translation, line in translated_lines:
- sys.stdout.write(format_string % (translation, line))
+ sys.stdout.write("%s --> %s\n" % (line, translation))
def do_snmpwalk(hostnames):
if opt_oids and opt_extra_oids: