[ZBXNEXT-1859] Do not insert events related with autoregistration if actions are not configured Created: 2013 Aug 16  Updated: 2016 Oct 22  Resolved: 2016 Oct 22

Status: Closed
Project: ZABBIX FEATURE REQUESTS
Component/s: Server (S)
Affects Version/s: 2.0.8, 2.1.2
Fix Version/s: 2.2.16, 3.0.6, 3.2.2, 3.4.0alpha1

Type: Change Request Priority: Minor
Reporter: Alexey Pustovalov Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: events, performance
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File events.patch    
Issue Links:
Duplicate

 Description   

All Zabbix agents is configured to support Active checks generate autoregistration events even when no actions of auto-registration.



 Comments   
Comment by Oleksii Zagorskyi [ 2013 Aug 22 ]

In first comment here http://blog.zabbix.com/multiple-servers-for-active-agent-sure/858/ I mentioned opposite - from 2.0 agents do not ask list of active checks by default.

Comment by Vladislavs Sokurenko [ 2016 Oct 10 ]

Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBXNEXT-1859

Comment by Alexander Vladishev [ 2016 Oct 11 ]

(1) an empty transaction

   518:20161011:131121.928 In process_areg_data()
   518:20161011:131121.928 query [txnlev:1] [begin;]
   518:20161011:131121.928 In DBregister_host_flush()
   518:20161011:131121.928 In process_events() events_num:0
   518:20161011:131121.928 End of process_events()
   518:20161011:131121.928 End of DBregister_host_flush()
   518:20161011:131121.928 query [txnlev:1] [commit;]
   518:20161011:131121.929 End of process_areg_data():SUCCEED

vso RESOLVED in r63089

sasha CLOSED

Comment by Alexander Vladishev [ 2016 Oct 11 ]

(2) This solution is not optimal:

  1. hosts existence can be checked by one SQL statement for all discovery records;
  2. same with auto-registration actions;
  3. same with auto-registration data

vso RESOLVED in r63107, r63108, r63121, r63122

sasha CLOSED

Comment by Alexander Vladishev [ 2016 Oct 11 ]

(3) DB_DSICOVERED_HOST

  1. typo in a name of structure DB_DSICOVERED_HOST; please, use new syntax for naming of such structures, for example: zbx_autoreg_host_t
  2. this structure has string fields with static length. It badly works with multibyte strings
  3. this structure must be moved into src/libs/zbxdbhigh/db.c module

vso RESOLVED in r63107, r63108, r63121, r63122

sasha CLOSED

Comment by Alexander Vladishev [ 2016 Oct 11 ]

(4) add_dhost()

  1. this function can be rewritten to use only one structure DB_DSICOVERED_HOST
  2. why here is used strncmp() function? Will be better strcmp()

vso RESOLVED in r63107, r63108, r63121, r63122

sasha CLOSED

Comment by Alexander Vladishev [ 2016 Oct 11 ]

(5) Incorrect formatting for SQL statements:
Incorrect:

    "select autoreg_hostid"
    " from autoreg_host"     
    " where proxy_hostid%s"
    " and host='%s'"
    ZBX_SQL_NODE,

Correct:

    "select autoreg_hostid"
    " from autoreg_host"     
    " where proxy_hostid%s"
        " and host='%s'"
        ZBX_SQL_NODE,

vso RESOLVED in r63107, r63108, r63121, r63122

sasha CLOSED

Comment by Alexander Vladishev [ 2016 Oct 12 ]

(6) DBregister_host_active(): check for actions must be called only when auto-registration data is not empty

vso RESOLVED in r63131

sasha CLOSED

Comment by Alexander Vladishev [ 2016 Oct 12 ]

(7) Have a look at my changes in r63128
vso CLOSED

Comment by Alexander Vladishev [ 2016 Oct 17 ]

(8) The code was completely rewritten in r63182.
vso Tested and looked into the changes. CLOSED

Comment by Vladislavs Sokurenko [ 2016 Oct 18 ]

(9) Have a look at my changes in r63222
In each bulk first host would not show up in front end.

sasha Thanks a lot! CLOSED with minor fix in r63245.

Comment by Vladislavs Sokurenko [ 2016 Oct 18 ]

(10) Have a look at my changes in r63234
Fixed memory leak in no proxy scenario.

sasha Thanks! CLOSED

Comment by Vladislavs Sokurenko [ 2016 Oct 18 ]

Fixed conflicts in development branch svn://svn.zabbix.com/branches/dev/ZBXNEXT-1859-3.0

sasha Successfully tested with minor fix in r63255.

Comment by Vladislavs Sokurenko [ 2016 Oct 19 ]

Fixed conflicts in development branch svn://svn.zabbix.com/branches/dev/ZBXNEXT-1859-3.2

sasha Successfully tested with minor improvements in r63287.

Comment by Alexander Vladishev [ 2016 Oct 19 ]

(11) [D] broken 2.2/ChangeLog

-New features:
+New features:i

vso RESOLVED in r63283

sasha CLOSED

Comment by Vladislavs Sokurenko [ 2016 Oct 20 ]

Fixed in:

  • pre-2.2.16 r63258
  • pre-3.0.6 r63259
  • pre-3.2.2 r63288
  • pre-3.3.0 (trunk) r63290
Comment by Alexander Vladishev [ 2016 Oct 20 ]

(12) Documentation

martins-v RESOLVED in upgrade notes/what's new.

Auto-registration pages already mention that an auto-registration action must be present. It does not mention explicitly what happens with event generation. Do we need to update anything?

sasha Thanks! It will be enough. CLOSED

Generated at Sat Apr 27 01:03:28 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.