[ZBX-18856] please don't override the reasonable defaults in the default config files Created: 2021 Jan 08  Updated: 2025 Aug 27  Resolved: 2021 Feb 26

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Problem report Priority: Trivial
Reporter: Harri Assignee: Zabbix Support Team
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Team: Team I

 Description   

I can speak just for the Unix platforms, but I wonder if it would be possible to provide reasonable defaults in the default zabbix-agentd.conf included in the binary packages?

Just for example, what good is the default HostnameItem, if the default config file included in the binary package sets HostName to "Zabbix Server", overriding the wanted default by its own? "Zabbix Server" is wrong in 99.9% of all cases.

For setting up Zabbix on a new host the first thing I have to do is to comment out all the unwanted "non-default" config parameters and to fix the Include lines. And on the next Zabbix upgrade apt-get complains about a conflict, because the new package provides the same unwanted parameters again, even though I would be fine with the "real" defaults.

Same for proxy and server, please.



 Comments   
Comment by Jurijs Klopovskis [ 2021 Jan 11 ]

Hi, harri

What distribution are you running?

HostName to "Zabbix Server", overriding the wanted default by its own? "Zabbix Server" is wrong in 99.9% of all cases.

It is not supposed to do that. How many times have this happened to you?

This should only happen when the config file in the package changes, which is a very rare occasion.

Comment by Harri [ 2021 Jan 21 ]

I am using Zabbix on Debian 6 to 10, Testing and Unstable, RHEL 6 and 7, Centos, Oracle Linux, AIX 6.1 and 7.1, Solaris 10 and 11, and OpenBSD 6.8.

Lets focus on Debian 10. Using the agent package from your repository (http://repo.zabbix.com/zabbix/5.0/debian) I see

% dpkg --contents zabbix-agent_5.0.7-1+buster_amd64.deb
drwxr-xr-x root/root         0 2020-12-21 08:23 ./
drwxr-xr-x root/root         0 2020-12-21 08:23 ./etc/
drwxr-xr-x root/root         0 2020-12-21 08:23 ./etc/init.d/
-rwxr-xr-x root/root      1484 2020-11-23 16:12 ./etc/init.d/zabbix-agent
drwxr-xr-x root/root         0 2020-12-21 08:23 ./etc/logrotate.d/
-rw-r--r-- root/root       153 2020-11-23 16:12 ./etc/logrotate.d/zabbix-agent
drwxr-xr-x root/root         0 2020-12-21 08:23 ./etc/zabbix/
-rw-r--r-- root/root     15101 2020-12-21 08:23 ./etc/zabbix/zabbix_agentd.conf
drwxr-xr-x root/root         0 2020-12-21 08:23 ./etc/zabbix/zabbix_agentd.d/
drwxr-xr-x root/root         0 2020-12-21 08:23 ./lib/
drwxr-xr-x root/root         0 2020-12-21 08:23 ./lib/systemd/
drwxr-xr-x root/root         0 2020-12-21 08:23 ./lib/systemd/system/
-rw-r--r-- root/root       436 2020-11-23 16:12 ./lib/systemd/system/zabbix-agent.service
drwxr-xr-x root/root         0 2020-12-21 08:23 ./usr/
drwxr-xr-x root/root         0 2020-12-21 08:23 ./usr/bin/
drwxr-xr-x root/root         0 2020-12-21 08:23 ./usr/lib/
drwxr-xr-x root/root         0 2020-12-21 08:23 ./usr/lib/tmpfiles.d/
-rw-r--r-- root/root        41 2020-12-21 08:23 ./usr/lib/tmpfiles.d/zabbix-agent.conf
drwxr-xr-x root/root         0 2020-12-21 08:23 ./usr/sbin/
-rwxr-xr-x root/root    696616 2020-12-21 08:23 ./usr/sbin/zabbix_agentd
drwxr-xr-x root/root         0 2020-12-21 08:23 ./usr/share/
drwxr-xr-x root/root         0 2020-12-21 08:23 ./usr/share/doc/
drwxr-xr-x root/root         0 2020-12-21 08:23 ./usr/share/doc/zabbix-agent/
-rw-r--r-- root/root      2915 2020-12-21 08:23 ./usr/share/doc/zabbix-agent/changelog.Debian.gz
-rw-r--r-- root/root    304850 2020-12-21 08:23 ./usr/share/doc/zabbix-agent/changelog.gz
-rw-r--r-- root/root       980 2020-11-23 16:12 ./usr/share/doc/zabbix-agent/copyright
-rw-r--r-- root/root      1081 2020-12-14 11:27 ./usr/share/doc/zabbix-agent/userparameter_mysql.conf
drwxr-xr-x root/root         0 2020-12-21 08:23 ./usr/share/man/
drwxr-xr-x root/root         0 2020-12-21 08:23 ./usr/share/man/man8/
-rw-r--r-- root/root      1682 2020-12-21 08:23 ./usr/share/man/man8/zabbix_agentd.8.gz
drwxr-xr-x root/root         0 2020-12-21 08:23 ./var/
drwxr-xr-x root/root         0 2020-12-21 08:23 ./var/log/
drwxr-xr-x root/root         0 2020-12-21 08:23 ./var/log/zabbix/

/etc/zabbix/zabbix_agentd.conf in this package provides

% egrep -v ^\#\|^\$ etc/zabbix/zabbix_agentd.conf 
PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=0
Server=127.0.0.1
ServerActive=127.0.0.1
Hostname=Zabbix server
Include=/etc/zabbix/zabbix_agentd.d/*.conf

Except for the Include line these predefined values (overriding the expected defaults) are highly painful. Esp. I cannot "unset" Hostname in another config file, i.e. I am forced to edit zabbix_agentd.conf, which leads to a conflict for the next zabbix-agent package upgrade.

I would highly appreciate if you could drop all these unwanted presets to make Zabbix' "real" config defaults available. Same for proxy and server.

Comment by Jurijs Klopovskis [ 2021 Jan 21 ]

Even in the stock agent config file found in the source tarball certain values are set explicitly.

~/repos/zabbix/master > egrep -v ^\#\|^\$ conf/zabbix_agentd.conf
LogFile=/tmp/zabbix_agentd.log
Server=127.0.0.1
ServerActive=127.0.0.1
Hostname=Zabbix server

This is to be expected.

...which leads to a conflict for the next zabbix-agent package upgrade.

Under normal circumstances you should not have any problems in modifying /etc/zabbix/zabbix_agentd.conf.
Any modifications should be kept intact during upgrade. A I've already mentioned, conflicts may occur only when the configuration file has changed in the package, which is rare. And even then one can use dpkg --force-confold to preserve the config file.

As to rpm, it will save config files as *.rpmnew in case of conflicts.

There must be something misconfigured on your systems if it apt and dpkg do not behave this way.

Comment by Harri [ 2021 Jan 21 ]

Sorry to say, but this is not expected. Its a bug to document certain defaults on https://www.zabbix.com/documentation/5.0/manual/appendix/config/zabbix_agentd and others, and then to provide other defaults in the source and binary packages. You can hardly call it a default, if I first have to edit zabbix_agentd.conf to get it.

I would like to make use of the defaults, as they are described in the documentation, without editing zabbix_agentd.conf first. I do not know if you have experience in running Zabbix in a large scale enterprise environment , but surely you can imagine that managing Zabbix on >400 hosts it is essential to avoid problems during package upgrades. If every upgrade fails due to a conflict between the new zabbix_agentd.conf and the previous config file I was forced to edit, then this is a problem.

Therefore configuration is supposed to be done in /etc/zabbix/zabbix_agentd.d/*.conf, using ansible, local packages providing the additional config files, or some other scheme. The zabbix_agentd.conf provided in the binary package must not be edited to avoid problems with future upgrades. The zabbix_agend.conf currently provided with the binary agent package for Debian and others make this approach impossible.

The problem is not related to Debian, but If you have your "debian" build directory in a public git repository, then I can send you a patch, just as an example. I checked the public git repository for 5.0 https://git.zabbix.com/scm/zbx/zabbix.git, but the debian build directory is not included.

Comment by Edgar Akhmetshin [ 2021 Jan 21 ]

Hello Harri,

Just for example, what good is the default HostnameItem, if the default config file included in the binary package sets HostName to "Zabbix Server", overriding the wanted default by its own? "Zabbix Server" is wrong in 99.9% of all cases.

Not everyone needs the default value passed from the system, especially when you have machine names using IDs, and the environment is managed as configuration as code.

The agent's parameters are stable over the years and all changes are additive.

Also Include file will take effect on all options, if you will override default values

When using the configuration-as-code approach, there must be a template that generates a configuration in accordance with the requirements of your particular environment. In the case when the configuration is based only on the default values - the result of the update is unpredictable - this is true for any software product.

So could you please summarise "defaults" required with official documents from operating system vendors where tmp files and settings handling requirements are broken by incorrect packages provided from Zabbix.

Regards,
Edgar

Comment by Harri [ 2021 Feb 26 ]

I am sick of this.

Comment by Richard Wonka [ 2023 Jun 19 ]

This is so obviously a bug, it couldn't be more obvious if it slapped all of us in the face. 

This is neither trivial, nor fixed and a "won't do" points at a petulant dev who either hasn't even understood the issue or who doesn't want to admit that there might be a bug.

From a user perspective, this behaviour is unacceptable.

Comment by dimir [ 2025 Aug 21 ]

[email protected], harri, guys do you mean that what you expect in configuration file provided with the package is:

  • Hostname parameter is not set
  • which leads to HostnameItem to be used
  • HostnameItem is not set
  • which leads to using system.hostname and setting Hostname to what "uname -n" returns

?

Generated at Thu Jun 11 05:53:22 EEST 2026 using Jira 10.3.18#10030018-sha1:5642e4ad348b6c2a83ebdba689d04763a2393cab.