Skip to content
Tutorials Center
My learning

Topics

Lesson 1 of 37 ยท Getting Started

What Is Infrastructure Monitoring? Zabbix and Nagios Compared

Learn what infrastructure monitoring is, what problems it solves, and how Zabbix and Nagios differ in design, configuration style, data storage and typical use cases.

Servers, switches, databases and applications fail. Monitoring is the practice of measuring their state continuously so that you learn about a failure from a dashboard or a message, not from an angry customer. A monitoring system collects data, stores it, compares it with rules, and tells people when something needs attention.

This track teaches two of the most widely deployed open-source monitoring tools: Zabbix and Nagios. Both can watch servers, network devices, services and applications. They solve the same problem with different philosophies, and knowing both makes you useful in almost any operations team.

Neither product can run on this site. Zabbix needs a server process and a database, and Nagios needs a daemon plus plugins. So the lessons describe menus, commands and configuration files precisely, and the TryIt blocks are small Python stand-ins that model the same ideas (thresholds, polling, availability math). They are labelled as stand-ins every time; they are not the real products.

What monitoring gives you

  • Detection: you find out that a disk is 95% full before the database stops.
  • Diagnosis: history shows when CPU load started rising and what else changed.
  • Capacity planning: trends show that storage grows 3 GB per week, so you can order disks in time.
  • Reporting: availability numbers for a service level agreement (SLA).
  • Automation: an alert can run a script that restarts a stuck service.

Two families of checks

Almost every monitoring tool uses a mix of two ideas:

  1. Checks that ask "is it working?" Is the web server answering on port 443? Does the ping come back? These produce a state: OK or not OK. Nagios was built around this idea.
  2. Metrics that record "how much?" CPU utilization, free disk bytes, requests per second, temperature. These produce numbers over time, which you graph and compare against thresholds. Zabbix was built around this idea.

In practice the two overlap. A metric plus a threshold becomes a state, and a state check can also return a performance number.

Nagios in one page

Nagios Core appeared in 1999 (originally called NetSaint). Its model is simple and has influenced many later tools:

  • You describe hosts and services in text configuration files.
  • Nagios runs small programs called plugins on a schedule. A plugin prints one line and exits with code 0 (OK), 1 (WARNING), 2 (CRITICAL) or 3 (UNKNOWN).
  • Nagios keeps the current state of every host and service, sends notifications when the state changes, and shows a status web page.
  • Graphing and long-term history are not built in; add-ons such as PNP4Nagios or Graphite provide them.

Strengths: tiny, fast, transparent, huge plugin ecosystem, easy to extend with any script. Weaknesses: configuration by hand (or with generators), no native metric history, and a classic web interface. Nagios XI is the commercial product built on the core. Several forks exist, such as Icinga, that keep compatible plugins.

Zabbix in one page

Zabbix (started in 2001 by Alexei Vladishev, now maintained by Zabbix LLC) is an all-in-one platform:

  • A server collects data, evaluates triggers and sends alerts.
  • A database (MySQL/MariaDB, PostgreSQL, TimescaleDB, Oracle in older versions) stores configuration and history.
  • A web frontend is where you configure everything: hosts, items, triggers, dashboards, users.
  • Agents on monitored machines answer questions or push data. Proxies collect data for remote sites.
  • Built-in graphs, maps, dashboards, reports, discovery, templates and an API.

Strengths: everything in one product, configuration through a web UI and API, powerful templates, auto-discovery, history and trends, scalability through proxies. Weaknesses: more moving parts, a database to maintain, and a learning curve for the data model (hosts, items, triggers, templates).

Side by side

Topic Nagios Core Zabbix
Configuration Text files, reloaded by the daemon Web UI and API, stored in the database
Data model Hosts, services, states Hosts, items (metrics), triggers (problems)
Metric history Not built in (perfdata add-ons) Built in (history and trends)
Checks Plugins run by the server or by NRPE Agent, SNMP, IPMI, HTTP, scripts, JMX and more
Graphs and dashboards Via add-ons Built in
Remote sites Distributed with NSCA or Mod-Gearman Zabbix proxies
License GPL (Core) AGPLv3 (since 7.0; GPL before)

You do not have to choose one forever. Many companies run Nagios for a handful of critical service checks and Zabbix for metrics, or migrate from one to the other.

The model both tools share

flowchart LR
    T["Target<br/>server, router, app"] -->|"check or metric"| C["Collector<br/>Zabbix server / Nagios core"]
    C --> S[("Storage<br/>history / state")]
    C --> R{"Rule<br/>threshold or state change"}
    R -->|"problem"| N["Notification<br/>email, chat, ticket"]
    S --> D["Dashboards and reports"]

Every monitoring tool has the same loop: collect, store, evaluate, notify.

A first stand-in: from metric to state

The tiny function below turns a numeric metric into a Nagios-style state with warning and critical thresholds. It is a stand-in that shows how a "how much?" number becomes an "is it OK?" answer.

Python Stand-in: metric to state

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Nagios plugins really do end with those exit codes. Zabbix uses a different mechanism (triggers with severities), which you will meet in trigger expressions.

Polling cost

Every check costs a little CPU and network. If you monitor 500 hosts with 100 metrics each every minute, that is 50,000 values per minute, about 833 per second. The stand-in below does that arithmetic so you can size a system before you build it.

Python Stand-in: values per second

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Zabbix reports exactly this number as NVPS (new values per second) on its dashboard, and it is the main figure for sizing. You will use it again in the scaling chapter.

How this track is organized

Chapter 1 gets a Zabbix server running in theory and in commands. Chapter 2 covers concepts shared by both tools. Chapters 3 and 4 teach hosts, items, triggers and alerts. Later chapters cover templates, dashboards, proxies, integrations and projects.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does a Nagios plugin return to report the state of a check?

    Plugins print one line and exit with 0 OK, 1 WARNING, 2 CRITICAL or 3 UNKNOWN.
  2. 2. Which tool stores metric history and draws graphs out of the box?

    Zabbix includes history, trends, graphs and dashboards. Nagios Core needs add-ons for graphs.
  3. 3. Where is Zabbix configuration stored?

    Zabbix keeps hosts, items, triggers and templates in its database.
  4. 4. What does NVPS measure?

    NVPS is the rate of new collected values and drives sizing.

Summary

  • Monitoring means collect, store, evaluate, notify.
  • Nagios is state-oriented: plugins return OK, WARNING, CRITICAL or UNKNOWN.
  • Zabbix is metric-oriented: items collect values, triggers detect problems.
  • Zabbix is an all-in-one platform with a database and web UI; Nagios Core is small and configured with text files.
  • NVPS (hosts x items / interval) is the key sizing number.

Next: Zabbix architecture