Ad Widget

Collapse

Use Global Variable for Macro Value in a custom Template

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • shafuq
    Junior Member
    • Oct 2024
    • 17

    #1

    Use Global Variable for Macro Value in a custom Template

    I'm using a template "Alcatel-Lucent Enterprise OmniSwitch AOS 6.x" from zabbix github.


    It comes with three macro values that need to be filled as described in its document:

    "Open "Configuration -> Templates -> Template Alcatel-Lucent Enterprise OmniSwitch AOS 6.x -> Macros" and set the three entries."

    I already have snmpv3user {$SNMPv3PW} and snmpv3pw {$SNMPv3PW} global variables set in Zabbix for other similar templates. So I would like to know if I could fill in this template's macro fields with these global variables instead of repeating the same values.

    For example, can I use the following within this template's Macros section:

    MACRO/VALUE:
    {$SNMP_V3_AUTHPASSPHRASE} = {$SNMPv3PW}
    {$SNMP_V3_PRIVPASSPHRASE} = {$SNMPv3PW}
    {$SNMP_V3_USER} = {$SNMPv3_USR}

    Instead of:

    MACRO/VALUE:
    {$SNMP_V3_AUTHPASSPHRASE} = MySnmpPW
    {$SNMP_V3_PRIVPASSPHRASE} = MySnmpPW
    {$SNMP_V3_USER} = MySnmpUserName

    Thanks in advance!
  • Answer selected by shafuq at 28-11-2024, 14:36.
    cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    If you think a bit... Where those macros are being used?
    In v6 you configure all snmp credentials in hosts config, they are not used in item config, so those macros are kind of useless...
    I think this template has been upgraded from older version and macros have not been removed...

    Comment

    • shafuq
      Junior Member
      • Oct 2024
      • 17

      #2
      This seems like a very basic question. Googling it returns no results. Are there no senior zabbix users out there that can answer yes/no?

      Comment

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

        #3
        If you think a bit... Where those macros are being used?
        In v6 you configure all snmp credentials in hosts config, they are not used in item config, so those macros are kind of useless...
        I think this template has been upgraded from older version and macros have not been removed...

        Comment

        • shafuq
          Junior Member
          • Oct 2024
          • 17

          #4
          Originally posted by cyber
          If you think a bit... Where those macros are being used?
          In v6 you configure all snmp credentials in hosts config, they are not used in item config, so those macros are kind of useless...
          I think this template has been upgraded from older version and macros have not been removed...
          You are right, after examining the yaml file I noticed the macros weren't used anywhere.

          Thanks!

          Comment

          Working...