Book Image

Zabbix Cookbook

By : Patrik Uytterhoeven, patrik uytterhoeven
Book Image

Zabbix Cookbook

By: Patrik Uytterhoeven, patrik uytterhoeven

Overview of this book

Table of Contents (18 chapters)
Zabbix Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Macros in templates


If you have a lot of servers then you probably want to have your templates a bit more dynamic. There are probably also some cases where a certain value in your template is not fit for just one server in your park. For this, we can make use of macros in our templates.

Getting ready

For this recipe to work, we need a Zabbix server and a Zabbix host. We also need to make sure that we have a SSH session active on port 22 on our host as we will monitor the SSH service on our host. For this, we will make use of macros. We also need to make use of the super administrator account in Zabbix.

How to do it ...

  1. First thing that we need to do is to go to Administration | general | Macros in our Zabbix menu. (Macros can be selected from the dropdown menu on the right).

  2. In the Macros menu, add a new macro {$SSH_PORT} and give it the value 422 or something other than 22. It must be a port that is not in use by SSH.

  3. Now go to Configuration | Template and create a new template with the name...