You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[8.19](backport #45068) Wmi fix doc based on feedback (#47155)
* Wmi fix doc based on feedback (#45068)
* Add windows 11 to compatibility section
* WIP: Improve documentation after support feedback + Improve cache explanation
* Use tag note instead of info
* Improve wording
* Make sure the warning is marked as such, use a more precise link
* Fix comma
* Fix some wording
* Update docs/reference/metricbeat/metricbeat-metricset-windows-wmi.md
Co-authored-by: Visha Angelova <[email protected]>
* Update docs/reference/metricbeat/metricbeat-metricset-windows-wmi.md
Co-authored-by: Visha Angelova <[email protected]>
* Update docs/reference/metricbeat/metricbeat-metricset-windows-wmi.md
Co-authored-by: Visha Angelova <[email protected]>
* Update docs/reference/metricbeat/metricbeat-metricset-windows-wmi.md
Co-authored-by: Visha Angelova <[email protected]>
* Update docs/reference/metricbeat/metricbeat-metricset-windows-wmi.md
Co-authored-by: Visha Angelova <[email protected]>
* Update docs/reference/metricbeat/metricbeat-metricset-windows-wmi.md
Co-authored-by: Visha Angelova <[email protected]>
* Clarify the wmi.schema_cache_size based on the comments
* Make sure to update docs.md as well
* Remove erronously added line
---------
Co-authored-by: Visha Angelova <[email protected]>
(cherry picked from commit f23a53a)
# Conflicts:
# docs/reference/metricbeat/metricbeat-metricset-windows-wmi.md
# metricbeat/module/windows/wmi/_meta/docs.md
* Remove conflict
* Update WMI asciidoc according to original PR
* Remove markdown files that belong to version 9.x
---------
Co-authored-by: Mirko Bez <[email protected]>
Co-authored-by: Mirko Bez <[email protected]>
Co-authored-by: Visha Angelova <[email protected]>
Copy file name to clipboardExpand all lines: metricbeat/module/windows/wmi/_meta/docs.asciidoc
+51-10Lines changed: 51 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,11 @@
1
-
The `wmi` metricset of the Windows module collects metrics via link:https://learn.microsoft.com/en-us/windows/win32/wmisdk/about-wmi[Windows Management Instrumentation (WMI)], a core management technology in the Windows Operating system.
1
+
The `wmi` metricset of the Windows module collects metrics via link:https://learn.microsoft.com/en-us/windows/win32/wmisdk/about-wmi[Windows Management Instrumentation] (WMI), a core management technology in the Windows Operating system.
2
2
3
3
By leveraging WMI Query Language (WQL), this metricset allows you to extract detailed
4
4
system information and metrics to monitor the health and performance of Windows
5
5
Systems.
6
6
7
7
This metricset leverages the link:https://github.com/microsoft/wmi[Microsoft WMI] library, a
8
-
convenient wrapper around the link:https://github.com/go-ole[Go-OLE] library. This allows invoking the
8
+
convenient wrapper around the link:https://github.com/go-ole[Go-OLE] library, which allows to invoke the
9
9
link:https://learn.microsoft.com/en-us/windows/win32/wmisdk/scripting-api-for-wmi[Scripting API for WMI].
10
10
11
11
[float]
@@ -15,7 +15,7 @@ This metricset supports the execution of link:https://learn.microsoft.com/en-us/
15
15
16
16
Currently, the metricset supports queries with `SELECT`, `FROM` and `WHERE` clauses.
17
17
18
-
NOTE: When working with WMI queries, it is the user's responsibility to ensure that queries are safe, efficient, and do not cause unintended side effects. A notorious example of a problematic WMI class is Win32_Product. Read more in link:https://support.microsoft.com/kb/974524[Windows Documentation].
18
+
NOTE: When working with WMI queries, it is the user's responsibility to ensure that queries are safe, efficient, and do not cause unintended side effects. A notorious example of a problematic WMI class is Win32_Product. Read more in link:https://learn.microsoft.com/en-us/troubleshoot/windows-server/admin-development/windows-installer-reconfigured-all-applications#more-information[Windows Documentation].
19
19
20
20
[float]
21
21
[[wmi-arbitrator-and-query-execution]]
@@ -31,6 +31,32 @@ There is no way to directly stop a query once it has started. To prevent Metricb
31
31
32
32
NOTE: While Metricbeat stops waiting for the result, the underlying WMI query may continue running until the WMI Arbitrator decides to stop execution.
33
33
34
+
[float]
35
+
[[wmi-type-support]]
36
+
==== WMI type support
37
+
38
+
The `microsoft/wmi` library internally uses the WMI Scripting API. This API, as per the
does not provide direct type conversion for `uint64`, `sint64`, and `datetime`
41
+
link:https://learn.microsoft.com/en-us/windows/win32/wmisdk/common-information-model[Common Information Model] (CIM) types;
42
+
instead, these values are returned as strings.
43
+
44
+
To ensure the correct data type is reported, Metricbeat dynamically fetches the
45
+
CIM type definitions for the properties of the WMI instance classes returned by the query,
46
+
and then performs the necessary data type conversions.
47
+
48
+
To optimize performance and avoid repeatedly fetching these schema definitions
49
+
for every row and every request, an LRU cache is utilized. This cache stores
50
+
the schema definition for each WMI class-property pair encountered. For queries involving
51
+
superclasses, such as `CIM_LogicalDevice`, the cache will populate with individual entries
52
+
for each specific derived class (leaf of the class hierarchy) whose instances are returned by the query (for example, `Win32_DiskDrive` or `Win32_NetworkAdapter`).
53
+
54
+
NOTE: The properties of type `CIM_Object` (embedded objects) are not yet supported and are ignored.
55
+
56
+
57
+
NOTE: Properties of type `CIM_Reference` (references), which are used in link:https://learn.microsoft.com/en-us/windows/win32/wmisdk/declaring-an-association-class[WMI Association Classes], are currently returned as string values exactly as reported by the
@@ -79,6 +105,14 @@ properties that have a `null` value in the output document. The default value is
79
105
*`wmi.include_empty_string_properties`*:: A boolean option that causes the metricset to include
80
106
the properties that are empty string. The default value is `false`.
81
107
108
+
*`wmi.max_rows_per_query`*:: Limits the number of rows returned by a single WMI query.
109
+
The default value is `0`, which is a special value indicating that all fetched
110
+
results should be returned without a row limit.
111
+
112
+
*`wmi.schema_cache_size`*:: The maximum number of WMI class-property pairs that can be cached per single query. Every query keeps its own separate cache.
113
+
This cache helps improve performance when dealing with queries that involve inheritance hierarchies. Read more in <<wmi-type-support, WMI Type Support>>. For example, if a superclass is queried, the cache stores entries for each WMI concrete instance class (the leaves of the class hierarchy) and their associated properties. Therefore, querying a superclass that returns a result set containing instances of `10` different classes, each with `50` properties, will result in a cache size of `500` entries (`10×50`).
114
+
The default value is `1000`.
115
+
82
116
*`wmi.queries`*:: The list of queries to execute. The list cannot be empty. See <<query-configuration, Query Configuration>> for the format of the queries.
- Test your queries in isolation using the `Get-CimInstance` PowerShell cmdlet or the WMI Explorer.
160
+
- Test your queries in isolation using the link:https://learn.microsoft.com/en-us/powershell/module/cimcmdlets/get-ciminstance[`Get-CimInstance`] PowerShell cmdlet or link:https://github.com/vinaypamnani/wmie2[the WMI Explorer tool].
161
+
162
+
- Ensure that `wmi.warning_threshold` is less than or equal to the module's `period`.
163
+
This configuration prevents Metricbeat from starting multiple concurrent executions of the same query.
127
164
128
-
- Ensure that `wmi.warning_threshold` is **less than or equal to** the module's `period`.
129
-
This prevents starting intentionally multiple executions of the same query.
165
+
- When possible, try querying concrete (leaf) classes or classes closer to the leaves of the WMI inheritance hierarchy. Querying abstract superclasses may require fetching and caching the schema definitions for numerous derived classes, which can lead to increased memory usage and potential performance penalties due to cache misses.
130
166
131
-
- Set up alerts in Metricbeat logs for timeouts and empty query results. If a query frequently times out or returns no data, investigate the cause to prevent missing critical information.
167
+
- Set up Kibana Alerts for documents generated by this metricset with the `error.message` field.
132
168
133
-
- [Advanced] Collect WMI-Activity Operational Logs to correlate with Metricbeat WMI warnings.
169
+
- Configure collection of WMI-Activity Operational Logs (found in Event Viewer under `Applications and Services Logs/Microsoft/Windows/WMI-Activity/Operational`). These logs can be invaluable for correlating issues with Metricbeat WMI warnings or documents containing `error.message`.
134
170
135
171
136
172
[float]
137
173
=== Compatibility
138
174
139
175
This module has been tested on the following platform:
140
176
141
-
- Operating System: Microsoft Windows Server 2019 Datacenter
142
-
- Architecture: x64
177
+
[options="header"]
178
+
|===
179
+
| Operating System | Architecture
180
+
181
+
| Microsoft Windows Server 2019 Datacenter | x64
182
+
| Microsoft Windows 11 Pro | x64
183
+
|===
143
184
144
185
Other Windows versions and architectures may also work but have not been explicitly tested.
0 commit comments