summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJannik Schönartz2020-11-10 16:25:19 +0100
committerJannik Schönartz2020-11-10 16:25:19 +0100
commit960e335d150422fb2e0bb02630b9d577455c54b0 (patch)
treef731cb504885af3055e7a3d3f552053e4810bae2
parentAdd ip data for ip and mac information (diff)
downloadsystemd-init-960e335d150422fb2e0bb02630b9d577455c54b0.tar.gz
systemd-init-960e335d150422fb2e0bb02630b9d577455c54b0.tar.xz
systemd-init-960e335d150422fb2e0bb02630b9d577455c54b0.zip
Add lshw
-rwxr-xr-xmodules.d/bas-python/scripts/00collect_hw_info_json.py8
1 files changed, 8 insertions, 0 deletions
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))