[ZBX-22593] Agent2 wmi.get does not respect case of returned data, if answer is True/False Created: 2023 Mar 27  Updated: 2024 Apr 10  Resolved: 2023 May 31

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Agent (G)
Affects Version/s: 6.0.13
Fix Version/s: 7.0.0alpha2, 7.0 (plan)

Type: Problem report Priority: Critical
Reporter: Lauri Rood Assignee: Mihails Prihodko
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

agent2 on windows. Mixed versions of windows, 2016, 2019


Attachments: File ZBX-22593-release-6.0.patch     File wmi.getall_agent2_current_behavior.json     File wmi.getall_agent2_proposed_behavior.json     File wmi.getall_agentd_current_behavior.json    
Issue Links:
Causes
Team: Team B
Sprint: Sprint 99 (Apr 2023), Sprint 100 (May 2023)
Story Points: 1

 Description   

Steps to reproduce:

  1. Run query, for example "wmi.get["root\microsoft\windows\defender","select RealTimeProtectionEnabled from MSFT_MpComputerStatus"]" towards classic agent (in my case it was 4.4.10) No matter if you use zabbix_get or create an item. 
  2. Run same query towards agent2 on same host (in my case it was version 6.0.13)
  3. I guess you can use any other wmi query where answer is either True or False

Result:

from classic agent you will get "True", from agent2, you will get "true". Note the case...

Running query in host in powershell, gives you "True".

Running any other query, which returns for example "Disabled" or "N/A" or "Unknown" works without any issues, no modifications to returned value.

Expected:

I would expect query to return values with same case. This has no connection to windows version. In my case both 2016 and 2019 behaved same way. 

We discovered this during upgrading our environment from classic to agent2, when after agent change several triggers, which used "find(/host/item/.."like", "True")<>1", suddenly fired. Workaround was implemented, "like" replaced with "iregexp". But still, it would be nice to get answers from agent without any case changes. 



 Comments   
Comment by Mihails Prihodko [ 2023 Apr 20 ]

Mini-specification v1.0

What's affected:

  • Zabbix agent2

Zabbix agentd
No changes are required in the classic C Zabbix agent. It should be used as a reference.

Zabbix agent 2
Replies to wmi.get and wmi.getall should be adjusted to the format existing in classic C Zabbix agent.

Templates

No changes in templates are required.

 

  Zabbix agentd Zabbix agent 2
current behavior
Zabbix agent 2
proposed fix
wmi.get text: "True", "False" (capital letter) text: "true", "false" (lower case letter) text: "True", "False" (capital letter)
wmi.getall text: JSON containing boolean values represented as stings:
 
"RealTimeProtectionEnabled": "True",
"RealTimeProtectionEnabled": "False",
wmi.getall_agentd_current_behavior.json
text: JSON containing boolean values represented as real JSON boolean
 
"RealTimeProtectionEnabled": true,
"RealTimeProtectionEnabled": false,
wmi.getall_agent2_current_behavior.json
text: JSON containing boolean values represented as stings:
 
"RealTimeProtectionEnabled": "True",
"RealTimeProtectionEnabled": "False",
wmi.getall_agent2_proposed_behavior.json

Signoff:

sasha  - 1.0
Kalimulin - 1.0

Patches for clients
As agreed with Alexey Pustovalov, patch for clients is needed for release/6.0 and more patches might be requested later if needed.

Comment by Mihails Prihodko [ 2023 May 25 ]

Available in versions:

Comment by Marina Generalova [ 2023 May 30 ]

Documentation updated:

Generated at Sun Jun 01 11:41:22 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.