Ad Widget

Collapse

1.8 vs Macros

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • akapap
    Member
    • Nov 2009
    • 35

    #1

    1.8 vs Macros

    Hi,

    So I'm testing 1.8 and I can not find any good example about simple MACRO. I would like change the name of interface in several hosts. How can I do it?

    Best regards,
    e.
  • exkg
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified Specialist
    • Mar 2007
    • 718

    #2
    Creating:

    {NEWMACRO} = <value>

    Example:

    {NET_IFACE} = sit0

    In 'Iten' you need use:

    net.if.in[${NET_IFACE},bytes]


    []s,
    Luciano
    --
    Luciano Alves
    www.zabbix.com
    Brazil | México | Argentina | Colômbia | Chile
    Zabbix Performance Tuning

    Comment

    • akapap
      Member
      • Nov 2009
      • 35

      #3
      So I have to put every macro into for example Template_Linux?

      I have one template bind to 20 hosts. Now I should modify Template_Linux and in every item put macros?

      Best regards,
      e.

      Comment

      • ufocek
        Senior Member
        • Aug 2006
        • 161

        #4
        Hi,

        You need modification only in template_linux ane the new macro to appear all hosts which used template_linux

        Comment

        • akapap
          Member
          • Nov 2009
          • 35

          #5
          Still I can't get sth.

          I use template_linux in 20 hosts. In two of them I want to change the name of interface. If I put Macro in template_linux I will have to put macro in every of the hosts even if they gonna use ethX?

          Best regards,
          e.

          Comment

          • richlv
            Senior Member
            Zabbix Certified Trainer
            Zabbix Certified SpecialistZabbix Certified Professional
            • Oct 2005
            • 3112

            #6
            i'm not sure i got the question just right... but if i did, you would define interface name either as a global macro, or a template macro, then _only_ redefine it for hosts where you want to use different interface name.

            there actually are some examples in the manual - http://www.zabbix.com/documentation/...t_level_macros
            Zabbix 3.0 Network Monitoring book

            Comment

            • akapap
              Member
              • Nov 2009
              • 35

              #7
              Hit me or doc.

              I've tried to set up a macro on template and host level (Can I do it on the group host?) and every syntax that I've checke fail. I still see in the item {$CUSTOM_LEVEL} rather then a value of it.

              What is the right syntax for entering the macro?

              Best regards,
              e.

              Comment

              • richlv
                Senior Member
                Zabbix Certified Trainer
                Zabbix Certified SpecialistZabbix Certified Professional
                • Oct 2005
                • 3112

                #8
                tell what and where exactly have you entered, and where do you see that string
                Zabbix 3.0 Network Monitoring book

                Comment

                • akapap
                  Member
                  • Nov 2009
                  • 35

                  #9
                  In the Template_Linux I've puttted {$NET_IFACE} -> eth0. In the item:
                  net.if.in[${NET_IFACE},bytes]. I've tried with {$NET_IFACE} the result was still the same. Even if I've put {$NET_IFACE} -> bg1 I still see: "net.if.in[${NET_IFACE},bytes].

                  Best regards,
                  e.

                  Comment

                  • richlv
                    Senior Member
                    Zabbix Certified Trainer
                    Zabbix Certified SpecialistZabbix Certified Professional
                    • Oct 2005
                    • 3112

                    #10
                    correct syntax is {$NAME}.
                    while it will still show macro in the frontend, it should work perfectly when data is retrieved.

                    how, it could be argued that it should be also replaced in some locations in the frontend - if so, where would you expect macro to be replaced by the current value ?
                    Zabbix 3.0 Network Monitoring book

                    Comment

                    Working...