summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJannik Schönartz2020-11-03 18:44:52 +0100
committerJannik Schönartz2020-11-03 18:44:52 +0100
commit66c9e269e46a8ed5493d4d3aa4098ca4f6c8decd (patch)
tree1e15f44527ec5d4b0c9b20f6537c27b8becb2bdc
parentFix edit/edid typo :D (diff)
downloadsystemd-init-66c9e269e46a8ed5493d4d3aa4098ca4f6c8decd.tar.gz
systemd-init-66c9e269e46a8ed5493d4d3aa4098ca4f6c8decd.tar.xz
systemd-init-66c9e269e46a8ed5493d4d3aa4098ca4f6c8decd.zip
Add ip data for ip and mac information
-rwxr-xr-xmodules.d/bas-python/scripts/00collect_hw_info_json.py9
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