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

Zabbix agent 2 silently fails to register metrics that have brackets in the description

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Duplicate
    • Icon: Trivial Trivial
    • None
    • 7.0 (plan)
    • Agent (G)
    • None
    • Sprint 107 (Dec 2023)

      The following

              plugin.RegisterMetrics(&impl, "DNS",
                      "net.dns", "Checks if DNS service is up.",
                      "net.dns.perf", "Measures DNS query time in seconds.",
                      "net.dns.record", "Performs a DNS query.",
                      "badger", "Performs a DNS query X. (hi)",
              )
      

      will not register badger metric:

      ./sbin/zabbix_agent2 -t badger
      badger                                        [m|ZBX_NOTSUPPORTED] [Unknown metric badger
      

      If brackets get removed:

      func init() {
              plugin.RegisterMetrics(&impl, "DNS",
                      "net.dns", "Checks if DNS service is up.",
                      "net.dns.perf", "Measures DNS query time in seconds.",
                      "net.dns.record", "Performs a DNS query.",
                      "badger", "Performs a DNS query X.",
              )
      }
      

      it starts working fine:

      ./sbin/zabbix_agent2 -t badger
      OMEGA PARAMTS: %!s(MISSING)badger                                        [s|[{"flags":["RA"]},{"response_code":"REFUSED"},{"query_time":"0.00"},{"question_section":[{"qclass":"IN","qname":"zabbix.com.","qtype":"SOA"}]},{},{},{}]]
      

      There is no panic, error message of any sort or any warnings in logs.

            zabbix.dev Zabbix Development Team
            arimdjonoks Artjoms Rimdjonoks
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: