The Icinga Director configuration tool makes it easy to define monitoring objects through the web UI and deploy them to the Icinga 2 API.
In this blog post, I’ll walk you through how to configure services in Icinga Director. If you haven’t used Icinga Director yet, take a look at our introduction. I assume that most of you are already familiar with Icinga 2 and have used the DSL to define objects. Hence, you might already know that services can be configured directly for a host or applied using apply rules.
I’ve set up the below sample host templates and hosts in Icinga Director and am now ready to configure the related services.
- Host template list
- Host list
In the next sections covers several ways to configure services in Icinga Director, either as standalone services or as service sets.
Standalone services
In this section, we’ll look at the standard methods of configuring services in Icinga Director. These include creating a standalone service and assigning it either directly to a specific host or automatically to multiple hosts using apply rules.
Configuring a service directly for a specific host
To configure any service object you first need a service template:
- Navigate to
Services
->Service Templates
, and click onAdd
button to configure the service template.
- Fill in the required fields and click
Add
. Here, I have configured the below generic service template shown in the screenshot. It will be used everywhere in this blog post.
- Now, navigate to
Services
->Single Services
and click onAdd
button to configure the service.
- For demonstration purpose, I will configure a mysql service on hostexample-host-mysql as shown below. Once this service is deployed, it will run a mysql check command to see the status of MySQL database connection. Note, you might need to configure the custom variables for port, user, password etc to pass on as arguments to the check command.
- Adding new service
- Stored service
- Go to the
Preview
tab to see the deployed configuration to the Icinga 2 API.
Configuring an apply rule to assign a service to each hosts based on filter
It is always recommended to configure services for hosts using apply rules. This will assign the services to the hosts matching the configured assign filter.
To configure an apply rule:
- Navigate to
Services
->Service Apply Rules
and click onAdd
button.
- For illustration, I have configured a ping apply rule that assigns the service to hosts in dev environment as shown in the screenshot. That is, hosts with custom variable env and set to ‘dev’. This will ping the corresponding hosts to check their reachability.
- Adding apply rule
- Stored apply rule for ping service
- To verify you could navigate to the host in Icinga Director, example-host-01 where the service will be applied and check its
Services
tab.
- Affected Host
- Its Services
- The below screenshot shows the deployed configuration to the Icinga 2 API.
Configuring an apply for rule to assign a service to each interface of the hosts based on filter
As the Icinga 2 users already know, this is an extension of apply rule. But, with apply for rule, we could assign a service to each interface of the hosts and the interfaces are defined in the hosts using custom variables. The steps to configure it in Icinga Director is similar to apply rule configuration, but you also supply the name of the interfaces in the form of an array.
As an example, I have configured an apply rule for disk partitions as shown in the screenshots below. The rule will be creating service checks on different partitions of the hosts, matching the assign filter. This will check the status of the different disk partitions of the corresponding hosts, when deployed to Icinga 2 API.
- Adding new apply for rule
- Apply for rule for disk partitions
- Apply for rule deployed configuration
- Host with disk partitions
- Its applied rules
Service sets
In addition to the standard methods of configuring service checks, Icinga Director offers a powerful and flexible way to manage services through service sets. These allow you to group related services — such as CPU, memory and other application specific checks — into logical bundles. Once defined, these service sets can be directly assigned to a host for targeted monitoring or automatically applied to multiple hosts using apply rules.
This not only streamlines configuration but also ensures consistency across your infrastructure. For example, you can create a service set for all Linux web servers and let Icinga Director take care of assigning the appropriate checks whenever a new host matches the defined criteria. It’s an efficient, scalable approach that makes service management both smarter and faster.
Configuring a set of services and directly adding them manually to a host
- Navigate to
Services
->Service Sets
and click onAdd
button.
- For illustration, I have configured mysql-services as shown in the screenshot.
- Now to configure the service to be grouped under this service set. Go to
Services
tab of the service set and click onAdd Service
.
- Services tab of a service set
- Add service page for a service set
- Choose the service template, and fill in the necessary fields and click
Add
. In this way, I have configured mysql_health and mysql_query services in this service set.
- mysql_health service
- mysql_query service
- Services in mysql-services service set
- After this, I navigate to
Hosts
-> example-host-mysql->Services
tab. Here, you could add service set directly into the host by clickingAdd service set
. Choose the service set and click on add.
- Adding service set to the host
- Services attached to the host
- The below screenshot shows the deployed configuration to the Icinga 2 API, rendered in the
Preview
tab for the service set mysql-services (If the service set was not added to any of the hosts, then this page would be empty).
Configuring a set of services and applying them to hosts based on an apply rule
The process of setting up a service set is similar to what was outlined earlier. Services can then be applied to hosts using a rule. Additionally, you also need to define the assign filter for the service set.
I have configured the service set system-resource-checks-for-dev-servers, with services cpu and memory to check the usage of system resources of hosts in the dev environment as shown in the below screenshots.
- Service set with apply rule
- Services of the service set
- Service set attached to the host based on apply rule
The below screenshot shows the deployed configuration to the Icinga 2 API, rendered in the Preview tab for the service set system-resource-checks-for-dev-servers.
Conclusion
With this understanding, you’re now equipped to configure services in Icinga Director tailored to your specific monitoring needs. Keep in mind that, I have not covered everything related to service configuration, but just what is essential. Also, currently the apply for rules is not supported for dictionaries like in Icinga DSL. We are currently working on this and plan to add this feature to Icinga Director in the future.