Skip to content
Dexor Discuss your project
Menu

Icinga 2 explained: plugins, commands and services

· Updated

A technical workstation with connected systems and monitoring views.

A plugin performs a check. A CheckCommand describes how to call it. A Service defines what is monitored for a host. Service templates let you reuse common settings. Keeping these responsibilities separate makes Icinga configuration easier to understand and troubleshooting more focused.

Plugin: the executable check

A monitoring plugin is a script or program. It can inspect an HTTP response, a computer’s load or a database state. Icinga runs the plugin and processes its result. The plugin must be available on the computer that executes the check; that is not necessarily the monitored host.

CheckCommand: define the invocation

A CheckCommand describes the executable path and plugin arguments. It maps variables to the required options and can define defaults, conditions and argument order. The same invocation can then serve several checks without rebuilding the command line for each one.

Service template: reuse settings

A service template groups common service settings, such as the CheckCommand, check intervals and custom variables. Concrete services can import the template and override appropriate values. Argument definitions belong to the CheckCommand; the template supplies settings and variable values for a particular kind of check.

Service: a concrete monitoring task

A service belongs to a host and describes a concrete check, such as testing an application over HTTP. It can import a template, select a CheckCommand and set check-specific values. A template is a reuse mechanism, not a prerequisite for every Service object.

An apply rule creates services for hosts that match its conditions. Icinga Director also provides service sets for organising and assigning several service definitions together. A service set is a Director concept; deployment generates the corresponding Icinga configuration.

Execution: distinguish host association from the endpoint

Host association identifies the monitored system to which a service belongs. Zones, participating endpoints and, where configured, command_endpoint determine its execution context. A central checker can test a remote HTTP service; an agent can collect local values from its computer. The plugin, permissions and dependencies must be present at the actual execution point.

Trace the layers through an HTTP check

For troubleshooting, follow this chain in reverse. Which service is affected? Which values apply after inheritance? How does the CheckCommand turn them into arguments? Can the plugin run successfully at the selected execution point with the available permissions?

Learn more and apply it

The official references cover CheckCommands, Service attributes, distributed monitoring and service configuration in Director.

Practise these relationships in a prepared environment during Icinga for Beginners. For an existing installation, explore our Icinga consulting and monitoring reviews.