checkmk icon indicating copy to clipboard operation
checkmk copied to clipboard

Update mk_inventory.vbs to include UBR in Windows OS version

Open gabrielgbs97 opened this issue 1 year ago • 3 comments

Retrieve minor windows version, this is useful to quickly know patch level among hosts.

See: https://ideas.checkmk.com/suggestions/484201/windows-mk_inventoryvbs-add-ubr-to-kernel-version

General information

Modified mk_inventory.vbs script to include full windows os version.

Bug reports

https://ideas.checkmk.com/suggestions/484201/windows-mk_inventoryvbs-add-ubr-to-kernel-version

Proposed changes

Query the registry in the same manner as in other parts of the script. I did not modify getWMIObject2, but rather rewrote a specific version of it to keep the code clean.

  • What is the expected behavior? Retrieve Full windows version
  • What is observed behavior? WMI inherently collects only the major build number, for instance, Windows 10 1809 corresponds to 10.0.17763. However, the complete version including the LCU would be 10.0.17763.6054.
  • If it's not obvious from the above: In what way does your patch change the current behavior? It queries registry for UBR number with existing object in the script to reutilize it. If UBR is not available, it does not append anything.
  • Consider writing a unit test that would have failed without your fix.
  • Is this a new problem? What made you submit this PR (new firmware, new device, changed device behavior)?

gabrielgbs97 avatar Aug 09 '24 08:08 gabrielgbs97

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

github-actions[bot] avatar Aug 09 '24 08:08 github-actions[bot]

I have read the CLA Document and I hereby sign the CLA or my organization already has a signed CLA.

gabrielgbs97 avatar Aug 09 '24 08:08 gabrielgbs97

recheck

gabrielgbs97 avatar Aug 09 '24 08:08 gabrielgbs97

tracking status?

gabrielgbs97 avatar Mar 25 '25 12:03 gabrielgbs97

Hi gabrielgbs97, apologies for the long silence.

We are currently reworking a lot of the VBS scripts for Windows and analyzing how to integrate your changes there as well. Our developers will soon be in touch.

Best, Torsten

englertor avatar Apr 15 '25 11:04 englertor

Hi @gabrielgbs97,

thank you for the proposed changes. I appreciate your input and will work on incorporating them.

Best regards, Diana

DavDiva avatar Apr 23 '25 13:04 DavDiva

Hi @gabrielgbs97,

as the mk_inventory.vbs is deprecated and was replaced by the mk_inventory.ps1, it was decided to implement the UBR feature already in the new script. Please see the implementation based on your approach here - https://github.com/Checkmk/checkmk/commit/058d48c982742465febb17f823eb6978cd7532cd. Thank you very much for the effort you put into this. Closing this PR now - appreciate your contribution.

Best regards, Diana

DavDiva avatar Apr 25 '25 07:04 DavDiva