[comment]: # ({075e5bc4-f9e8f670})
# 3 Setup example

[comment]: # ({/075e5bc4-f9e8f670})

[comment]: # ({d579427a-b5ff62ed})
### Overview

This section describes a simple setup for monitoring Zabbix high availability cluster as a service.

[comment]: # ({/d579427a-b5ff62ed})

[comment]: # ({b61625a5-f20e4c07})

### Pre-requisites

Prior to configuring service monitoring, you need to have the hosts configured:

- *HA node 1* with at least one trigger and a tag (preferably set on a trigger level) `component:ha-node-1`
- *HA node 2* with at least one trigger and a tag (preferably set on a trigger level) `component:ha-node-2`

[comment]: # ({/b61625a5-f20e4c07})

[comment]: # ({956692ef-42383a61})

### Service tree

The next step is to build the service tree. In this example, the infrastructure is very basic and consists of three services: *Zabbix cluster* (parent) and two child services *Zabbix server node 1* and *Zabbix server node 2*.  

    Zabbix cluster
    |
    |- Zabbix server node 1
    |- Zabbix server node 2

At the Services page, turn on *Edit* mode and click *Create service*:

![](../../../assets/en/manual/config/service_mode.png){class="nozoom"}

In the service configuration window, enter name *Zabbix cluster* and click the *Advanced configuration* header to display advanced configuration options. 

![](../../../assets/en/manual/config/service_cluster.png){width=600}

Configure additional rule:

![](../../../assets/en/manual/config/service_add_rule.png){width=600}

Zabbix cluster will have two child services - one for each of the HA nodes. If both HA nodes have problems of at least *Warning* status,  parent service status should be set to *Disaster*. To achieve this, additional rule should be configured as:

- Set status to: Disaster
- Condition: If at least `N` child services have `Status` status or above
- N: 2
- Status: Warning

Switch to the *Tags* tab and add a tag `application:zabbix-server`. This tag will be used later for service actions and SLA reports.

![](../../../assets/en/manual/config/service_cluster1.png)

Save the new service. 

[comment]: # ({/956692ef-42383a61})

[comment]: # ({2f393d2a-f84e7def})

To add a child service, click the plus icon next to the Zabbix cluster service (the icon is visible only in *Edit* mode).

![](../../../assets/en/manual/config/service_cluster2.png){width=600}

In the service configuration window, enter name *Zabbix server node 1*. Note that the Parent services parameter is already pre-filled with *Zabbix cluster*. 

Availability of this service is affected by problems on the host *HA node 1*, marked with `component:ha-node-1` problem tag. In the Problem tags parameter, enter:

- Name: component
- Operation: Equals
- Value: ha-node-1

![](../../../assets/en/manual/config/service_cluster3.png){width=600}

Switch to the *Tags* tab and add a service tag: `zabbix-server:node-1`. This tag will be used later for service actions and SLA reports.

![](../../../assets/en/manual/config/service_cluster4.png)

Save the new service. 

[comment]: # ({/2f393d2a-f84e7def})

[comment]: # ({3029dcd0-01208bc4})

Create another child service of Zabbix cluster with name "Zabbix server node 2". 

Set the Problem tags as: 

- Name: component
- Operation: Equals
- Value: ha-node-2

Switch to the *Tags* tab and add a service tag: `zabbix-server:node-2`.

Save the new service. 

[comment]: # ({/3029dcd0-01208bc4})

[comment]: # ({9b8fe575-ad48636f})

### SLA

In this example, expected Zabbix cluster performance is 100% excluding semi-annual one hour maintenance period.   

First, you need to add a new service level agreement. 

Go to the *Services->SLA* menu section and click *Create SLA*. Enter name *Zabbix cluster performance* and set the SLO to 100%. 

The service Zabbix cluster has a service tag `application:zabbix-server`. To use this SLA for measuring performance of Zabbix cluster, in the *Service tags* parameter, specify:

- Name: application
- Operation: Equals
- Value: zabbix-server

![](../../../assets/en/manual/config/service_sla.png){width=600}

In a real-life setup, you can also update desired reporting period, time zone and start date or change the schedule from 24/7 to custom. For this example, the default settings are sufficient. 

Switch to the *Excluded downtimes* tab and add downtimes for scheduled maintenance periods to exclude these periods from SLA calculation. In the *Excluded downtimes* section, click *Add link*, enter the downtime name, planned start time, and duration.

![](../../../assets/en/manual/config/service_sla1.png){width=600}

Click *Add* to save the new SLA.

Switch to the SLA reports section to view the SLA report for Zabbix cluster.  

![](../../../assets/en/manual/config/service_sla2.png){width=600}

The SLA info can also be checked in the *Services* section. 

![](../../../assets/en/manual/config/service_sla3.png){width=600}

[comment]: # ({/9b8fe575-ad48636f})
