Nagios Core: The Original Check-Based Monitoring System
Nagios is old, its configuration is tedious, and the convention it established is still how most infrastructure monitoring works.
The contract it created
A check is any executable that exits 0 for OK, 1 for warning, 2 for critical, 3 for unknown, and prints a line of text, optionally with performance data after a pipe character.
That is it. Which is why there are thousands of Nagios plugins for every conceivable service, and why anything you can check from a shell script you can monitor in ten minutes. Our exit codes guide covers the convention, which now long outlives Nagios itself.
#!/usr/bin/env bash
count=$(find /var/spool/myqueue -type f | wc -l)
(( count > 1000 )) && { echo "CRITICAL - $count queued|queue=$count"; exit 2; }
echo "OK - $count queued|queue=$count"; exit 0
Why people move off it
The configuration. Hosts, services, commands, contacts, time periods and templates in object definitions, with no apply rules. On a few dozen hosts it is manageable; past that, people generate it with templating or leave.
Icinga 2 is the fork that fixed exactly this while keeping plugin compatibility, which makes it the usual migration target rather than a metrics system.
No real metrics storage. Performance data goes out to an addon rather than being a first-class feature, which is where Prometheus and Grafana do better.
Why it is still deployed
It works, it is extremely well understood, and an installation that has been running for a decade has accumulated institutional knowledge that is expensive to discard.
If you are choosing today, choose Icinga or Checkmk. If you have inherited Nagios and it is doing its job, “replace the monitoring” is rarely the highest-value project available.
Operational caution
The web interface is CGI-based and historically a source of vulnerabilities. Do not expose it to the internet, put it behind authentication, and keep it patched. Our reverse proxies guide and Authelia entry cover putting a login in front of software that has none worth trusting.
License
Nagios Core is released under the GNU General Public License v2.