Scenario-Based Nagios Interview Questions (2027)

36 scenario-based Nagios interview questions: alert storms, flapping, stale passive checks, NRPE errors, dependencies and large-site design.

Sep 16, 2025 - 16:46
Nov 5, 2026 - 18:18
 0  60
Scenario-Based Nagios Interview Questions (2027)

Scenario-based Nagios interview questions give you a monitoring problem, such as an alert storm, a silent outage, a flapping service or a stale passive check, and ask how you would find the cause and fix the configuration. This guide answers 36 of them against the Nagios Core 4 documentation, from first checks to large-site design.

Nagios is still common in data centres and regulated environments, often alongside newer tools. If you are comparing approaches, our pillar on observability tools for DevOps and the post on observability vs traditional monitoring give context. This page stays on Nagios Core itself: objects, checks, states, notifications and the files behind them.

Key takeaways

  • Nagios Core 4 is the current major line; the NagiosEnterprises GitHub releases page listed nagios-4.5.14 as the latest release when checked.
  • Always validate config with nagios -v /usr/local/nagios/etc/nagios.cfg (path varies by install) before restarting.
  • Use the parents directive so a router failure shows hosts behind it as UNREACHABLE instead of DOWN.
  • Flap detection looks at the last 21 checks and compares a weighted percent state change with low and high thresholds.
  • Passive results arrive through the external command file as PROCESS_SERVICE_CHECK_RESULT.
  • Service dependencies suppress checks or notifications for a dependent service when its master is failing.

Symptom to cause: a quick map

SymptomLikely causeDirective or tool
100 alerts when one switch diesNo parent relationshipsparents in host definitions
Same service alerts and recovers all dayFlappingflap_detection_enabled, thresholds
Passive service stuck OK while the job stoppedNo freshness checkingcheck_freshness, freshness_threshold
App alerts while the database is downNo dependencyservicedependency object
Restart fails after a changeConfig errornagios -v
"CHECK_NRPE: Error" on remote checksAgent, firewall or allowed hostsnrpe.cfg, check_nrpe

Freshers: core concepts through small scenarios

1. You add a new host and Nagios will not restart. What do you do?

Run the pre-flight check: nagios -v /usr/local/nagios/etc/nagios.cfg (or the path your package uses). It reads every object file and reports the exact error and line, such as a missing check_command or an undefined contact group. Fix it, run the check again, then reload.

2. What states can hosts and services have?

Hosts are UP, DOWN or UNREACHABLE. Services are OK, WARNING, CRITICAL or UNKNOWN. Plugins report service state with exit codes 0, 1, 2 and 3. UNREACHABLE means Nagios cannot reach the host because a parent on the path is down.

3. What is the difference between a soft and a hard state?

When a check fails, the state is soft until it has failed max_check_attempts times, with retries at retry_interval. Only then does it become hard and send notifications. This avoids alerting on a single dropped packet.

4. A plugin works on the command line but shows UNKNOWN in Nagios. Why?

Nagios runs it as the nagios user with a different environment. Typical causes are file permissions, a relative path, a missing environment variable or a wrong macro in the command definition. Test with sudo -u nagios /usr/local/nagios/libexec/check_x ... using the exact arguments.

5. What is a plugin, and what must it return?

A plugin is any executable that checks something, prints one line of status text (optionally with performance data after a pipe) and exits with 0, 1, 2 or 3. Nagios does not care what language it is written in.

6. How do you check a remote Linux disk?

Run a local plugin on the remote host through an agent such as NRPE. Define the command in nrpe.cfg on the host, for example command[check_root]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /, then call it from Nagios with check_nrpe -H host -c check_root.

7. "CHECK_NRPE: Error - Could not connect" appears. What is your checklist?

Confirm the NRPE service runs on the target, the firewall allows the NRPE port (default TCP 5666) from the Nagios server, the Nagios server IP is in allowed_hosts, and SSL settings match on both sides. Test from the Nagios server with check_nrpe -H host, which should return the NRPE version.

8. What are templates and why use them?

Templates are object definitions with register 0 that other objects inherit with use. Put check intervals, notification periods and contacts in a template once, then each host definition only needs its name, address and template.

9. How do you stop alerts during planned maintenance?

Schedule downtime for the host and its services from the web UI or by sending an external command. Notifications are suppressed for that window, and reports show the time as scheduled downtime instead of an outage.

10. What is the difference between acknowledging and scheduling downtime?

Acknowledging says "we know about this problem" and stops repeat notifications until the state changes. Downtime is planned ahead and suppresses notifications for a time window. Use acknowledgement for unplanned incidents you are already working on.

2 to 5 years: troubleshooting scenarios

11. A core switch fails and on-call gets 120 emails. How do you fix the design?

Define the network path with the parents directive on each host. When the switch goes DOWN, Nagios marks hosts behind it UNREACHABLE, and you can leave u out of their notification_options so only the switch alerts.

define host {
    use        linux-server
    host_name  web01
    address    10.0.2.11
    parents    core-sw01
}

12. The application service alerts every time the database is down. How do you stop the duplicate?

Create a service dependency so the app check depends on the database check:

define servicedependency {
    host_name                      db01
    service_description            PostgreSQL
    dependent_host_name            app01
    dependent_service_description  App Health
    execution_failure_criteria     c,u
    notification_failure_criteria  w,c,u
}

execution_failure_criteria stops active checks of the dependent service while the master is in those states, and notification_failure_criteria stops its notifications.

13. A service alerts and recovers 15 times an hour. What do you do?

Enable flap detection (enable_flap_detection=1 globally and flap_detection_enabled 1 on the object). Nagios looks at the last 21 results, computes a weighted percent state change, and marks the service flapping when it reaches high_flap_threshold. Notifications pause while it flaps. Then fix the real cause, often a threshold too close to normal values or a timeout too short.

14. How are flap thresholds set per service?

Use low_flap_threshold and high_flap_threshold in the host or service definition to override the global low_service_flap_threshold and high_service_flap_threshold. The object starts flapping at or above the high value and stops below the low value.

15. A nightly backup job reports through passive checks. How does it send results?

It writes a line to the external command file:

[1762500000] PROCESS_SERVICE_CHECK_RESULT;backup01;Nightly Backup;0;OK - 412 GB copied

The service must exist in the config, accept_passive_service_checks=1 must be set, and the service needs passive_checks_enabled 1. Remote hosts usually send results through an add-on such as NSCA or NRDP rather than writing to the file directly.

16. The backup job died and the passive service still shows OK. Why?

Passive services only change when a result arrives. Turn on freshness checking with check_freshness 1 and a freshness_threshold a little longer than the job interval, and set a check_command that returns CRITICAL with a "no result received" message. Then a missing result becomes an alert.

17. Alerts arrive, but nobody on the night shift gets them. What do you check?

Check the contact's host_notification_period and service_notification_period, the service's notification_period, the contact's notification_options, and whether the contact group is attached to the service. Then check the notification command itself by running it as the nagios user and reading the mail or chat tool logs.

18. How do you send escalations to a manager if a problem lasts an hour?

Define a serviceescalation with first_notification, last_notification and a manager contact group. With a 10-minute notification_interval, a first notification of 7 reaches the manager after about an hour of the problem staying unacknowledged.

19. Checks are running late and the latency graph keeps growing. What do you look at?

Look for slow plugins that hit their timeout, too many checks with short intervals, and CPU or I/O limits on the Nagios server. Raise intervals for low-value checks, fix or replace slow plugins, and spread load with distributed or worker-based setups if the server itself is saturated.

20. How do you graph performance data from checks?

Plugins print performance data after a |, for example load1=0.42;5;10. Enable process_performance_data and send the data to a graphing add-on or a time-series database. Graphs make thresholds easier to set because you can see normal ranges.

21. Two admins edit configs and break each other's changes. How do you organise this?

Keep the Nagios config in Git, split object files by team or function under cfg_dir, and run nagios -v in a CI job before deploying. Generate repetitive host files from an inventory with Ansible or a script instead of editing hundreds of files by hand.

22. A plugin returns WARNING when disk is at 79% and the threshold is 80%. Why?

Check the plugin's threshold syntax. Many standard plugins take thresholds as free space or as ranges, so -w 20% on check_disk means warn when free space drops below 20%. Run the plugin with -h to read how it interprets the values.

23. How do you monitor a web application properly, not just ping the server?

Use check_http (or its newer replacement in your plugin package) to request a real URL, check the status code and look for a string on the page, with a response-time threshold. Add a certificate expiry check on HTTPS endpoints so expiry becomes a warning weeks ahead.

24. How do you stop a reload from losing acknowledgements and comments?

Keep state retention on: retain_state_information=1 with a state_retention_file. Nagios saves states, acknowledgements, comments and downtime on shutdown and restores them on start.

Senior: design and scale scenarios

25. You must monitor 5,000 hosts across three data centres. How do you design it?

Run a Nagios instance or worker set close to each site so checks do not cross WAN links, and send results to a central view. Use templates and generated configs, keep check intervals realistic, and treat the monitoring servers themselves as monitored services with their own alerts.

26. Leadership asks whether to keep Nagios or move to Prometheus. How do you answer?

Map needs first. Nagios is strong for state-based host and service checks with escalations and is easy to audit. Prometheus suits high-cardinality metrics, Kubernetes service discovery and PromQL alerting. Many teams run both during a move. Our Prometheus interview guide covers the other side.

27. How do you monitor Kubernetes workloads with Nagios?

Check what users see: ingress endpoints with HTTP checks, and cluster health through the API server health endpoints. For pod-level metrics, a metrics system is a better fit; Nagios can then alert on summary checks that query it.

28. How would you reduce alert fatigue across the whole team?

Review a month of notifications. Remove checks nobody acts on, add parents and dependencies, use flap detection, raise max_check_attempts on noisy checks, and route warnings to a ticket queue instead of a pager. Every page should require action.

29. How do you secure the Nagios server and agents?

Restrict the web UI with HTTPS and authentication, limit who can send external commands, restrict NRPE with allowed_hosts and a firewall, and keep dont_blame_nrpe=0 so remote callers cannot pass arbitrary arguments. Patch Nagios and plugins regularly.

30. Audit asks for monthly availability of a payment service. How do you produce it?

Use the availability reports in the web UI for the host and service, with scheduled downtime excluded. Make sure state retention and logs cover the whole period, because gaps make the report wrong.

31. How do you know Nagios itself is healthy?

Monitor the Nagios process, check latency and execution time, and use an external heartbeat: a check from a second system that alerts if the main server stops sending results. A monitoring server that fails silently is worse than none.

Scenario round: talk through the incident

32. "All services on one host went UNKNOWN at once." What happened?

The checks probably share a transport that failed, usually the NRPE agent or its firewall rule, not the services themselves. Make the host check or an NRPE check a master in a dependency so the team gets one clear alert.

33. "Users report the site is down but Nagios shows green." What do you check?

Your checks may test the wrong thing, such as a ping or a port open on the server, while the app returns errors. Add a content check on the real user URL from outside the network, and compare check interval with outage length.

34. "After a config deploy, half the services vanished." How do you recover?

Roll back the Git commit, run nagios -v and reload. Then find why the pre-flight passed: often a cfg_dir path changed or a hostgroup membership was removed, which is valid config with missing objects. Add a CI step that compares object counts before and after.

35. "An escalation woke the director for a test server." What went wrong?

The escalation was probably attached through a broad hostgroup or a wildcard. Scope escalations to production hostgroups and add a template variable or hostgroup for environment so test hosts inherit a quieter policy.

36. "We need SNMP traps from network gear in Nagios."

Receive traps with snmptrapd, translate them with a tool such as SNMPTT, and submit them as passive results to a matching service. Set freshness or auto-reset logic so a trap service returns to OK after the problem clears.

Where to go next

For a short revision list, see Nagios FAQs asked in DevOps interviews, and for planning, Nagios interview preparation questions. The guide on monitoring alerts every DevOps team should configure helps when you are asked what to monitor in the first place.

Nagios work is mostly Linux administration. Our Linux admin training and DevOps training run in Kharadi, Pune and live online.

FAQ

What is the latest version of Nagios Core?

Nagios Core 4 is the current major line. Check the NagiosEnterprises GitHub releases page for the latest point release; it listed 4.5.14 when we checked.

How do I validate Nagios configuration?

Run nagios -v with the path to nagios.cfg. It lists errors and warnings before you restart.

What does UNREACHABLE mean in Nagios?

Nagios cannot reach the host because a parent host on the path is down. Parents are set with the parents directive.

How does Nagios detect flapping?

It checks the last 21 results, computes a weighted percent state change, and compares it with the low and high flap thresholds.

How do passive checks reach Nagios?

As a PROCESS_SERVICE_CHECK_RESULT line written to the external command file, usually through an add-on.

What is the difference between soft and hard states?

A soft state is a failure still being retried. It becomes hard after max_check_attempts failures, and notifications start.

Which port does NRPE use?

TCP 5666 by default. Allow it only from the Nagios server.

References

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Angry Angry 0
Sad Sad 0
Wow Wow 0
Mridul I am a passionate technology enthusiast with a strong focus on DevOps, Cloud Computing, and Cybersecurity. Through my blogs at DevOps Training Institute, I aim to simplify complex concepts and share practical insights for learners and professionals. My goal is to empower readers with knowledge, hands-on tips, and industry best practices to stay ahead in the ever-evolving world of DevOps.