Working with Zabbix templates
Working with Zabbix templates can be tired some and a hazel to make it easy to scale.
At first we just add a host and really don’t think much about structure or how would be the best approach. This make a mess and a lot of the templates will have conflicts with each other
It needs some kind of structure to real making zabbix easy to maintain and add servers and services to the monitoring pool.
So working on making the structure better and scale I remember that Puppetlabs had a triangle for how to setup a structure manifest
A triangle that represent the structure of the template.
- First we have our checks. These are simple and my contain only one simple item with a trigger and maybe a graph. Starting collection all of these under one template group called “Check templates” This is the only layer that have items, triggers and graphs.
- Layer 2 is our profile layer. Making these as generic as possible. And dived them up if it was needed. These templates have no items, triggers and graph but only link to the template with the checks
- After defining the profiles we are go up one step and create role templates. E.g a Linux CentOS check and a Linux Debian check as profile name. These may have checks as this but all generic for all servers of specific type.
- Ssh service
- Ntp
- CPU load and utilization
- Storage
- Network
- When we are moving the triangle we get more and more server specific on what should be monitored on the server. A role could be a NS Server. This server has its major services as Bind9. But is it not just a NS Server it is also a Linux server. And the zabbix agent might have some specific checks for NS server so a DNS Zabbix profile is added as well together with a Debian Linux profile – if it is a Debian box.
So now the template history will look something like this.
So here we take the ssh, ntp and the linux os checks and link them to a profile template called Debian server.
Same with the Bind and Zabbix to a DNS specific profile template. I’m adding the zabbix to the together with the bind because this zabbix check has specific checks for queries and performance executed with scripts from UserParameters option.
This form a DNS Role that fits our park of dns servers, combining the Debian and the dns/zabbix profiles templates in to one.
I have not added any hosts yet. And a host will only have one link template – the role template. It inherent the checks and macro settings from previous link check templates.
So in practics it looks like this.
This illustrate the checks with template name to the left with items,triggers and graphs.
Profiles templates
Last bu least the role and here is the hosts added to the role Templates. This make the structure clean and easy to maintain