Service Templates

Introduction

Setting up new hosts and services can be very time-consuming, but this work can be simplified in many ways using service templates. Templates make it possible to add, change or remove new services or service parameters for a large number of hosts without having to edit each host individually. Even when new hosts are registered automatically, they can be assigned directly to the corresponding templates.

Templates work in a similar way to a host. After the template has been created, any number of services can be set up. The parameters in the service form can be filled with variables and default values. Services and parameters are then inherited by hosts that are assigned to the template. Variables that were defined in the template can be overwritten when setting up a host.

Case study: You have 10 servers with MySQL installed. Now you could set up a MySQL check for each server. If you were to perform this action for a variety of services and several more servers, the time required would be quite high. With templates, you could reduce the time required to a minimum.

Predefined templates

After installing the Bloonix WebGUI, you have the option of importing a number of predefined templates. You can change, delete or extend these as you wish. To import, you simply need to run the script bloonix-import-default-templates. The script requires the URL to the WebGUI as a parameter:

bloonix-import-default-templates \
    --url https://webgui-domain/

Predefined variables

There are five predefined variables that can be used when setting up services in templates and also in hosts:

  • HOSTNAME
  • IPADDR1
  • IPADDR2
  • IPADDR3
  • IPADDR4

These variables cannot be overwritten and always contain the values of the host.

Setting up templates

You can set up templates via the left navigation. If the script bloonix-import-default-templates has been executed, various templates are already preconfigured there.

Let’s take a look at the template Linux Generic, which is already preconfigured with various variables:

The name of the variable indicates which service checks and status levels they are used for. If you look at the CPU monitoring service, you can find the variables and how they are used:


When using variables, as already mentioned, it is important to note that if the values are changed, they are passed on directly to all hosts that are assigned to the template. If you only want to change the values for individual hosts, you can overwrite the variables in the form of each individual host.