Ad Widget

Collapse

Quoted keys and User-defined macros in Aggregate Key Names

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • moseleymark
    Junior Member
    • Aug 2010
    • 9

    #1

    Quoted keys and User-defined macros in Aggregate Key Names

    (Reposting this from the "Help" forum in the off-chance this is a more appropriate place)

    Hi. I'm fairly new to Zabbix (and *love* it), so this may be a daft question, though I've been unable to google an answer or find it in the forum archives. I'm using Zabbix as essentially a performance monitoring system. I've got all the actual tests running just fine.

    What I've been hung is trying to use the "Aggregate" item with anything that has quotes in the aggregated item's key. For example:

    Given a regular 'Zabbix agent' item (that is working and returning valid data) with a key of:

    net.tcp.service.perf["smtp","10.1.1.1"]

    what should the key in the 'Zabbix aggregate' item be called?

    I've tried things like:

    grpavg["Mail Servers","net.tcp.service.perf[smtp,10.1.1.1]","last","0"]
    grpavg["Mail Servers",'net.tcp.service.perf["smtp","10.1.1.1"]',"last","0"]
    grpavg["Mail Servers","net.tcp.service.perf["smtp","10.1.1.1"]","last","0"]
    grpavg["Mail Servers","net.tcp.service.perf[\"smtp\",\"10.1.1.1\"]","last","0"]

    and any other permutation I could think of, all to no avail. I either get a "error: No items for key" error or just a "is not supported, old status" error. I imagine it's something simple that I've overlooking.

    The second part to this question is how then do I put user-defined macros in the aggregated key name? For example, the *real* thing I've been doing is more like this:

    I've got a template with an item whose key is:

    net.tcp.service.perf["smtp","{$IP_ADDRESS}"]

    and in the hosts that are using that template, {$IP_ADDRESS} is defined, e.g. 10.1.1.1 to match the above. The items themselves work just fine and are returning valid data I can't seem to get that to work either in something like grpavg. I've tried the same permutations as above, all with the same failures. I'll also note that if I don't do enough quoting, it'll dereference the macro, which is bad.

    Anybody have any pointers on what I'm doing wrong? thanks!
  • moseleymark
    Junior Member
    • Aug 2010
    • 9

    #2
    Quoted keys and User-defined macros in Aggregate Key Names

    Is this not possible then? I think it comes down to a matter of escaping macros. How does one escape a macro but not have the escape character be part of the aggregate's "key"? If I backslash a macro (in front of the $) in the "key" arg to grpavg, e.g. grpavg["my group", "myfunc[{\$MYVAR}","last","0"], and save it, zabbix actually looks for "myfunc[{\$MYVAR}". No \ at all or a \ in front of the { still interpolates the macro, which then breaks the item.

    So the question is: is there an escape character to prevent macro interpolation?

    I'd be happy to submit a bug or feature request but I hate to do so when the functionality already exists and works.

    Comment

    • moseleymark
      Junior Member
      • Aug 2010
      • 9

      #3
      Any Zabbix experts have any info on this?

      Comment

      • bcarpio
        Member
        • Jun 2008
        • 96

        #4
        Same Problem

        I have the same problem

        grpsum["VMmware ESXi Hosts"," MemUsage[{$HOST}]","last","0"]

        Comment

        • bcarpio
          Member
          • Jun 2008
          • 96

          #5
          Also in calculated

          The same problem also seems to exist for calculated items. For instance I have a key "MemUsage[{$HOST}]" which is in every one of my ESXi hosts, this $HOST macro is set when I create the VMware host.

          How do you create a calculated item for lets say 3 ESXi hosts all of which use the same key?

          Do you change MemUsage[{$HOST}] to MemUsage[esxi-host-01] and MemUsage[esx-host-02]

          Comment

          Working...