Everything set at the template level is inherited by hosts. The advantage of this design is that a large number of hosts can be applied to a template and they will all be monitored the exact same way. Modifications made to the template are applied to all hosts associated with the template, but customization to the template can be made at a single host without impacting the entire template.

Templates can be linked to each other to inherit attributes from the parent and keep a clean, traceable system. Below is a diagram of how templates can be linked to each other to inherit attributes.

This is a basic layout of how templates can be linked and how hosts are associated with them. I’ll explain each situation now.

Host One

Host One has a total of three templates being applied to it. Template ICMP is the highest tier and has one item, one trigger, and one macro. This top level template is linked to the Template Temperature, which inherits the attributes plus it has its own item, trigger, and macro. Template SSH then links to Template Temperature and inherits all of its attributes. Notice that the {$UPDATE_INTERVAL} macro within Template SSH is modified to 2m instead of 5m.

Host One is within Template SSH so it inherits all of the templates attributes. This host has a different password than the template expects though, so the macro is updated at the host level. If another host were to be added to Template SSH, it would use the macro within Template SSH (which is inherited by Template Temperature) by default. If a host were to be added to Template Temperature, it would use all attributes within that template but none from Template SSH.

Host Two

Host Two has two templates being applied to it. Template ICMP is the highest tier and has one item, one trigger, and one macro. This top level template is linked to the Template Printer which inherits the attributes plus it has its own item, trigger, and macro.

Host Two is within Template Printer so it inherits all of the templates attributes. There is no modification made at any level, so if a user updated the item, trigger, or macro at Template ICMP or Template Printer it would update for Host Two as well.

Host Three

Host Three only has Template ICMP associated with it, so it only receives the item, trigger, and macro from that template. It does have the {$UPDATE_INTERVAL} modified to 10m so it will update half as often as hosts using the Template ICMP macro setting.

Leave a Reply

Your email address will not be published. Required fields are marked *