Icinga 2: Monitoring With a Configuration Language

Icinga 2: Monitoring With a Configuration Language

Icinga 2 is what happened when people who liked Nagios decided its configuration had to go.

Check-based monitoring, still

The model is a plugin that exits 0, 1, 2 or 3 for OK, warning, critical or unknown. That is the Nagios contract, and Icinga keeps it, which means the entire library of Nagios plugins works unchanged.

That compatibility is the main reason to choose Icinga over a metrics-first system: if what you need to monitor already has a check plugin, you are done. Our exit codes guide covers the convention, and writing a check is genuinely a ten-line shell script.

The configuration language

Icinga’s DSL supports apply rules, so you describe intent rather than enumerate hosts.

apply Service "http" {
  check_command = "http"
  assign where host.vars.http_vhosts
}

Add a host with that variable and the service appears. On a few hundred hosts that difference against hand-written Nagios config is the whole point.

Distributed by design

Icinga 2 runs as a cluster of masters, satellites and agents, with checks executed close to what they are checking and results forwarded up. That suits multiple sites or networks you cannot reach directly.

Where it sits against the alternatives

Icinga or Checkmk if you want status-and-alerting with plugin breadth. Prometheus and Grafana if you want time-series metrics and graphs. Uptime Kuma if you want something far simpler for a handful of endpoints.

The honest framing: check-based monitoring answers “is it broken”, metrics answer “what is it doing”. Most mature setups run both, and our monitoring guide covers the metrics side.

Operational caution

Icinga needs a database for its state and IDO or Icinga DB for the web interface, so there are several moving parts. Our MariaDB guide covers the backend.

Alert fatigue is the real failure mode. A check that flaps and pages nightly gets ignored, and then so does everything else.

License

Icinga 2 is released under the GNU General Public License v2.