[ZBX-20207] Auto changing interface from IP to DNS Created: 2021 Nov 11  Updated: 2024 Jul 16

Status: Need info
Project: ZABBIX BUGS AND ISSUES
Component/s: Agent (G), Proxy (P), Server (S)
Affects Version/s: 5.4.7, 6.0.0alpha6
Fix Version/s: None

Type: Problem report Priority: Trivial
Reporter: Артём Викториевич Антоненко Assignee: Aigars Kadikis
Resolution: Unresolved Votes: 7
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

windows agent, centos 8 proxy, centos 8 server


Attachments: PNG File 1.png     PNG File 11-1.png     PNG File 11.png     PNG File 1111.png     PNG File 2.png     PNG File 22.png     PNG File 3.png     PNG File image-2021-12-21-15-35-08-036.png     PNG File image-2022-01-03-10-23-31-439.png     File zabbix_agentd_without_hostinterface.rar     PNG File Скриншот 2021-12-21 15.30.27.png     PNG File Скриншот 2022-02-01 13.23.59.png    
Issue Links:
Duplicate

 Description   

Configured auto-registration action (pic attached)
using auto-registration the server is registered (pic attached)
If auto-registration is not turned off, then after a while another interface is added, "connect via" changes to DNS and becomes the default (pic attached)
and of course the server stops being monitored.
At the same time, if you disable auto-registration, then everything is ok, but in this case, new servers, respectively, will not be registered

 



 Comments   
Comment by Aigars Kadikis [ 2021 Nov 15 ]

Thank you for using latest version.
1) Confirm the IP 192.168.100.254 is not a part of any discovery rule under: "Configuration" => "Discoveries".
2) Zabbix proxy setup - is it a single component - no HA, no load balancing?

Comment by Артём Викториевич Антоненко [ 2021 Nov 15 ]
  1. I confirm that 192.168.100.254 is not a part of any discovery rule under: "Configuration" => "Discoveries". (pic added)
  2. Zabbix proxy is a single component for this network, also we have other networks with other proxies.
  3. There are 2 threads on zabbix forum, mb it will be usefull: https://www.zabbix.com/forum/zabbix-troubleshooting-and-problems/434409-auto-changing-interface-from-ip-to-dns-bug and https://www.zabbix.com/forum/in-russian/432806-%D1%81%D0%BC%D0%B5%D0%BD%D0%B0-%D0%BF%D0%BE%D0%B4%D0%BA%D0%BB%D1%8E%D1%87%D0%B5%D0%BD%D0%B8%D1%8F-%D0%B8%D0%BD%D1%82%D0%B5%D1%80%D1%84%D0%B5%D0%B9%D1%81%D0%B0-%D1%81-ip-%D0%BD%D0%B0-dns
Comment by Aigars Kadikis [ 2021 Nov 15 ]

I have created a Zabbix Server 5.4.7, Zabbix Proxy 5.4.7, configured an auto registration rule and linked one agent to proxy. Waiting for the problem to appear.

At zabbix_agentd.conf, do you have only one record configured for 'ServerActive='?

Proxy is active or passive?

Comment by Aigars Kadikis [ 2021 Nov 15 ]

To lower down components involved in issue, please disable exiting rule and create one auto registration rule with one condition:

  • If Host name matches "SRV-M 7A4A594A"

Let me know if issue repeats.

Comment by Артём Викториевич Антоненко [ 2021 Nov 16 ]
  1. "To lower down components in...", the issue repeats.
  2. I have only one record configured for 'ServerActive=, Proxy is active.
Comment by Артём Викториевич Антоненко [ 2021 Nov 17 ]

Do you need any additional information?

Comment by Armen [ 2021 Nov 19 ]

Hello! I have same issue when i using autoregistration actions. 
zabbix version 5.4.3
proxy version 5.4.3
agent version 5.4.7

Comment by Артём Викториевич Антоненко [ 2021 Dec 12 ]

anybody? the problem still persists...

Comment by Aigars Kadikis [ 2021 Dec 20 ]

Please have a look at how the proxy is sending the auto registration data to the central server. Run this in the proxy database:

SELECT FROM_UNIXTIME(clock),host,listen_ip,listen_port,listen_dns,host_metadata,flags,tls_accepted
FROM proxy_autoreg_host ORDER BY clock ASC;

The meaning of columns:

Column name Type Description Ref from Ref to
id id Unique record ID
 
Table ids is used as indicator of sent records
clock time Unix timestamp when host was discovered
host varchar(64) Retrieved host name from active agent request
listen_ip varchar(39) Host IP address
listen_port integer Host port
listen_dns varchar(255) Resolved host DNS name from IP address
host_metadata varchar(255) Metadata, as sent by the agent
 
It is based on HostMetadata or HostMetadataItem configuration parameters
tls_accepted integer Type of incoming connection used for autoregistration:
1HOST_ENCRYPTION_NONE - Unencrypted (default)
2HOST_ENCRYPTION_PSK - TLS with PSK
The values of this column are a subset of values of 'tls_accept' column in 'hosts' table.
flags integer Type of connection to the host
0, ZBX_CONN_DEFAULT - connect using IP address, don't update host interface
1, ZBX_CONN_IP - connect using IP address, update default host interface
2, ZBX_CONN_DNS - connect using DNS name, update default host interface

I suspect the last column 'flags' in your situation will start sending number '2':

2, ZBX_CONN_DNS - connect using DNS name, update default host interface

Please confirm.

If this is the case, we will move to the agent side troubleshooting.

Comment by Артём Викториевич Антоненко [ 2021 Dec 20 ]
SERVER_1C 1859A779 192.168.0.222 10050 server_1c.rai.local 0 1

as i see "flags" is not last, it is 2 from last so it is "0"

Comment by Aigars Kadikis [ 2021 Dec 20 ]

Thank you for info.

On the server SERVER_1C 1859A779 if you manually put:

HostInterface=192.168.0.222

Then restart agent.

In GUI, in the very next second, does the GUI automatically switch the bullet to correct place?

Show me more precise agent version:

zabbix_agentd -V

Is it zabbix_agentd Win64 (service) (Zabbix) 5.4.7, Revision 84dc2ec5dc 28 October 2021, compilation time: Oct 28 2021 13:18:12?

Comment by Артём Викториевич Антоненко [ 2021 Dec 21 ]

if i use HostInterface=192.168.0.222

pic 22.png

 

if i don`t use - pic 11-1 .png

 

zabbix_agentd -V

zabbix_agentd.exe -V
zabbix_agentd Win64 (service) (Zabbix) 5.4.7
Revision 84dc2ec5dc 28 October 2021, compilation time: Oct 28 2021 13:17:12

Comment by Aigars Kadikis [ 2021 Dec 27 ]

Thank you very much for the test. This is valuable. Let's find out which bit triggers the default interface to change.

1) Force 'HostInterface=192.168.0.222' for a moment. Make sure the GUI has the default interface to IP (correct).

2) Stop agent and install 'DebugLevel=5' and 'LogFileSize=0' in zabbix_agentd.conf. Remove 'HostInterface=192.168.0.222' line. Remove old zabbix_agentd.log.

3) Start agent. Wait till the default interface goes to DNS (wrong). It's possible it will go in the very next minute.

4) Upload compressed zabbix_agentd.log.

Comment by Артём Викториевич Антоненко [ 2021 Dec 29 ]

i don`t understand 1

but  delete host then make 2,3 and 4

wait till the default interface goes to DNS (wrong) can`t tell you at what time it happened, but it happened zabbix_agentd_without_hostinterface.rar

Comment by Aigars Kadikis [ 2021 Dec 30 ]

The log file did not capture a different auto-registration data. It's sending all the time.

117444:20211229:222248.938 sending [{"request":"active checks","host":"SERVER_1C 1859A779"}]
117444:20211229:222448.950 sending [{"request":"active checks","host":"SERVER_1C 1859A779"}]
117444:20211229:222648.967 sending [{"request":"active checks","host":"SERVER_1C 1859A779"}]

In a native way, this line can trigger changes to the host configuration.

I think it's something related to the host's name which is having a white space in the middle. Possibly a bug. The forum post also has a:

Hostname=SRV_M 7A4A594A

I have rarely seen using a space for the host's identification (Host visible name is OK). Now I did setup lab to use your value 'SERVER_1C 1859A779' for my host name. Will see how it works in the long run.

armen_a_a , can you please comment on your situation? - are you using white space for the host title?

Comment by Aigars Kadikis [ 2022 Jan 03 ]

For troubleshooting purpose please install these settings:

Set the bullet manually back for the host 'SERVER_1C 1859A779' and remove the secondary interface.

Once the unwelcome behaviour occurred, we can analyze in retrospect in central database how the auto-registration data changed:

SELECT events.eventid,
events.objectid,
events.clock,
autoreg_host.proxy_hostid,
autoreg_host.listen_ip,
autoreg_host.listen_port,
autoreg_host.listen_dns,
autoreg_host.host_metadata,
autoreg_host.tls_accepted,
autoreg_host.flags
FROM events
JOIN autoreg_host ON (autoreg_host.autoreg_hostid=events.objectid)
WHERE events.source=2
AND events.object=3
AND autoreg_host.host='SERVER_1C 1859A779';

I suspect there must be something going on with fields 'autoreg_host.listen_ip', 'autoreg_host.listen_dns', 'autoreg_host'.

Comment by Артём Викториевич Антоненко [ 2022 Jan 04 ]

same problem with 
Hostname=server11
-----------

 

 

Comment by Артём Викториевич Антоненко [ 2022 Jan 13 ]

Do you need any additional information?

Comment by Aigars Kadikis [ 2022 Jan 21 ]

Do you have hosts attached directly to the central server? Are they working perfectly? No secondary interface applies? Check carefully. 

There are only 14 lines in SQL output. The setting "Auto registration data storage period" = 30d has not been really respected yet. We need to save more lines to troubleshoot in retrospect. You said it's around 2 days for the interface to switch passive checks to DNS.

Comment by Артём Викториевич Антоненко [ 2022 Feb 01 ]

i have some hosts attached directly to the central server. They are working perfectly.

Same time i have some hosts attached via another proxy to the central server. And they are working perfectly.

same lines till end

Comment by Артём Викториевич Антоненко [ 2022 Feb 09 ]

Do you need any additional information?
 
 

Comment by Aigars Kadikis [ 2022 Mar 24 ]

If the auto registration setting still installed as '30d'

and you have seen the behaviour in the last days.

Please put all auto-registration data in TSV file. We can use the following approach:

echo "SELECT events.eventid,
events.objectid,
events.clock,
autoreg_host.proxy_hostid,
autoreg_host.host,
autoreg_host.listen_ip,
autoreg_host.listen_port,
autoreg_host.listen_dns,
autoreg_host.host_metadata,
autoreg_host.tls_accepted,
autoreg_host.flags
FROM events
JOIN autoreg_host ON (autoreg_host.autoreg_hostid=events.objectid)
WHERE events.source=2
AND events.object=3" | mysql -sN --batch nameOfZabbixDB > /tmp/autoreg.events.tsv

Please mention the hostname again which is having a problem and approximate date when it was OK and not OK.

Generated at Wed Jan 08 04:20:43 EET 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.