Ad Widget

Collapse

Template Importing and the best way to separate from the base templates

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • WendoNZ
    Junior Member
    • Apr 2022
    • 3

    #1

    Template Importing and the best way to separate from the base templates

    Hi All

    I'm trying to work out the best way to make alterations/additions to the default templates without completely shooting myself in the foot come upgrade time. As far as I understand upgrading Zabbix the recommendation is to replace all the templates with the new versions. Based on this I don't want to make significant changes or additions to those templates since my changes will be lost when I come to upgrading.

    At the moment I'm not looking to do massive changes but I want to do it right from the start rather than have to go and redo it later. I _think_ what I want is to create a new template that is nested underneath a base template, and then add my triggers etc in that. This will allow me to import tyhe base templates items and macros but add some custom triggers.

    For example I'd like to create a new CPU usage trigger that only alerts after 15mins (rather than the default 5 min) and then disable the 5 min alert on selected hosts. I'd also like to create a Disk Space trigger at alerts at 98% that I can apply to large disks, and then again disable the default alert on those large disks.

    Am I heading in the right direction here?

    When nesting Templates I _think_ I go into the base template and add the custom template I want to nest (not the other way around) but the docs don't actually specify which template you need to be in when trying to create nested templates. Is that right?

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

    #2
    Originally posted by WendoNZ
    Hi All

    I'm trying to work out the best way to make alterations/additions to the default templates without completely shooting myself in the foot come upgrade time. As far as I understand upgrading Zabbix the recommendation is to replace all the templates with the new versions. Based on this I don't want to make significant changes or additions to those templates since my changes will be lost when I come to upgrading.
    No, your changes will not be overwritten. New version of templates is installed only in case on clean new install. If you upgrade your instance, no new templates will be installed automatically. Exactly because of not to do, what you are afraid of... not to overwrite anyones changes..

    I would just clone needed template with a bit different name and use those cloned and cleaned up versions. OOB templates are anyway just a little push to get you going and you should modify things according to Your needs. When you upgrade and manually(!) import new versions of templates, you can easily let it overwrite previous default versions, as you are not using them anyway. You should be able to see, what has changed and do you want to apply those changes to your own templates.

    Comment

    • tim.mooney
      Senior Member
      • Dec 2012
      • 1427

      #3
      +1 to everything cyber said.

      Keep in mind too that some of the things you asked about, particularly related to thresholds, may be configurable via macros, so understanding all the macros a template uses will help you understand how much you can configure without having to make any changes to the template (or your cloned copy of the template).

      Also, if you haven't seen it, this blog post about updating templates may be useful: https://blog.zabbix.com/keeping-your...to-date/16412/

      The Zabbix default templates have gotten a lot better in recent versions, so it is useful and valuable to periodically consider loading the latest versions of those templates. I think the many improvements to the default templates are part of why it seems there's a bigger push from the Zabbix developers to get sites to update their templates.

      Comment

      Working...