[ZBX-13299] Auto registration messages not sent when HostMedata is set Created: 2018 Jan 05  Updated: 2024 Apr 10  Resolved: 2018 Apr 18

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 3.4.4
Fix Version/s: 3.4.9rc1, 4.0.0alpha6, 4.0 (plan)

Type: Problem report Priority: Blocker
Reporter: Nicola Mauri Assignee: Vladislavs Sokurenko
Resolution: Fixed Votes: 0
Labels: actions, autoregistration
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Zabbix server 3.2.11 on Mysql 5.7.16 and Centos 7


Attachments: File ZBX-13299.diff    
Issue Links:
Causes
caused by ZBX-12258 Unnecessary SQL queries while process... Closed
Team: Team A
Sprint: Sprint 30, Sprint 31, Sprint 32
Story Points: 1

 Description   

Steps to reproduce:

  1. Create a new action for auto registration like this:
    • Condition: Host metadata like linux
    • Operation: Add host
    • Operation: Send message
  2. Configure in zabbix_agentd.conf:
    • HostMetadata=linux
  3. Restart zabbix agent

Result:
Host gets added but no message is sent.
Expected:
Host added and message sent.

Notes:

  • If metadata details are removed from action and from agent, host gets added and message is properly sent.
  • Issue seems to have started after updating zabbix-server from 3.2.8 to 3.2.11.


 Comments   
Comment by Nicola Mauri [ 2018 Jan 06 ]

Temporary workaround:

  1. Write a shell script to send a message and save it on zabbix server. The script should accept recipients, subject and message body on the command line
  2. In your action replace operation Send message with Remote command:
    • Target: current host
    • Type: custom script
    • Execute on: Zabbix server
    • Commands: /path/to/script.sh [email protected] "New host: {HOST.HOST}

      "
      Limitations: recipients must be statically specified in the command line, they cannot be dinamic.

Comment by Dmitrijs Lamberts [ 2018 Jan 08 ]

Hello Nicola,

I were not able to reproduce your issue in latest 3.4.5
Email is sent as expected.

Best regards,
Dmitry

Comment by Kirill Varnakov [ 2018 Feb 16 ]

Hi.

I have this problem too. It happened, when several servers (10) want register in the same time. Version 3.4.6

Comment by Aleksejs Petrovs [ 2018 Feb 19 ]

Hello Kiril and Nicola,

Can't reproduce the issue with 10 simultaneously added hosts.

kuPyxa, have you performed an upgrade from older Zabbix Server version or it was a clean install?

Regards,
Aleksejs!

Comment by Kirill Varnakov [ 2018 Feb 19 ]

My case: clean install, active agent registers over zabbix proxy. Zabbix server gets metrics from passive zabbix proxy.

Comment by Aleksejs Petrovs [ 2018 Feb 20 ]

Tried to reproduce with Zabbix 3.4.6 + Zabbix Proxy + ~20 Zabbix Agents = no problems so far.
Do you see any errors in the log file?
Also, we've just released the 3.4.7, could you try to perform an update?

Regards,
Aleksejs!

Comment by Kirill Varnakov [ 2018 Mar 05 ]

After update to 3.4.7, nothing changed. Today autoregistered 10 servers, but 7 messages was sent. No errors in log files.

I use HostMetadataItem=system.uname and in Action I use this data for add group and add template.

Comment by Vladislavs Sokurenko [ 2018 Mar 26 ]

Does this happen to new actions or was it added for a long time ?
Is it possible that action was not in cache ?
If you can reproduce the issue, I would like to see escalator logs please.
Did all messages have same subject and message ?

Comment by Nicola Mauri [ 2018 Mar 26 ]

Well, in our environment, after updating from 3.2.11 to 3.4.7 the issue cannot be reproduced. Apparently no other changes were made on our installation, which could be related to this behaviour.

Comment by Kirill Varnakov [ 2018 Mar 26 ]

Reproduce this problem:

  • delete 8 servers from Zabbix
  • restart proxy && server
  • waiting active agents for auto register
  • 7 messages received about new servers

It is not guarantee 100% result.

Comment by Vladislavs Sokurenko [ 2018 Mar 26 ]

Thank you, issue reproduced.

Comment by Kirill Varnakov [ 2018 Mar 26 ]

These are messages from auto registered agents events.

Comment by Vladislavs Sokurenko [ 2018 Apr 10 ]

Fixed in:

  • pre-3.4.9rc1 r79500
  • pre-4.0.0alpha6 (trunk) r79502
Generated at Wed Apr 24 11:19:03 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.