[ZBXNEXT-1287] Multi-language Performance Counters Created: 2012 Jun 22  Updated: 2024 Apr 10  Resolved: 2019 Oct 03

Status: Closed
Project: ZABBIX FEATURE REQUESTS
Component/s: Agent (G), Templates (T)
Affects Version/s: 1.8.13, 2.0.0
Fix Version/s: 4.0.13rc1, 4.2.7rc1, 4.4.0beta1, 4.4 (plan)

Type: New Feature Request Priority: Minor
Reporter: Andreas Jud Assignee: Alex Kalimulin
Resolution: Fixed Votes: 8
Labels: patch, perf_counter, trivial, windows
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows OS (Vista/7/2008/2008R2)


Issue Links:
Duplicate
is duplicated by ZBXNEXT-4799 Translate perflib-names from English ... Closed
Sub-task
part of ZBXNEXT-5326 Windows monitoring template Closed
Team: Team A
Sprint: Sprint 56 (Sep 2019), Sprint 57 (Oct 2019)
Story Points: 2

 Description   

See also: http://www.zabbix.com/forum/showthread.php?p=103169#post103169

The PdhAddCounter function, witch is used in the Agent to query PerformanceCounters will expect on a german OS a german Index.
Since 2008/Vista there is also a Function "PdhAddEnglishCounter", which will work also with english-Indexes.
So there sould be a check, if OS newer than xp/2003 there should be a fallback to PdhAddEnglishCounter.

The "PdhValidatePath" makes no sense and can be removed, in my view.

Affected file: perfmon.c

With this Feature, there is no need, to create windows-templates for each language.



 Comments   
Comment by Andreas Jud [ 2012 Aug 22 ]

Did a small patch of perfmon.c:

wcounterPath = zbx_utf8_to_unicode(counterpath);

if (NULL == *handle)

{ pdh_status = PdhAddCounter(query, wcounterPath, 0, handle); if (pdh_status != ERROR_SUCCESS) pdh_status = PdhAddEnglishCounter(query, wcounterPath, 0, handle); }

if (ERROR_SUCCESS != pdh_status && NULL != *handle)
{
if (ERROR_SUCCESS == PdhRemoveCounter(*handle))

.. the problem with this patch is.. it's not compatible with old OS-Versions (< 2008/Vista)

Comment by Vitaly Zhuravlev [ 2019 Sep 02 ]

This task is required before we can make truly universal template for Windows. 

It is suggested to add new windows item perf_counter_en[counter,<interval>] on Windows Zabbix agent that will use PdhAddEnglishCounterA function, which is locale neutral.

Comment by Vitaly Zhuravlev [ 2019 Sep 02 ]

Just FYI, PdhAddEnglishCounter seems to be supported only on Windows 2008/Vista or higher

https://docs.microsoft.com/en-us/windows/win32/api/pdh/nf-pdh-pdhaddenglishcountera#requirements

Comment by Alex Kalimulin [ 2019 Sep 20 ]

Available in versions:

Comment by Alexander Vladishev [ 2019 Oct 02 ]

Updated documentation:

Generated at Sat Apr 27 06:00:28 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.