diff --git a/lib/check/idrac.py b/lib/check/idrac.py index 0c3d40d..816906f 100644 --- a/lib/check/idrac.py +++ b/lib/check/idrac.py @@ -45,6 +45,21 @@ def status_list(item: dict, metric: str): ] +def do_rename(state: dict): + return { + 'systemState': [ + {k.lstrip('systemState'): v for k, v in item} + for item in state['systemStateTableEntry']], + 'eventLog': [ + {k.lstrip('eventLog'): v for k, v in item} + for item in state['eventLogTableEntry']], + + 'firmware': [ + {k.lstrip('firmware'): v for k, v in item} + for item in state['firmwareTableEntry']], + } + + async def check_idrac( asset: Asset, asset_config: dict, @@ -77,4 +92,4 @@ async def check_idrac( status_list(item, 'systemStatePowerUnitStatusList') status_list(item, 'systemStateProcessorDeviceStatusList') - return state + return do_rename(state) diff --git a/requirements.txt b/requirements.txt index 2416908..6869f6f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ asyncsnmplib==0.1.11 -libprobe==0.2.33 +libprobe==0.2.35