aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVikas Goel <vikas.goel@veritas.com>2021-08-02 12:45:08 -0700
committerJake Hunsaker <jhunsake@redhat.com>2021-08-03 15:30:05 -0400
commitbc2322d2e7f7af42b4f581843435d500d7a6b150 (patch)
tree087f76480423f7e68c058bdd171458f033e49ec6
parent7df45d4cc81646fe95234c6c496fc44b6a18d4ed (diff)
downloadsos-bc2322d2e7f7af42b4f581843435d500d7a6b150.tar.gz
[storcli] Add 'json' option collecting data in JSON format.
Signed-off-by: Vikas Goel <vikas.goel@gmail.com>
-rw-r--r--sos/report/plugins/storcli.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/sos/report/plugins/storcli.py b/sos/report/plugins/storcli.py
index 6b1147bb..720c407d 100644
--- a/sos/report/plugins/storcli.py
+++ b/sos/report/plugins/storcli.py
@@ -17,17 +17,21 @@ class StorCLI(Plugin, IndependentPlugin):
profiles = ('system', 'storage', 'hardware',)
packages = ('storcli',)
+ option_list = [
+ ("json", "collect data in JSON format", "fast", False)
+ ]
+
def setup(self):
cmd = '/opt/MegaRAID/storcli/storcli64'
subcmds = [
- 'show ctrlcount J',
+ 'show ctrlcount',
'/call show AliLog',
'/call show all',
'/call show events',
'/call show termlog',
'/call/bbu show all',
'/call/cv show all',
- '/call/dall show J',
+ '/call/dall show',
'/call/eall show all',
'/call/eall/sall show all',
'/call/sall show all',
@@ -36,9 +40,12 @@ class StorCLI(Plugin, IndependentPlugin):
logpath = self.get_cmd_output_path()
+ json = ' J' if self.get_option('json') else ''
+
for subcmd in subcmds:
self.add_cmd_output(
- "%s %s" % (cmd, subcmd),
- suggest_filename="storcli64_%s" % subcmd, runat=logpath)
+ "%s %s%s" % (cmd, subcmd, json),
+ suggest_filename="storcli64_%s%s" % (subcmd, json),
+ runat=logpath)
# vim: set et ts=4 sw=4 :