Skip to content
Tutorials Center
My learning

Topics

Lesson 37 of 37 ยท Projects and Practice

Practice: Monitoring Scenarios and Interview Questions

Test what you learned about Zabbix and Nagios with scenario drills, calculation exercises, troubleshooting cases and common interview questions with worked answers.

This lesson is a workout. It collects exercises that mix the topics of the whole track: templates, discovery, dashboards, scaling, integrations and troubleshooting. Each exercise has a worked solution so you can compare your thinking. Neither product runs on this site, so the exercises use text, small calculations and Python stand-ins. Try each one on paper first, then check.

Part 1: Calculation drills

Use these quick calculations in interviews and design reviews.

A. A fleet has 800 hosts with 120 items each at 60 seconds. What is the NVPS, and how much storage do 14 days of history need at 90 bytes per value?

B. What downtime is allowed in a quarter (90 days) at 99.95 percent?

C. A proxy at a remote site monitors 20,000 items at 60 s. The link may fail for 6 hours. How many values must it buffer?

Python Check your answers (Python)

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.

Expected: A is 1,600 NVPS and about 174 GB; B is 64.8 minutes; C is 7,200,000 values.

Part 2: Scenarios

Scenario 1. Active agent never reports. A new Linux host has the agent installed, the host exists in the frontend with the template linked, and "Latest data" is empty. What do you check, in order?

Answer: (1) agent log for errors; (2) Hostname= equals the frontend host name exactly, including case; (3) ServerActive= points to the server or proxy; (4) the agent can reach port 10051 (firewall, proxy assignment); (5) the item types in the template are "Zabbix agent (active)" or the passive checks can be polled on 10050 from the server with zabbix_get. See proxies.

Scenario 2. Disk triggers on tmpfs. Discovery created triggers for /run, /dev/shm, /sys/fs/cgroup and they alert constantly. Fix it without editing hundreds of hosts.

Answer: edit the discovery rule in the template: add a filter {#FSTYPE} matches ^(ext4|xfs|btrfs|zfs)$. Existing entities become lost resources and are removed after the keep period; set the lost resource period to a few days if you want faster cleanup. See low-level discovery.

Scenario 3. A server is 100 percent busy and one team says monitoring is down. Pollers show 95 percent busy. What first?

Answer: look at the queue and at which targets are slow (SNMP timeouts, unreachable hosts). Move unreachable hosts to unreachable pollers, tune timeouts, raise StartPollers only after the slow targets are handled, and check the database sync processes. See architecture and sizing.

Scenario 4. Weekly deploy causes 40 alerts. What are the options?

Answer: a maintenance window for the hosts, created by the pipeline through the API before the deployment; trigger dependencies for downstream services; evaluation windows long enough to ignore the restart; and tag-based suppression.

Scenario 5. Nagios check shows OK but the service is down. What might be wrong?

Answer: it may be a passive service without freshness checking, a cached result from an nrpe check on a stuck daemon, or a plugin returning exit code 0 despite an error message. Verify with the plugin run by hand as the nagios user, and enable check_freshness. See Nagios distributed monitoring.

Part 3: Write the trigger

Write expressions for the following in Zabbix 6.0+ syntax (host web01).

  1. CPU utilization above 90 percent on average for 10 minutes.
  2. No data from the agent for 5 minutes.
  3. Free disk below 10 percent and expected full within a day.
  4. Three or more failed logins in 5 minutes (item log[/var/log/auth.log,"Failed password"]).

Check your answers against the model solutions below by running the evaluator, which implements only avg, last, min, max, count and nodata on sample data.

Python Mini trigger evaluator (Python stand-in)

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.

Model answers: (1) avg(/web01/system.cpu.util,10m)>90; (2) nodata(/web01/agent.ping,5m)=1; (3) last(/web01/vfs.fs.size[/,pfree])<10 and timeleft(/web01/vfs.fs.size[/,pused],1h,100)<1d; (4) count(/web01/log[/var/log/auth.log,"Failed password"],5m)>=3.

Part 4: Interview-style questions

  1. What is the difference between a trigger and an action? A trigger evaluates item data and produces problem events; an action reacts to events (notifications, scripts, escalations).
  2. Why prefer active agent checks at scale? The agents distribute the work, buffering protects data when the server is down, and NAT or firewall rules need only outbound connections.
  3. What are trends and why do they matter? Hourly min, avg, max and count per numeric item; they keep long-range graphs possible after raw history is deleted.
  4. How do you handle a metric that must differ for one host only? Host-level macro (with context) overrides the template value.
  5. What is the difference between LLD and network discovery? LLD finds parts of a host (filesystems, interfaces); network discovery finds hosts in an IP range.
  6. How does Nagios differ from Zabbix architecturally? Nagios is a check scheduler using plugin exit codes with no built-in history or discovery; Zabbix is a data-collection platform with database, triggers, discovery and proxies.
  7. How do you secure agent traffic? TLS with PSK or certificates, exact Server= lists, DenyKey=system.run[*], restricted user parameters.
  8. A trigger flaps. What do you do? Lengthen the window, add a recovery expression with hysteresis, or use min()/max(); also check whether the underlying item is noisy.
  9. How would you safely automate onboarding? The API with a dedicated token and role, idempotent scripts, host group and template lookups, staging tests, and configuration.export in Git. See the API lesson.
  10. What is the first thing you check after upgrading the server? The server log for schema upgrade messages, then that proxies and agents report, the queue is small and the frontend loads.

Part 5: Self-assessment checklist

Tick each statement only if you can explain it to a colleague:

  • I can design a template tree and say where macros and tags belong.
  • I can write an LLD rule with filters, prototypes and overrides.
  • I can build a dashboard for one audience and explain its widgets.
  • I can estimate NVPS, storage and proxy buffers.
  • I can describe the API call to create a host and acknowledge an event.
  • I can reduce a noisy alert source with a measured change.
  • I know how Nagios inherits, scales and notifies, and where it differs from Zabbix.

If several boxes stay empty, return to the matching lesson: templates, dashboards, SLA reports, database tuning, security, troubleshooting.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. 1,600 NVPS and 14 days of history at 90 bytes per value need roughly how much storage?

    1,600 x 86,400 x 14 x 90 bytes is about 174 GB.
  2. 2. Which expression detects a silent agent?

    nodata() reports when no values arrive within the period.
  3. 3. Which feature finds new hosts in an IP range?

    Network discovery scans ranges; actions then add hosts and link templates.
  4. 4. Which approach best prevents flapping?

    Windows and hysteresis stabilize state changes.

Summary

  • Practice calculations (NVPS, storage, error budget, buffers) until they are quick.
  • Work through scenarios by following the data path and the architecture.
  • Write triggers with windows, recovery expressions and nodata() for silence.
  • Use the checklist to find gaps and revisit the relevant lessons.

Next: Zabbix and Nagios Monitoring