Ad Widget

Collapse

Macro configuration is not working

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vrtareg
    Senior Member
    • May 2006
    • 293

    #1

    Macro configuration is not working

    Hi

    I have a problem with macro configuration but did not find the proper answer in forum or documentation.

    1. I have "Template AMQP" template configured with the key:
    Name: AMQP {$AMQPHOST} - File Descriptors Used
    Type: Zabbix agent (active) (the values will be sent using the zabbix_sender)
    Key: amqp[rabbit@{$AMQPHOST},fd_used] ({$AMQPHOST} is the host based macros)

    2. The host is configured with the template above assigned and the macros configured:
    Macros: {$AMQPHOST} = amqp1

    The problem is that the macros is correctly parsed in host key name but not the key itself, even in documentation it say so:

    Host:
    Template AMQP: AMQP amqp1 - File Descriptors Used
    amqp[rabbit@{$AMQPHOST},fd_used]

    The key value should be the "amqp[rabbit@amqp1,fd_used]" and not "amqp[rabbit@{$AMQPHOST},fd_used]".

    Does anyone know if you are using the macros in key what is the right way to use it so it will be shown as value of macros and not the macro name.

    Regards,
    Areg
  • vrtareg
    Senior Member
    • May 2006
    • 293

    #2
    Hi

    Here is the output from zabbix_sender:

    Code:
    $ zabbix_sender -z zabbix -s amqp1 -k amqp[rabbit@amqp1,fd_used] -o 100 -vv
    zabbix_sender [11738]: DEBUG: answer [{
            "response":"success",
            "info":"[B]Processed 0 Failed 1 Total 1[/B] Seconds spent 0.000090"}]
    info from server: "[B]Processed 0 Failed 1 Total 1[/B] Seconds spent 0.000090"
    sent: 1; skipped: 0; total: 1
    
    $ zabbix_sender -z zabbix -s amqp1 -k amqp[rabbit@{\$AMQPHOST},fd_used] -o 100 -vv
    zabbix_sender [11751]: DEBUG: answer [{
            "response":"success",
    "info":"[B]Processed 1 Failed 0 Total 1[/B] Seconds spent 0.000232"}]
    info from server: "Processed 1 Failed 0 Total 1 Seconds spent 0.000232"
    sent: 1; skipped: 0; total: 1
    Why sending the correct key "-k amqp[rabbit@amqp1,fd_used]" is failing and the wrong one "-k amqp[rabbit@{\$AMQPHOST},fd_used]" is passing?????

    Regards,
    Areg

    Comment

    • DRVTiny
      Senior Member
      • Sep 2011
      • 162

      #3
      I have absolutely the same problem:
      Code:
      ./zabbix_sender -s my-zabbix-host -k 'ipa_replication_status["{$IPA_SERVER_RIGHT}","{$IPA_SERVER_LEFT}"]' -o 'OK' -z my-zabbix-server
      Response from "msk1-zbxprx01:10051": "processed: 1; failed: 0; total: 1; seconds spent: 0.000044"
      sent: 1; skipped: 0; total: 1
      And the item key is: ipa_replication_status["{$IPA_SERVER_RIGHT}","{$IPA_SERVER_LEFT}"]

      I think, this a bug: user macroses not substituted in item key if item type is "zabbix trapper"

      Comment

      • DRVTiny
        Senior Member
        • Sep 2011
        • 162

        #4

        Hmm.. Seems like the bug described here is a root case

        Comment

        • DRVTiny
          Senior Member
          • Sep 2011
          • 162

          #5
          https://www.zabbix.com/documentation...mtypes/trapper

          Zabbix trapper process does not expand macros used in the item key in attempt to check corresponding item key existence for targeted host.


          I don't know WHY zabbix trapper cant expand user macros in item key. But, hmm, it is so.
          It is stiil a bug, but in the Zabbix architecture and no one tends to will to resolve this obvious problem

          Comment

          Working...