diff options
author | Jannik Schönartz | 2020-11-03 18:44:52 +0100 |
---|---|---|
committer | Jannik Schönartz | 2020-11-03 18:44:52 +0100 |
commit | 66c9e269e46a8ed5493d4d3aa4098ca4f6c8decd (patch) | |
tree | 1e15f44527ec5d4b0c9b20f6537c27b8becb2bdc | |
parent | Fix edit/edid typo :D (diff) | |
download | systemd-init-66c9e269e46a8ed5493d4d3aa4098ca4f6c8decd.tar.gz systemd-init-66c9e269e46a8ed5493d4d3aa4098ca4f6c8decd.tar.xz systemd-init-66c9e269e46a8ed5493d4d3aa4098ca4f6c8decd.zip |
Add ip data for ip and mac information
-rwxr-xr-x | modules.d/bas-python/scripts/00collect_hw_info_json.py | 9 |
1 files changed, 9 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 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 |