[ZBX-21549] Windows agent template not compatible with windows XP and server 2003 Created: 2022 Aug 31  Updated: 2024 Apr 10  Resolved: 2023 Aug 14

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

Type: Documentation task Priority: Trivial
Reporter: Kirill Assignee: Andrejs Kozlovs
Resolution: Fixed Votes: 0
Labels: templates
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows server 2003 r2 x86


Attachments: PNG File Screenshot 2023-06-20 at 12.44.01.png     PNG File image-2023-06-28-11-02-25-864.png     Text File log.txt    
Issue Links:
Sub-task
part of ZBX-23110 zabbix agent 6.4.3 crashes regularly ... Closed
Team: Team C
Sprint: Support backlog
Story Points: 0.5

 Description   

Steps to reproduce:

  1. Install any version of zabbix agent on machine running Windows XP / Server 2003 r2 (6.2, lts 6.0 or 5.0)
  2. Assign to that machine Windows agent template on zabbix server running version 6.2+

Result:

Zabbix service crashes, no techincal data is being sent to server. See log file after clean reinstall: 

   3736:20220831:125652.131 Starting Zabbix Agent [c02]. Zabbix 6.2.1 (revision 2c382976146).
  3736:20220831:125652.131 **** Enabled features ****
  3736:20220831:125652.131 IPv6 support:          YES
  3736:20220831:125652.131 TLS support:           YES
  3736:20220831:125652.131 **************************
  3736:20220831:125652.131 using configuration file: C:\Program Files\Zabbix Agent\zabbix_agentd.conf
  3736:20220831:125653.037 agent #0 started [main process]
  4988:20220831:125653.037 agent #1 started [collector]
  4128:20220831:125653.037 agent #2 started[listener #1]
  5020:20220831:125653.037 agent #3 started[listener #2]
  5352:20220831:125653.037 agent #4 started[listener #3]
  3696:20220831:125653.084 agent #5 started [active checks #1]
  5352:20220831:125746.319 PdhAddEnglishCounter() is not available, perf_counter_en[] is not supported
  4128:20220831:125746.319 PdhAddEnglishCounter() is not available, perf_counter_en[] is not supported
  5020:20220831:125746.334 Unhandled exception c0000005 detected at 0x00020005. Crashing ...
  5020:20220831:125746.334 ====== Fatal information: ======
  5020:20220831:125746.334 Program counter: 0x20005
  5020:20220831:125746.334 === Registers: ===
  5020:20220831:125746.334 edi     =                1 =                    1 =                    1
  5020:20220831:125746.334 esi     =          2f7e86c =             49801324 =             49801324
  5020:20220831:125746.334 ebp     =          2f7e7fc =             49801212 =             49801212
  5020:20220831:125746.350 ebx     =                0 =                    0 =                    0
  5020:20220831:125746.350 edx     =          2a00001 =             44040193 =             44040193
  5020:20220831:125746.350 eax     =           1edf28 =              2023208 =              2023208
  5020:20220831:125746.350 ecx     =           1ea410 =              2008080 =              2008080
  5020:20220831:125746.350 esp     =          2f7e7bc =             49801148 =             49801148
  5020:20220831:125746.350 efl     =            10202 =                66050 =                66050
  5020:20220831:125746.350 csgsfs  =         1b003b00 =            452999936 =            452999936
  5020:20220831:125746.350 === Backtrace: ===
  5020:20220831:125746.584 3: C:\Program Files\Zabbix Agent\zabbix_agentd.exe() [0x20005]
  5020:20220831:125746.584 2: C:\Program Files\Zabbix Agent\zabbix_agentd.exe() [0x4676a5]
  5020:20220831:125746.584 1: C:\Program Files\Zabbix Agent\zabbix_agentd.exe() [0x46842d]
  5020:20220831:125746.584 0: C:\Program Files\Zabbix Agent\zabbix_agentd.exe() [0x4e207463]
  5020:20220831:125746.584 ================================
  4988:20220831:125747.178 PdhAddEnglishCounter() is not available, perf_counter_en[] is not supported​ 

As stated by microsoft, PdhAddEnglishCounter() is available only starting from Windows Vista https://docs.microsoft.com/en-us/windows/win32/api/pdh/nf-pdh-pdhaddenglishcountera

Expected:

Properly functioning monitoring, zabbix manual states that Windows server 2003 and XP is still supported for monitoring.



 Comments   
Comment by Kirill [ 2022 Aug 31 ]

It runs ancient software that cant be used on modern OS, and company doesnt want to invest in any alternatives...

Comment by dimir [ 2023 Jun 19 ]

On the agent side we could check Windows version before processing these perfcounters. For example add this check to function user_perf_counter():

--- a/src/libs/zbxsysinfo/win32/pdhmon.c
+++ b/src/libs/zbxsysinfo/win32/pdhmon.c
@@ -48,6 +48,9 @@ int   user_perf_counter(AGENT_REQUEST *request, AGENT_RESULT *result)
                goto out;
        }
 
+       /* check windows version here and return unsupported if it's too old */
+       /* you can use GetVersionEx() for that as it is done in src/zabbix_agent/eventlog.c */
+
        if (SUCCEED != get_perf_counter_value_by_name(counter, &value, &error))
        {
                SET_MSG_RESULT(result, error != NULL ? error : 

 

Comment by Andrejs Kozlovs [ 2023 Jun 20 ]

Hello, cyrus96,

1. Can you repeat this issue reliable (crash i mean), or it is different to reproduce?

2. Can you repeat issue with DebugLevel=5 in your config file C:\Program Files\Zabbix Agent\zabbix_agentd.conf?

3. Can you build Zabbix agent from sources?

Comment by Kirill [ 2023 Jun 20 ]

Hi there!
It is working now by building agent from source (32 bit, not agent2, without encryption), but zabbix server doesnt recieve half of metrics (see attached screenshot)

Additionaly here is log file with debug level 5:

log.txt

 

 

 

Comment by Andrejs Kozlovs [ 2023 Aug 04 ]

Updated documentation:

Comment by Kirill [ 2023 Aug 11 ]

I looked up updated documentation, and I couldn't understand where can we get an agent template from version 4.x? Do I have to install 4.x server or is it published somewhere?

Comment by Michael Veksler [ 2023 Aug 14 ]

Hi cyrus96,

You can take any templates from our public git repository

Generated at Sat Apr 19 13:15:47 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.