Nagios Engineer Interview Questions with Answers (2027)
30 Nagios engineer interview questions with answers: plugin exit codes, soft and hard states, templates, NRPE, NCPA, notifications and operations.
Nagios engineer interview questions test the daily work of the role: writing host and service definitions, building and debugging plugins, setting up NRPE or NCPA agents, tuning notifications so on-call staff are not flooded, and keeping a large configuration valid. Expect to explain plugin exit codes, check states, templates and the pre-flight check before every reload.
This page focuses on the engineer who owns a Nagios installation day to day. For incident-style questions, use our scenario-based Nagios interview questions. Facts were checked against the Nagios Core documentation and the Nagios Core GitHub releases page in November 2026, where the latest release listed was Nagios Core 4.5.14.
Key takeaways
- Know the plugin contract: exit code 0 is OK, 1 is WARNING, 2 is CRITICAL and 3 is UNKNOWN, with one line of output and optional performance data after a pipe.
- Host states are UP, DOWN and UNREACHABLE. Service states are OK, WARNING, CRITICAL and UNKNOWN. Soft and hard states decide when notifications go out.
- Templates and inheritance keep large configurations short. Interviewers often ask you to refactor repetitive definitions.
- Always run
nagios -vagainst the main config before a reload. - Know the difference between Nagios Core (open source) and Nagios XI (commercial, with a web configuration interface).
- Be ready to compare Nagios with Prometheus-style monitoring, since many teams run both.
Where the role spends its time
| Task | What interviewers ask |
|---|---|
| Configuration | Object types, templates, host groups, service dependencies |
| Plugins | Exit codes, thresholds, performance data, writing a custom check |
| Remote checks | NRPE, NCPA, SSH checks, passive checks via NSCA |
| Alerting | Contacts, time periods, escalation, flap detection |
| Operations | Reloads, performance tuning, upgrades, backups |
Core concepts
1. What does Nagios Core actually do?
Nagios Core schedules checks, runs plugins, records the results as states, and sends notifications when states change according to your rules. It does not collect metrics by itself. Plugins do the measuring.
2. What are the plugin exit codes?
0 means OK, 1 WARNING, 2 CRITICAL and 3 UNKNOWN. Nagios reads only the exit code to decide the state, and the first line of output for the status text.
3. What is performance data?
Text after a pipe character in the plugin output, in the form label=value[UOM];warn;crit;min;max. Graphing add-ons read it to draw trends.
DISK OK - free space: / 4200 MB (41%) | /=6000MB;8000;9000;0;10240
4. What is the difference between soft and hard states?
When a check first fails, the state is soft and Nagios retries up to max_check_attempts. Only when the failure persists for all attempts does it become hard, and notifications are sent on hard state changes. This filters out brief blips.
5. What is the difference between active and passive checks?
Active checks are started by Nagios on a schedule. Passive checks are results submitted from outside, for example by a backup script, through the external command file or an add-on such as NSCA. Use freshness checking so a passive service goes critical if results stop arriving.
6. What object types do you work with most?
Hosts, services, commands, contacts, contact groups, time periods, host groups and service groups. Dependencies and escalations come next in larger setups.
Configuration and templates
7. How do templates and inheritance work?
A template is an object with register 0, so it is not a real host or service. Other objects use it with the use directive and inherit its settings. You can chain templates and override any value locally.
define host {
name linux-server-base
check_command check-host-alive
max_check_attempts 3
check_interval 5
notification_period 24x7
register 0
}
define host {
use linux-server-base
host_name web01
address 10.0.1.21
}
8. How do you apply one service to many hosts?
Define the service once with hostgroup_name. Every host in the group gets the check. Adding a host to the group is then the only change needed.
9. How do you check the configuration before a reload?
Run nagios -v /usr/local/nagios/etc/nagios.cfg (the path depends on how you installed). It reports errors and warnings without touching the running process. Only reload when it shows zero errors.
10. Why do parent relationships matter?
Setting parents on a host tells Nagios about network topology. If a router goes down, hosts behind it are marked UNREACHABLE instead of DOWN, and you can choose not to be notified about them. This prevents an alert storm.
11. What are service dependencies for?
They suppress checks or notifications for a service when another service it relies on is failing. A web application check can depend on the database service so only the root cause alerts.
12. How do you keep a large configuration manageable?
Split it into directories with cfg_dir, use templates and host groups, keep it in Git, and generate repetitive parts from an inventory with a configuration management tool such as Ansible.
Plugins
13. How do you test a plugin before adding it?
Run it by hand as the nagios user with the same arguments Nagios will use, then print the exit code with echo $?. Many problems come from permissions or environment differences that only show up as that user.
14. Write a simple custom plugin.
#!/bin/bash
# check_file_age: CRITICAL if the file is older than N minutes
FILE="$1"; MAX="$2"
[ -f "$FILE" ] || { echo "UNKNOWN - $FILE not found"; exit 3; }
AGE=$(( ( $(date +%s) - $(stat -c %Y "$FILE") ) / 60 ))
if [ "$AGE" -gt "$MAX" ]; then
echo "CRITICAL - $FILE is $AGE minutes old | age=${AGE}m;;$MAX"; exit 2
fi
echo "OK - $FILE is $AGE minutes old | age=${AGE}m;;$MAX"; exit 0
Point out the UNKNOWN case for bad input, the single output line and the performance data.
15. How do thresholds work in standard plugins?
The Monitoring Plugins project defines a range syntax for -w and -c. A plain number such as 10 alerts outside 0 to 10. Ranges like 10: alert below 10, and @10:20 alerts inside the range.
16. A plugin returns "(No output on stdout)". What is wrong?
The plugin printed nothing or printed only to stderr, often because it failed early due to a missing dependency or permission. Run it by hand as the nagios user to see the real error.
17. A check times out. What do you change?
First find why it is slow. If the check legitimately needs longer, raise the plugin's own timeout argument and, if needed, service_check_timeout in the main config. Increasing timeouts everywhere hides real problems.
Remote monitoring
18. How does NRPE work?
The NRPE daemon runs on the monitored host. Nagios runs check_nrpe, which asks the daemon to execute a named command defined in nrpe.cfg. The plugin runs locally and the result is returned to Nagios.
19. Why is allowing arguments in NRPE a risk?
If dont_blame_nrpe is enabled, callers can pass arguments into commands, which widens what a compromised or spoofed caller could run. Keep it off, define fixed commands and restrict allowed_hosts to your Nagios servers.
20. check_nrpe returns "Could not complete SSL handshake". What do you check?
Check that the Nagios server address is in allowed_hosts, that the NRPE daemon is running, that firewalls allow port 5666 and that both sides use compatible SSL settings and versions.
21. What is NCPA?
The Nagios Cross-Platform Agent, which runs on Linux, Windows and macOS and exposes checks through an API. It is commonly used with Nagios XI and can also be used with Core through the check_ncpa.py plugin.
Notifications and noise
22. How do you stop alerts at night for non-critical systems?
Assign a time period such as workhours to the service's notification_period. Checks keep running and the state is recorded, but notifications are only sent within the period.
23. What is flap detection?
Nagios tracks how often a state changes across recent checks. If the percentage crosses the high threshold, it marks the service as flapping and suppresses notifications until it settles below the low threshold.
24. How do escalations work?
An escalation adds contacts after a number of notifications. For example, notifications 1 to 2 go to the on-call engineer and from notification 3 onwards to the team lead as well.
25. How do you schedule downtime for a patch window?
Use the web interface or send a SCHEDULE_HOST_DOWNTIME command to the external command file. Checks still run but notifications are suppressed, and reports show the time as planned downtime.
Operations and performance
26. Checks are running late. What do you look at?
Check latency in nagiostats or the performance page. High latency means the scheduler cannot keep up. Fix slow plugins first, then review check intervals and consider offloading with distributed or worker-based setups.
27. How do you upgrade Nagios Core safely?
Back up the configuration and the retention and status files, read the release notes, build the new version, run the configuration check, then restart. Keep the old binary until you have confirmed checks and notifications work.
28. Nagios Core versus Nagios XI?
Core is the open source engine configured by text files. XI is the commercial product from Nagios Enterprises built on Core, with a web-based configuration interface, wizards, reports and support.
29. How would you integrate Nagios with a CI/CD pipeline?
Keep configuration in Git, run nagios -v in the pipeline as a test, and deploy with a tool such as Ansible followed by a reload. Use the external command file or API to schedule downtime during deployments.
30. When would you choose Prometheus instead of Nagios?
Prometheus suits dynamic, containerised environments and metric-based alerting with labels and PromQL. Nagios suits fixed infrastructure and simple pass or fail checks. Many teams run both and send alerts to the same on-call tool.
Practice plan
- Install Nagios Core and the Monitoring Plugins on a test VM.
- Add three hosts using a template and a host group, then add a router as parent.
- Install NRPE on one host and check disk and load remotely.
- Write the custom plugin above and wire it in.
- Break things on purpose and watch soft and hard states, flapping and notifications.
Related reading: the advanced Nagios interview questions, Nagios monitoring interview questions and real-time Nagios questions. For the modern metrics side, see Prometheus monitoring interview questions. Our Prometheus and Grafana training covers monitoring in the Kharadi, Pune classroom and live online across India.
Frequently asked questions
What are the Nagios plugin exit codes?
0 is OK, 1 is WARNING, 2 is CRITICAL and 3 is UNKNOWN. Nagios uses the exit code for the state and the first output line for the status text.
What is the latest version of Nagios Core?
When we checked in November 2026, the Nagios Core GitHub releases page listed 4.5.14 as the latest release. Check the releases page before an interview, as it changes.
What is the difference between a soft and a hard state?
A soft state is a failure still being retried. It becomes hard after max_check_attempts consecutive failures, and notifications are sent on hard state changes.
How do I verify a Nagios configuration?
Run nagios -v with the path to the main nagios.cfg file. Reload only when it reports no errors.
What port does NRPE use?
NRPE listens on TCP port 5666 by default. Restrict it with allowed_hosts and a host firewall.
Is Nagios still worth learning?
Many organisations still run Nagios or Nagios-compatible tools for infrastructure checks. Learning it alongside Prometheus gives you both the check-based and the metric-based view of monitoring.
Official references
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Angry
0
Sad
0
Wow
0