Top Banner
and the art of Zabbix template design Zen
36

Raymond Kuiper - Zen and The Art of Zabbix Template Design | ZabConf2016

Apr 11, 2017

Download

Technology

Zabbix
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Raymond Kuiper - Zen and The Art of Zabbix Template Design | ZabConf2016

and the art of

Zabbix template design

Zen

Page 3: Raymond Kuiper - Zen and The Art of Zabbix Template Design | ZabConf2016

Robert M. Pirsig

“...it should in no way be associated with that great body of factual information relating to orthodox Zen

Buddhist practice. It's not very factual on motorcycles,

either.”

Page 4: Raymond Kuiper - Zen and The Art of Zabbix Template Design | ZabConf2016

Quality

Page 5: Raymond Kuiper - Zen and The Art of Zabbix Template Design | ZabConf2016

Default Templates: “Templates that Zabbix SIA sends together with Zabbix are only for testing, and they

may be for proving concepts; they are not for use in a production environment. We'll need

to create our own templates based on our needs.”

Luciano Alves

Page 6: Raymond Kuiper - Zen and The Art of Zabbix Template Design | ZabConf2016

Our template problem

Page 7: Raymond Kuiper - Zen and The Art of Zabbix Template Design | ZabConf2016

So, what makes a good Zabbix template?

Page 8: Raymond Kuiper - Zen and The Art of Zabbix Template Design | ZabConf2016

Zabbix.org says: ● Templates should be modular● Templates should be as universal as

reasonably possible● LLD should be used for all supported

objects● Consider using user macros for values

users might want to finetune● …...

zabbix.org/wiki/Docs/template_guidelines

Page 9: Raymond Kuiper - Zen and The Art of Zabbix Template Design | ZabConf2016

ModularityReusability

Flexibility...do one thing, and do it great!

Page 10: Raymond Kuiper - Zen and The Art of Zabbix Template Design | ZabConf2016

We need a design pattern!

Page 11: Raymond Kuiper - Zen and The Art of Zabbix Template Design | ZabConf2016

“In software engineering, a design pattern is a general repeatable solution to a commonly occurring problem in software

design. A design pattern isn't a finished design that can be transformed directly into code. It is a description or template for

how to solve a problem that can be used in many different situations.”

sourcemaking.com/design_patterns

Design Pattern:

Page 12: Raymond Kuiper - Zen and The Art of Zabbix Template Design | ZabConf2016

Roles & Profiles

www.craigdunn.org/2012/05/239/

Page 13: Raymond Kuiper - Zen and The Art of Zabbix Template Design | ZabConf2016

Role based Zabbix templates

Page 14: Raymond Kuiper - Zen and The Art of Zabbix Template Design | ZabConf2016

Keep infra up

$organisation

Monitoring Report to $boss

Page 16: Raymond Kuiper - Zen and The Art of Zabbix Template Design | ZabConf2016

github.com/q1x/zabbix-templates-30/wiki/Template-Hierarchy

Template::Duty::App::Web::AMPTemplate::Duty::OS::Linux

Template::Role::LAMP

Template::Profile::Prod_web

Template::Task::Sys::Mem

*::App::DB::Mysql

*::App::Web::Apache

*::Sys::FS

Page 17: Raymond Kuiper - Zen and The Art of Zabbix Template Design | ZabConf2016

Template::Task::Availability:Ping

Example: Macros

Template ICMP Ping:

Template::Task::Availability:Ping:

Page 18: Raymond Kuiper - Zen and The Art of Zabbix Template Design | ZabConf2016

Template::Task::Availability:Ping

Example: Macros

Default macro values:

Override macros:

Page 19: Raymond Kuiper - Zen and The Art of Zabbix Template Design | ZabConf2016

Template::Task::Availability:Ping

Example: Macros

Override macro for a single item:

Page 20: Raymond Kuiper - Zen and The Art of Zabbix Template Design | ZabConf2016

Template::Task::Availability:Ping

Example: Macros

Triggers:

Macros:

Page 21: Raymond Kuiper - Zen and The Art of Zabbix Template Design | ZabConf2016

Template::Task::Availability:Ping

Example: Macros

Triggers status:

Trigger description:

Page 22: Raymond Kuiper - Zen and The Art of Zabbix Template Design | ZabConf2016

Template::Task::Availability:Ping

Example: Macros

Calculated item:

Page 23: Raymond Kuiper - Zen and The Art of Zabbix Template Design | ZabConf2016

Template::Task::Availability:Ping

Example: Macros

Graph:

Page 24: Raymond Kuiper - Zen and The Art of Zabbix Template Design | ZabConf2016

Template::Task::Sys::Filesystem

Example: LLD

Discovery rule:

Page 25: Raymond Kuiper - Zen and The Art of Zabbix Template Design | ZabConf2016

Template::Task::Sys::Filesystem

Example: LLD

Discovery filter:

Filter by usermacro:

Page 26: Raymond Kuiper - Zen and The Art of Zabbix Template Design | ZabConf2016

Template::Task::Sys::Filesystem

Example: LLD

Host screen with prototypes:

Page 27: Raymond Kuiper - Zen and The Art of Zabbix Template Design | ZabConf2016

Template::Task::Sys::Filesystem

Example: LLD

Host screen with prototypes:

Page 28: Raymond Kuiper - Zen and The Art of Zabbix Template Design | ZabConf2016

Template::Role::ZabbixProxy

Example: template linkage

Duty template:

Role template:

Page 29: Raymond Kuiper - Zen and The Art of Zabbix Template Design | ZabConf2016

Template::Role::ZabbixProxy

Example: template linkage

Macro inheritance:

Page 30: Raymond Kuiper - Zen and The Art of Zabbix Template Design | ZabConf2016

Template::Role::ZabbixProxy

Example: template linkage

Template::Profile::*::ZabbixProxy:

Page 31: Raymond Kuiper - Zen and The Art of Zabbix Template Design | ZabConf2016

Template::Role::ZabbixProxy

Example: template linkage

Differentiate between environments:

Page 32: Raymond Kuiper - Zen and The Art of Zabbix Template Design | ZabConf2016

Where can I find more info?

Page 33: Raymond Kuiper - Zen and The Art of Zabbix Template Design | ZabConf2016

github.com/q1x/zabbix-templates-30/

Role based template project

Page 34: Raymond Kuiper - Zen and The Art of Zabbix Template Design | ZabConf2016

How to improve this concept further?

Page 35: Raymond Kuiper - Zen and The Art of Zabbix Template Design | ZabConf2016

Open Issues: ● ZBXNEXT-3370/ZBX-11178Export dependencies between child templates

● ZBXNEXT-2957Ability to mask macros in the frontend

● ZBXNEXT-1675Add macros support for update intervals

support.zabbix.com

Page 36: Raymond Kuiper - Zen and The Art of Zabbix Template Design | ZabConf2016

Questions?