Ad Widget

Collapse

Host group macros?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • danrog
    Senior Member
    • Sep 2009
    • 164

    #16
    This works for us....

    This works for us:
    A. Create Template_Base_Tomcat
    B. Create Item "log[{$TOMCAT_LOG}].....and all other things needed in BASE template using macros
    C. Create Template_MYTOMCAT_App1
    D: Link Template_Base_Tomcat in Template_MYTOMCAT_App1
    E. Create Macro in Template_MYTOMCAT1_App called {$TOMCAT_LOG} = /home/app/logs/catalina.out ....and other macros....
    F: Attach Template_MYTOMCAT_App1 to ALL hosts in this app pool

    You can extend step E to include other macros that you used in other base templates (such as OS or Hardware) that you either link to the App template or directly to the host.

    I should note this falls apart if you end up with two macros/keys of the same name on the same host (i.e. TWO App templates sharing the same base template on one host), but you can get around this by adding a second or third identical base template with different key and macros names.

    Repeat steps C-F for each app monitored.

    We've also taken this a few steps further with auto discovery and discovery actions. Based on a UserParamater that is added to each host during agent install (RPM post script or VBScript), we automatically assign an app template and base OS templates. We manage all hosts with templates making it very scalable for us (over 1500 hosts right now and we only just begun rolling it out in prod last week).
    Last edited by danrog; 05-01-2010, 16:40.

    Comment

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

      #17
      Originally posted by danrog
      ...
      I should note this falls apart if you end up with two macros/keys of the same name on the same host (i.e. TWO App templates sharing the same base template on one host), but you can get around this by adding a second or third identical base template with different key and macros names.
      ...
      which is kinda expected - how would you determine precedence ?
      Zabbix 3.0 Network Monitoring book

      Comment

      • danrog
        Senior Member
        • Sep 2009
        • 164

        #18
        Originally posted by richlv
        which is kinda expected - how would you determine precedence ?
        Oh yes, I just wanted to make it clear in case it wasn't.

        Comment

        • akapap
          Member
          • Nov 2009
          • 35

          #19
          Originally posted by danrog
          This works for us:
          A. Create Template_Base_Tomcat
          B. Create Item "log[{$TOMCAT_LOG}].....and all other things needed in BASE template using macros
          C. Create Template_MYTOMCAT_App1
          D: Link Template_Base_Tomcat in Template_MYTOMCAT_App1
          E. Create Macro in Template_MYTOMCAT1_App called {$TOMCAT_LOG} = /home/app/logs/catalina.out ....and other macros....
          F: Attach Template_MYTOMCAT_App1 to ALL hosts in this app pool
          This still is some poor workaround. It won't work with default items like CPULOAD. In that case I would have to like Template_Linux to the Custom_Template. But my custom templete should be spec items to monitor for threads of apache. I would like to have such a custome template to link it with only the apache. In your scenario I would have to but every item to the bucket of Custome_Templete (with Linux_Templete inside).

          Best regards,
          e.

          Comment

          • danrog
            Senior Member
            • Sep 2009
            • 164

            #20
            Originally posted by akapap
            This still is some poor workaround. It won't work with default items like CPULOAD. In that case I would have to like Template_Linux to the Custom_Template. But my custom templete should be spec items to monitor for threads of apache. I would like to have such a custome template to link it with only the apache. In your scenario I would have to but every item to the bucket of Custome_Templete (with Linux_Templete inside).

            Best regards,
            e.
            You do not have to link the template to the app template. We didn't (hopefully its not a bug http://www.zabbix.com/forum/images/smilies/smile.gif). All we did is put all the macro values in the common/app template and linked the base linux template to all linux hosts using a discovery action. If you have hosts of the same type and by definition, the same monitoring requirements, you just have to put the custom macros for ALLLLL base items in the common/app template. For instance, if you have CPU monitoring in your base, instead of using a static value, set it to a macro. Then under the global config, create the macro with the same name and give it a base value that is most common across your systems. Then add this same macro to your app template. If you don't have a "base value" then dont add it to the global config, just add it to your app/common system template.

            Comment

            Working...