Ad Widget

Collapse

any way to refer to another host using a macro in a calculated item

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lmgray
    Junior Member
    • Jun 2017
    • 6

    #1

    any way to refer to another host using a macro in a calculated item

    I'm trying to do something like this in a template:

    Code:
    last("{$OTHERHOST}:web.test.fail[webapp]")
    but doing so results in this error:

    Cannot evaluate function "last()": item "zabtest:{$OTHERHOST}:web.test.fail[webapp]" does not exist.
    Doc on calculated items is a little muddy -- doc for calculated items says:

    User macros in the formula will be expanded if used to reference a function parameter or a constant. User macros will NOT be expanded if referencing a function, host name, item key, item key parameter or operator.
    I am using {$OTHERHOST} as part of the parameter to the function last() -- but, in the context of the hostname which I guess is why I get the error...

    Anyone have any ideas how I can make the hostname in a calculated item be a "variable" (presumably user macro, but open to other creative ideas) in a template?

    What I'm trying to do is calculate an item on a virtual host based on values from a number of "underlying" actual hosts. I don't want to put the underlying hosts in a group and use grpsum() because I would have over 200 such groups (and growing) -- and I think I'd have the same problem anyway as the group name would need to be a variable (macro)...

    Thanks in advance for any ideas!
    Last edited by lmgray; 08-06-2017, 19:38.
  • Akansha123
    Member
    • Jun 2016
    • 54

    #2
    The reason for the key which you have configured is not working is mentioned below
    "User macros in the formula will be expanded if used to reference a function parameter or a constant.User macros will NOT be expanded if referencing a function, host name, item key, item key parameter or operator." s mentioned by you

    It is not possible to mention variable hostname in template for calculated item.

    Comment

    Working...