[ZBXNEXT-6848] Get exact Windows Build number and patch level via Zabbix agent Created: 2021 Aug 23 Updated: 2024 Apr 10 Resolved: 2023 Jan 01 |
|
Status: | Closed |
Project: | ZABBIX FEATURE REQUESTS |
Component/s: | Agent (G) |
Affects Version/s: | 5.4.3 |
Fix Version/s: | 6.4.0beta6, 6.4 (plan) |
Type: | New Feature Request | Priority: | Major |
Reporter: | Marco Hofmann | Assignee: | Konstantins Prutkovs (Inactive) |
Resolution: | Fixed | Votes: | 3 |
Labels: | None | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified | ||
Environment: |
Windows 10 since Feature level 1607 aka Windows Server 2016 |
Attachments: |
![]() ![]() ![]() ![]() ![]() ![]() |
||||||||||||
Issue Links: |
|
||||||||||||
Team: | |||||||||||||
Sprint: | Sprint 94 (Nov 2022), Sprint 95 (Dec 2022) | ||||||||||||
Story Points: | 1 |
Description |
Since Windows 10 or Windows Server 2016, it's possible to identify the exact version and patch level of any Windows, by looking at it's build number, for example: Start -> Run -> winver.exe It's easy to get this value with a UserParameter, but it's important enough to work out of the box IMHO. I suggest an item key similar to: system.sw.os which currently only works on Linux agents, but not on Windows agents. The return value should look like this: 17763.2114 |
Comments |
Comment by Alex Kalimulin [ 2022 Nov 02 ] | ||||||||
This can be implemented as a more generic item that returns JSON with multiple version parameters (product name, build number, patch, etc). Because various users can be interested in various version components. Something like this: system.sw.os.get[]: { "product_name": "Windows 10", "version": "21H1", "build": "12345.1234", "version_full": "Windows 10 21H1 12345.1234" } Then, in Windows by Zabbix agent template, we can make version_full a dependent item that is monitored for a change by the trigger "OS version has changed". We should also check if older Windows versions can provide this info somehow. The same system.sw.os.get[] can be also implemented for Linuxes (other Unixes - not sure, maybe) for the most popular distributions (RHEL, Debian, etc). | ||||||||
Comment by Marco Hofmann [ 2022 Nov 08 ] | ||||||||
That sounds awesome! Just keep in mind, that it would be very important, to get the exact build number. I've seen countless products in the past, where only the major build number was monitored, which is nearly worthless, in regard to patchlevel monitoring. We currently solve that as following: UserParameter=xenadmin.OSVersion,powershell.exe -NoProfile -NoLogo -ExecutionPolicy Bypass -Command "(Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' -Name CurrentBuild).CurrentBuild + \".\" + (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' -Name UBR).UBR" Regarding the older Windows builds, for Windows Server this started with 2016. Which is okay for us, as Windows Server 2012 dies October 2023. I would love to see the specifications, once they are ready, as we rely heavily on Windows OS monitoring. Maybe it should also become a part of the official Zabbix Windows OS template!? | ||||||||
Comment by Konstantins Prutkovs (Inactive) [ 2022 Nov 08 ] | ||||||||
Mini spec (v1.2)Currently system.sw.os item key is supported only for Linux OS. It is required that we add support for this key also on Windows OS, as well as, add a new item key system.sw.os.get for Linux and Windows that would yield json with system version information. Use CasesCase 1: User wants to get system version information for Windows OS.
What's affected:
JSON format of system.sw.os.get[]For Windows OS (depending on the system version) we can collect following information:
{ "os_type": "windows", "product_name": "Windows 11 Pro", "architecture": "x86_64", "build_number": "22621", "build_revision": "674", "build": "22621.674", "edition": "Professional", "composition": "Enterprise", "display_version": "22H2", "sp_version": "Service Pack 1", "sp_build": "1130", "version": "6.1", "version_pretty": "Windows 7 Ultimate Build 7601.21214 Service Pack 1", "version_full": "Windows 7 Ultimate 7601.24214.amd64fre.win7sp1_Idr_escrow.180801-1700 Build 7601.24214" } For Linux OS we can collect following information:
{ "os_type": "linux", "product_name": "AlmaLinux release 8.6 (Sky Tiger)", "architecture": "x86_64", "kernel_major": "4", "kernel_minor": "18", "kernel_patch": "0", "kernel": "4.18.0-372.26.1.el8_6.x86_64", "version_pretty": "AlmaLinux release 8.6 (Sky Tiger) x86_64 4.18.0-372.26.1.el8_6.x86_64", "version_full": "Linux version 4.18.0-372.26.1.el8_6.x86_64 (mockbuild@c96addf3b7c745e3b437a36677d48bfa) (gcc version 8.5.0 20210514 (Red Hat 8.5.0-10) (GCC)) #1 SMP Tue Sep 13 06:07:14 EDT 2022" } Notes:
AgentLibrary zbxsysinfo gets expanded:
Agent 2
FrontendAdd new item key of system.sw.os.get to list of possible keys for item types:
Documentation
Templates
Sign off:
Change logv1.1. :
v1.2. :
| ||||||||
Comment by Alex Kalimulin [ 2022 Nov 24 ] | ||||||||
Here you go: ZBXNEXT-6848-mini-spec.pdf | ||||||||
Comment by Marco Hofmann [ 2022 Nov 24 ] | ||||||||
Thanks a lot! Do I see that correctly, that in the proposed specs won't be an item that contains the complete build number, like in my and your first example? | ||||||||
Comment by Alex Kalimulin [ 2022 Dec 01 ] | ||||||||
We made some minor changes in field names and also addressed your question: ZBXNEXT-6848-mini-spec_1_2.pdf
| ||||||||
Comment by Konstantins Prutkovs (Inactive) [ 2022 Dec 14 ] | ||||||||
Fixed in development branch feature/ZBXNEXT-6848-6.3 | ||||||||
Comment by Konstantins Prutkovs (Inactive) [ 2022 Dec 17 ] | ||||||||
Available in versions:
| ||||||||
Comment by Marina Generalova [ 2022 Dec 23 ] | ||||||||
Documentation updated: |