The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 4,261 other subscribers

zabbix on Windows: check the configuration before restarting the Zabbix Agent service

Posted by jpluimers on 2019/09/27

If the Zabbix configuration on Windows (especially mismatches in C:\zabbix\zabbix.agentd.conf.d), then the Zabbix Agent will not start at all:

C:\zabbix\bin\win64>zabbix_agentd.exe --start
zabbix_agentd.exe [4711]: ERROR: cannot start service [Zabbix Agent]: [0x0000041D] The service did not respond to the start or control request in a timely fashion.

This is how to check it before starting the service:

C:\zabbix\bin\win64\zabbix_agentd.exe --config C:\zabbix_agentd.conf
zabbix_agentd.exe [43]: ERROR: cannot add user parameter "MyDuplicate[*],PowerShell.exe -File C:\zabbix\UniquePowerShellScript.ps1 "$1"": key "MyDuplicate" already exists

The problem is that in the C:\zabbix\zabbix.agent.conf.d directory, two files had a similar config:

UserParameter=MyDuplicate[*],PowerShell.exe -File C:\zabbix\FirstPowerShellScript.ps1 "$1"
UserParameter=MyDuplicate[*],PowerShell.exe -File C:\zabbix\SecondPowerShellScript.ps1 "$1"

The problem is that the first part of UserParameter (before the [*])  is a key which needs to be unique over all configuration files.

If everything is fine, you will see this:

C:\zabbix\bin\win64\zabbix_agentd.exe --config C:\zabbix_agentd.conf
zabbix_agentd.exe [1581]: use foreground option to run Zabbix agent as console application

If you need to manually start Zabbix as a service, then perform this (the first step is not needed if the service has already been stopped):

C:\zabbix\bin\win64>zabbix_agentd.exe --stop
zabbix_agentd.exe [1642]: service [Zabbix Agent] stopped successfully

C:\zabbix\bin\win64>zabbix_agentd.exe --start
zabbix_agentd.exe [1642]: service [Zabbix Agent] started successfully

–jeroen

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.