Ad Widget

Collapse

Applying Macros via Templates

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • michaeldpotter
    Junior Member
    • Jan 2020
    • 2

    #1

    Applying Macros via Templates

    Hello,
    I am fairly new to Zabbix, so I apologize for my lack of understanding of some of it's capabilities.

    I downloaded a template for my AIX servers. I modified the template and for the "Too many processes on {HOSTNAME}" trigger, I changed the default value of 300 to {$TOTALNUMPROCESSES} and then also set a macro for the template for {$TOTALNUMPROCESSES} = 300. I figured this way I could adjust the total number of processes for all the AIX servers by simply changing the macro value on the AIX template. This seems to work fine.

    I have some AIX servers that run a certain application, so this total number of processes needs to be higher for those. Rather than set individual macros on all the hosts, I thought I could create a template for the application, and apply that template to those specific hosts. So, I created the template, and then only think defined in it is the macro {$TOTALNUMPROCESSES} = 600. I linked both the AIX template, and the App template to one of the hosts.

    However, when I look at the inherited macros for the hosts, I only see the macro from the AIX template.

    Am I just going about this the wrong way, or am I not understanding how the templates work?

    Thanks for your help!
    Michael
  • Markku
    Senior Member
    Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
    • Sep 2018
    • 1782

    #2
    Hi, I believe that the macro defined in the same template that uses it overrides the macro possibly defined in other templates. I say this because I just implemented a system this way:
    • The first template uses the macro but does not define it
    • Second template defines the macro (this template only has a bunch of use case-specific macros in it)
    • Both templates are applied to the hosts.
    And this works.

    Markku

    Comment

    • Markku
      Senior Member
      Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
      • Sep 2018
      • 1782

      #3
      Oops, actually, there is documentation about the template preference:



      Markku

      Comment

      • michaeldpotter
        Junior Member
        • Jan 2020
        • 2

        #4
        Thank you so much for your help on this!

        Comment

        Working...