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 ...
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).
In the Macros menu, add a new macro
{$SSH_PORT}
and give it the value422
or something other than22
. It must be a port that is not in use by SSH.Now go to Configuration | Template and create a new template with the name...