Top 25 Nagios Interview Question & Answers

Learn all the frequently asked interview questions on Nagios

Top 25 Nagios Interview Question & Answers

1. Why is Continuous monitoring necessary?

Continuous Monitoring allows timely identification of problems or weaknesses and quick corrective action that helps reduce expenses of an organization. Continuous monitoring provides solution that addresses three operational disciplines known as:

  • continuous audit
  • continuous controls monitoring
  • continuous transaction inspection

2. What is Nagios?

It is used for Continuous monitoring of systems, applications, services, and business processes etc in a DevOps culture. In the event of a failure, Nagios can alert technical staff of the problem, allowing them to begin remediation processes before outages affect business processes, end-users, or customers.
By using Nagios you can:

  • Plan for infrastructure upgrades before outdated systems cause failures.
  • Respond to issues at the first sign of a problem.
  • Automatically fix problems when they are detected.
  • Coordinate technical team responses.
  • Ensure your organization’s SLAs are being met.
  • Ensure IT infrastructure outages have a minimal effect on your organization’s bottom line.
  • Monitor your entire infrastructure and business processes.

3. How does Nagios works?
Nagios runs on a server, usually as a daemon or service. Nagios periodically runs plugins residing on the same server, they contact hosts or servers on your network or on the internet. One can view the status information using the web interface. You can also receive email or SMS notifications if something happens. The Nagios daemon behaves like a scheduler that runs certain scripts at certain moments. It stores the results of those scripts and will run other scripts if these results change.

4. What are Plugins in Nagios?

They are scripts (Perl scripts, Shell scripts, etc.) that can run from a command line to check the status of a host or service. Nagios uses the results from Plugins to determine the current status of hosts and services on your network. Nagios will execute a Plugin whenever there is a need to check the status of a host or service. Plugin will perform the check and then simply returns the result to Nagios. Nagios will process the results that it receives from the Plugin and take the necessary actions.

5. What is NRPE (Nagios Remote Plugin Executor) in Nagios?

The NRPE addon is designed to allow you to execute Nagios plugins on remote Linux/Unix machines. The main reason for doing this is to allow Nagios to monitor “local” resources (like CPU load, memory usage, etc.) on remote machines. Since these public resources are not usually exposed to external machines, an agent like NRPE must be installed on the remote Linux/Unix machines.

The NRPE addon consists of two pieces:

  • The check_nrpe plugin, which resides on the local monitoring machine.
  • The NRPE daemon, which runs on the remote Linux/Unix machine.

6. What is the difference between Active and Passive check in Nagios?

The major difference between Active and Passive checks is that Active checks are initiated and performed by Nagios, while passive checks are performed by external applications.
Passive checks are useful for monitoring services that are:

  • Asynchronous in nature and cannot be monitored effectively by polling their status on a regularly scheduled basis.
  • Located behind a firewall and cannot be checked actively from the monitoring host.

The main features of Actives checks are as follows:

  • Active checks are initiated by the Nagios process.
  • Active checks are run on a regularly scheduled basis.

7. How does Nagios help with Distributed Monitoring?

With Nagios you can monitor your whole enterprise by using a distributed monitoring scheme in which local slave instances of Nagios perform monitoring tasks and report the results back to a single master. You manage all configuration, notification, and reporting from the master, while the slaves do all the work. This design takes advantage of Nagios’s ability to utilize passive checks i.e. external applications or processes that send results back to Nagios. In a distributed configuration, these external applications are other instances of Nagios.

8. Explain Main Configuration file of Nagios and its location?

The main configuration file contains a number of directives that affect how the Nagios daemon operates. This config file is read by both the Nagios daemon and the CGIs (It specifies the location of your main configuration file). A sample main configuration file is created in the base directory of the Nagios distribution when you run the configure script. The default name of the main configuration file is nagios.cfg. It is usually placed in the etc/ subdirectory of you Nagios installation (i.e. /usr/local/nagios/etc/).

9. Explain how Flap Detection works in Nagios?

Flapping occurs when a service or host changes state too frequently, this causes lot of problem and recovery notifications. Whenever Nagios checks the status of a host or service, it will check to see if it has started or stopped flapping. Nagios follows the below given procedure to do that:

  • Storing the results of the last 21 checks of the host or service analyzing the historical check results and determine where state changes/transitions occur
  • Using the state transitions to determine a percent state change value (a measure of change) for the host or service
  • Comparing the percent state change value against low and high flapping thresholds

A host or service is determined to have started flapping when its percent state change first exceeds a high flapping threshold. A host or service is determined to have stopped flapping when its percent state goes below a low flapping threshold.

10. What is meant by saying Nagios is Object Oriented?

Using the object configuration format, you can create object definitions that inherit properties from other object definitions. Hence, Nagios is known as object-oriented.

Types of Objects:

  • Services
  • Hosts
  • Commands
  • Time Periods

11. What is State Stalking in Nagios?

When Stalking is enabled for a particular host or service, Nagios will watch that host or service very carefully and log any changes it sees in the output of check results. Under normal circumstances, the result of a host or service check is only logged if the host or service has changed state since it was last checked.

12. What are the port numbers that Nagios uses for monitoring purposes?

Usually, Nagios uses the following port numbers for monitoring:

  • 5666
  • 5667
  • 5668

13. What is the Nagios Network Analyzer?

  • It provides an in-depth look at all network traffic sources and security threats.
  • It provides a central view of your network traffic and bandwidth data.
  • It allows system admins to gather high-level information on the health of the network.
  • It enables you to be proactive in resolving outages, abnormal behavior, and threats before they affect critical business processes.

14. What are the benefits of HTTP and SSL certificate monitoring with Nagios?

HTTP certificate monitoring

  • Increased server, services, and application availability.
  • Fast detection of network outages and protocol failures.
  • Enables web transaction and web server performance monitoring.

SSL certificate monitoring

  • Increased website availability.
  • Frequent application availability.
  • It provides increased security.

15. Explain virtualization with Nagios?

Nagios can run on different virtualization platforms, like VMware, Microsoft Visual PC, Xen, Amazon EC2, etc.

Provides the capabilities to monitor an assortment of metrics on different platforms

Ensures quick detection of service and application failures

Has the ability to monitor the following metrics:

  • CPU Usage
  • Memory
  • Networking
  • VM status
  • Reduced administrative overhead

16. Name the three variables that affect recursion and inheritance in Nagios.

name – Template name that can be referenced in other object definitions so it can inherit the object’s properties/variables.

use – Here, you specify the name of the template object that you want to inherit properties/variables from.

register – This variable indicates whether or not the object definition should be registered with Nagios.

17. Can you use Nagios to monitor the window machine?

Yes, you can use Nagios to monitor the window machine. However, if you are doing it for the first time then you have to follow the given steps:

  • Set the Nagios to monitor the window system
  • Add a separate host and server for the window monitoring

18. Name down some databases that support Nagios monitoring?

There are a number of databases that support Nagios and some of them are mentioned below:

  • Oracle
  • MySQL
  • Microsoft SQL software
  • Postgres

19. Write down the protocols that support Nagios

Nagios supports the number of protocols monitoring including: SMTP Monitoring, IPMI Monitoring, FTP Monitoring, LDAP Monitoring, POP Monitoring, and DNS monitoring.

20. Suppose if httpd service goes down, how can we automatically start the service using nagios?

We have to create custom Event Handler to achieve this.

21. If we need to monitor windows services like disk usage, memory etc, how can we achieve this via Nagios?

We have to install NSClient++ nagios client application in the windows server, then configure it for allowing required plugins.

22. We specify $USER1$/check_load in commands.cfg, what is the $USERS1$ ?
USER1 is a macro in nagios which will expand to the plugin location in the command. Nagios supports up to 256 user macros ($USER1$ through $USER256$).

23. What is the difference between HOSTADDRESS and HOSTALIAS macros

  • HOSTADDRESS is the Address of the host. This value is taken from the address directive in the host definition.
  • HOSTALIAS is the Long name/description for the host. This value is taken from the alias directive in the host definition.

24. What are the reasons for UNKNOWN result all the time?

Nagios is not able to fetch correct data due to:

  • Incorrect command intrepretation.
  • Intermittent network issues.
  • Permission issue for executing the command.

25. What is ocsp_command in nagios?

OCSP is Obsessive Compulsive Service Processor Command which allows you to specify a command to be run after every service check, which can be useful in distributed monitoring. This command is executed after any event handler. or notification commands.


Bijan Patel
Full Stack Test Automation Expert | Selenium Framework Developer | Certified Tosca Automation Specialist | Postman | DevOps | AWS | IC Agile Certified | Trainer | Youtuber | Blogger|

Launch your GraphyLaunch your Graphy
100K+ creators trust Graphy to teach online
𝕏
QASCRIPT 2024 Privacy policy Terms of use Contact us Refund policy