Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-23726

problem with autoregistration rerun

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • 6.4.8
    • Server (S)
    • None
    • Oracle Linux 8.8 (both server and agent), Zabbix Server v6.4.8, Zabbix Agent2 v6.4.8.

      Background:

      We have a custom script which prints certain keywords about the server, for example 'template:mysql' if the server has mysql installed. We are using this in HostMetadataItem with help of a user parameter 'user.parameter' and configured autoregistration action if metadata contains template:mysql then add to hostgroup sql servers and link to template mysql by zabbix agent. So far so good, worked perfectly.

      Incident:

      The problem raised when we uninstalled mysql on our server (this changed the HostMetadataItem output as well, verified with zabbix_get).

      Current 6.4 documentation says:

      Autoregistration is rerun:
          if host metadata information changes:
              due to HostMetadata changed and agent restarted
              due to value returned by HostMetadataItem changed

      Autoregistration has rerun as expected but the existing host groups and templates remained same, which caused false alarms.

      Steps to reproduce:

      1. Add new autoregistration action to link a template and add to host group.
      2. Edit script to add addtional keyword to meta data for the autoregistration action.
      3. Verify with zabbix_get that additional keyword is present.
      4. Check host in zabbix front end if template linked and host added to group.

             Result:

              Autoregistration action worked as expected, template linked and host added to group.

      1. Edit script to remove addtional keyword added earlier.
      2. Verify with zabbix_get that additional keyword is absent.
      3. Check host in zabbix front end.

             Result:

             Autoregistration has rerun, but earlier linked template still present, even if host meta data does not contain corresponding keyword.

      Expected:

      While above is expected behavior because we did not tell zabbix what to do for missing keywords, this causes great inconvenience while writing autoregistration actions. It is expected zabbix server to remove the stale template and host group subscriptions for active agents.

      Temporary Solution:

      We removed templates and host groups manually, wrote counter "remove from" actions for each "add to" autoregistration actions.

       

      Permanent Solution:

      Make it default to clear existing host groups and templates when autoregistration reruns.

      If possible, add an option in frontend under Administration > General > Autoregistration to enable or disable this behavior.

            neogan Andrei Gushchin (Inactive)
            atpk atpk
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: