[ZBX-9877] system.uname reports Windows 8.1 on system upgraded to Windows 10 Created: 2015 Sep 15 Updated: 2017 May 30 Resolved: 2016 Mar 15 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Agent (G) |
Affects Version/s: | 2.4.6 |
Fix Version/s: | 3.0.0beta2 |
Type: | Incident report | Priority: | Trivial |
Reporter: | Frank | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 0 |
Labels: | items, uname, windows | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified | ||
Environment: |
Windows 10 Pro x64 |
Attachments: | wmi_product_name_english_or_russian.png |
Description |
We have upgraded a machine from Windows 8.1 Pro to Windows 10 Pro, yet the Zabbix agent claims it is Windows 8.1 still in the system.uname parameter. When running zabbix_agent with the -p flag it shows that the WMI does properly show Windows 10. |
Comments |
Comment by richlv [ 2015 Sep 15 ] |
we seem to have this problem every now and then : |
Comment by Oleksii Zagorskyi [ 2015 Sep 16 ] |
Strange ... |
Comment by Sandis Neilands (Inactive) [ 2015 Dec 15 ] |
Indeed, this is true. Verified while working on |
Comment by Sandis Neilands (Inactive) [ 2015 Dec 16 ] |
zalex_ua, quoting comment from
Well, they did. Starting from Windows 10 the items under SOFTWARE\\Microsoft\Windows NT\CurrentVersion are different than before. In particular CurrentVersion still contains value 6.3 while the new keys CurrentMajorVersionNumber and CurrentMinorVersionNumber contain the values 10 and 0. The reason why we continue using registry instead of documented APIs for version checking is backwards compatibility. We target our agent to Windows XP and we build it using Windows 7 SDK. Some of the API functions are sensitive to build target. Others are not available in older releases of Windows. |
Comment by Sandis Neilands (Inactive) [ 2015 Dec 29 ] |
Conclusions after long and painful investigation of Windows 2000 - Windows Server 2016 Technical Preview 4. There is no Windows API for retrieving Windows version and product name (including OS edition) that is:
WMI (see Win32_OperatingSystem class) came closest to meeting all of these requirements. The only thing where it trips up is localization, translation. For some reason when querying for the Windows product name WMI provides the name translated to the current users display language regardless of the locale specified. Another issue - U.S. English is not guaranteed to be present on all Windows installations. # Try this in PowerShell after installing Russian or French as display language. (Get-WmiObject -class Win32_OperatingSystem -locale MS_409).Caption # Note that at least on Windows 8 the first ten minutes or so after boot the command still returns the English name (see the attached screenshot). # Alternatively: the same with Zabbix... zabbix_get -s 127.0.0.1 -k wmi.get[root\cimv2,"select Caption from Win32_OperatingSystem"] For completeness I must mention that when running agentd as a service I get the English OS name however this might be due to me starting off with an English version of Windows. Whether this remains true with a single language (say - French) edition of Windows remains to be seen. UPDATE: running agentd as service on French Windows 7 Home Premium didn't help - the OS name is translated to French. So currently the plan is as follows.
|
Comment by Sandis Neilands (Inactive) [ 2016 Jan 04 ] |
Unfortunately we cannot use NtOpenKey() etc. in Zabbix as this would require us to add Windows driver development toolkit as a build dependency. |
Comment by Sandis Neilands (Inactive) [ 2016 Jan 20 ] |
Some issues with the current implementation of system.uname on Windows.
Issues with current implementation of wmi.get.
|
Comment by Sandis Neilands (Inactive) [ 2016 Jan 21 ] |
Tested the WMI based implementation on:
Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-9877 . |
Comment by Sandis Neilands (Inactive) [ 2016 Jan 21 ] |
(1) wmi.get didn't return UTF-8 encoded strings. sandis.neilands RESOLVED in r57889. wiper fixed memory leak in r57939, still RESOLVED sandis.neilands CLOSED. |
Comment by Sandis Neilands (Inactive) [ 2016 Jan 21 ] |
(2) Documentation updates are needed.
sandis.neilands RESOLVED. wiper, please review the content and then pass this ZBX to martins-v for language and typography review. martins-v Reviewed, CLOSED. |
Comment by Andris Zeila [ 2016 Jan 22 ] |
(3) After discussion was decided to print OS architecture rather than CPU architecture. Printing CPU architecture would match *nix uname, but for Windows systems the OS architecture is more important. sandis.neilands RESOLVED in r57956. wiper CLOSED |
Comment by Sandis Neilands (Inactive) [ 2016 Jan 25 ] |
(4) In r57939 we made com_initialized a thread local variable meaning that COM will be initialized for each listener thread. This is how it should be according to the documentation (it somehow worked before). However CoInitializeSecurity() must be called only once per process. If it has been already called it returns RPC_E_TOO_LATE causing per-thread COM initialization to fail. RESOLVED in 57955. wiper CLOSED |
Comment by Andris Zeila [ 2016 Jan 26 ] |
Successfully tested |
Comment by Sandis Neilands (Inactive) [ 2016 Jan 26 ] |
Released in:
|