From 66c9e269e46a8ed5493d4d3aa4098ca4f6c8decd Mon Sep 17 00:00:00 2001 From: Jannik Schönartz Date: Tue, 3 Nov 2020 18:44:52 +0100 Subject: Add ip data for ip and mac information --- modules.d/bas-python/scripts/00collect_hw_info_json.py | 9 +++++++++ 1 file changed, 9 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 894c12e5..9f663640 100755 --- a/modules.d/bas-python/scripts/00collect_hw_info_json.py +++ b/modules.d/bas-python/scripts/00collect_hw_info_json.py @@ -93,6 +93,14 @@ def get_lspci(): lspci.append(lspci_parsed) return lspci +# Get ip data in json format +def get_ip(): + result = [] + ip_raw = run_subprocess('ip --json addr show') + if isinstance(ip_raw, str): + result = json.loads(ip_raw) + return result + # Get and convert EDID data to hex def get_edid(): edid = [] @@ -120,6 +128,7 @@ def main(): _collecthw['dmidecode'] = get_dmidecode() _collecthw['smartctl'] = get_smartctl() _collecthw['lspci'] = get_lspci() + _collecthw['ip'] = get_ip() _collecthw['edid'] = get_edid() # Print out the final json -- cgit v1.2.3-55-g7522