Ad Widget

Collapse

Macro is not working on script item

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • claudio_ract
    Junior Member
    • Mar 2024
    • 4

    #1

    Macro is not working on script item


    Hello,

    I am trying to use a built-in macro ( {HOST.IP} or {HOST.CONN} ) in my Script Item, inside my template, but it is not working.

    Configuring my script item, i set "parameters name" as "host" and "parameter value" as {HOST.IP} but, when I test, the value of parameter "name" is literally {HOST.IP) instead something like 10.0.0.1

    Does anyone know what i am doing wrong ?


    ps.: I upload images because it is blocked in my company.
  • markfree
    Senior Member
    • Apr 2019
    • 868

    #2
    How are you parsing the parameters in your script?

    Comment

    • cyber
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Dec 2006
      • 4807

      #3
      Originally posted by claudio_ract
      Hello,

      I am trying to use a built-in macro ( {HOST.IP} or {HOST.CONN} ) in my Script Item, inside my template, but it is not working.

      Configuring my script item, i set "parameters name" as "host" and "parameter value" as {HOST.IP} but, when I test, the value of parameter "name" is literally {HOST.IP) instead something like 10.0.0.1

      Does anyone know what i am doing wrong ?
      Template has no host IP, so to be able to test it with a proper value, you need to enter some IP manually there. Or assign this template to a host, then open item via host config and test there... now it should take value from hosts config..
      I also managed to get similar situation (not resolved macro), when there was actually no IP for host, only name, when I "tested" directly on host... But {HOST.DNS} directly on host resolved nicely...

      Comment

      • markfree
        Senior Member
        • Apr 2019
        • 868

        #4
        With templates, you can also enter the macro value as you test the item.
        Click image for larger version

Name:	image.png
Views:	309
Size:	36.0 KB
ID:	481958

        Comment

        Working...