[ZBX-10313] wmi.get doesn't process queries with utf8 correctly Created: 2016 Jan 27  Updated: 2017 May 30  Resolved: 2016 Feb 09

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Agent (G)
Affects Version/s: 2.2.11, 2.4.7, 3.0.0beta2
Fix Version/s: 2.2.12rc1, 2.4.8rc1, 3.0.0rc1

Type: Incident report Priority: Critical
Reporter: Oleksii Zagorskyi Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: utf8, windows, wmi
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate

 Description   

Recently there was in ZBX-9877 for returned value, I can confirm it on win xp and win 8.1.

But if for example I need to test a query with not-ascii characters included - it doesn't work.
Confirmed for any Cyrillic and some Spanish specific characters like á, ó, é etc.

The easiest way to test it is rename a network interface to a "Ethernet ?????????" or so and use queries like these:

$ zabbix_get -s 192.168.3.225 -k "wmi.get[root\cimv2,select NetConnectionID from Win32_NetworkAdapter where NetConnectionID like '%Ethernet %']"
Ethernet ?????????
$ zabbix_get -s 192.168.3.225 -k "wmi.get[root\cimv2,select NetConnectionID from Win32_NetworkAdapter where NetConnectionID like '%Ethernet ?%']"
ZBX_NOTSUPPORTED: Cannot obtain WMI information.


$ zabbix_get -s 192.168.3.225 -k "wmi.get[root\cimv2,select NetConnectionID from Win32_NetworkAdapter where NetConnectionID like '%Ethernet %']"
Ethernet á
$ zabbix_get -s 192.168.3.225 -k "wmi.get[root\cimv2,select NetConnectionID from Win32_NetworkAdapter where NetConnectionID like '%Ethernet á%']"
ZBX_NOTSUPPORTED: Cannot obtain WMI information.

agent in this example includes the ZBX-9877 fix.



 Comments   
Comment by Oleksii Zagorskyi [ 2016 Jan 27 ]

Taking into account that the very related issue ZBX-9877 is fixed for 3.0 only, I'd agree to fix current issue for 3.0 only too.
This way it will be consistent etc.

Comment by Oleksii Zagorskyi [ 2016 Jan 27 ]

(1) UFT-8 support for wmi.get[] query and response probably worth to be mentioned at https://www.zabbix.com/documentation/3.0/manual/introduction/whatsnew300#item_changesimprovements

zalex_ua Taking into account back porting the changes to 2.2, need to reconsider targeted documentation version. Not sure how to resolve that, maybe even ignore my suggestion to mention on whatsnew page. It will be just a bug fix listed in ChangeLog.

sandis.neilands Documented this change in 2.2.12 and 2.4.8 "What's new" pages. martins-v, please review!

martins-v Reviewed, only one small change in word order (adjective-noun). CLOSED.

Comment by Sandis Neilands (Inactive) [ 2016 Feb 02 ]

Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-10313 .

Comment by Sandis Neilands (Inactive) [ 2016 Feb 02 ]

Tested by running agent in Windows 7 Home Premium (French) and querying it from Linux development machine.

$ ./zabbix_get -s 192.168.3.227 -k "wmi.get[root\cimv2,select Caption from Win32_OperatingSystem where Caption like '%Édition%']"
Microsoft Windows 7 Édition Familiale Premium 

zalex_ua Tested both my initial cases by exe file provided by Sandis. Both are success now, thanks.

Comment by Sandis Neilands (Inactive) [ 2016 Feb 02 ]

An issue related to this one: ZBXNEXT-3128.

Comment by Andris Zeila [ 2016 Feb 03 ]

Successfully tested

Comment by Sandis Neilands (Inactive) [ 2016 Feb 03 ]

(2) Backported the changes to 2.2 (where ZBX-9877 is not implemented) in development branch svn://svn.zabbix.com/branches/dev/ZBX-10313 r58251 (do a fresh checkout as I have removed the original development branch).

Note that answer encoding in UTF-8 is backported from ZBX-9877 as well.

wiper Looks good, CLOSED

Comment by Sandis Neilands (Inactive) [ 2016 Feb 04 ]

Released in:

  • 2.2.12rc1 r58265;
  • 2.4.8rc1 r58266;
  • 3.0.0rc1 r58245.
Generated at Fri Apr 19 06:14:37 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.