From 960e335d150422fb2e0bb02630b9d577455c54b0 Mon Sep 17 00:00:00 2001 From: Jannik Schönartz Date: Tue, 10 Nov 2020 16:25:19 +0100 Subject: Add lshw --- modules.d/bas-python/scripts/00collect_hw_info_json.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules.d/bas-python/scripts/00collect_hw_info_json.py b/modules.d/bas-python/scripts/00collect_hw_info_json.py index 9f663640..77e62edb 100755 --- a/modules.d/bas-python/scripts/00collect_hw_info_json.py +++ b/modules.d/bas-python/scripts/00collect_hw_info_json.py @@ -112,6 +112,13 @@ def get_edid(): edid.append(edid_hex) return edid +def get_lshw(): + result = [] + lshw_raw = run_subprocess('lshw -json') + if isinstance(lshw_raw, str): + result = json.loads(lshw_raw) + return result + def main(): global __debug @@ -130,6 +137,7 @@ def main(): _collecthw['lspci'] = get_lspci() _collecthw['ip'] = get_ip() _collecthw['edid'] = get_edid() + _collecthw['lshw'] = get_lshw() # Print out the final json print(json.dumps(_collecthw)) -- cgit v1.2.3-55-g7522