Fix parsing of current nvidia_smi section
General information
The XML output of current nvidia-smi commands contain two changes:
-
power_readingswas renamed togpu_power_readings -
power_managementwas removed
You can find an example of the recent XML in https://github.com/influxdata/telegraf/issues/13653
Bug reports
Section parsing for nvidia_smi fails because it cannot find some expected elements in recent versions of the nvidia-smi output.
Proposed changes
This is an imroved version of PR #669
- What is the expected behavior? Section can be parsed
- What is the observed behavior? Section parsing crashes because it cannot find some XML elements
- If it's not obvious from the above: In what way does your patch change the current behavior?
The PR checks if an XML element with the new name
gpu_power_readingsexists. If not it fails back to the old element namepower_readings. For the elementpower_managementthat has been removed it checks if it exists. If not it assumes a default of "Supported"
I have read the CLA Document and I hereby sign the CLA or my organization already has a signed CLA.
Have successfully tested this PR. So hope the CheckMK devs will integrate it to get the NVIDIA GPU related issues fixed in one of the next checkmk releases.
Thank you! I'll bring this into the next releases.