• Home
  • DevOps
  • Top Nagios Interview Questions and Answers

Top Nagios Interview Questions and Answers

Last updated on Feb 18 2022
Mukul Bose

Table of Contents

Top Nagios Interview Questions and Answers

What is Nagios?

You can answer this question by first mentioning that:

Nagios is one of the monitoring tools that 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 affects business processes, end-users, or customers. With Nagios you don’t have to explain why an unseen infrastructure outage affect your organization’s bottom line.

Few of its important features are:

Nagios Features
Feature Description
Monitoring Its powerful script APIs allow easy monitoring of in-house and custom applications, services, and systems
Visibility & Awareness It provides a centralized view of the entire monitored IT infrastructure with detailed status information
Problem Remediation Alert acknowledgments in Nagios, provide communication on known issues and problem response
Proactive Planning Trending and capacity planning add-ons are there in Nagios to aware you about the aging infrastructure
Reporting Availability reports ensure SLAs are being met & provide a record of alerts, notifications, and alert response
Customizable
Code
 Since it is an open-source software you get the full access to its source code
Large Community Nagios is backed up by a community of more than  million+ users worldwide which provides free support

Now, once you have defined what is Nagios, you can mention the various things that you can achieve using Nagios.

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.

This overall completes the answer to this question. The further details like advantages etc. can be added as per the direction where the discussion is heading.

What do you mean by passive check in Nagios?

Passive checks are initiated and performed by external applications/processes and the Passive check results are submitted to Nagios for processing.

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. It can also be used for monitoring services that are Located behind a firewall and cannot be checked actively from the monitoring host.

When Does Nagios Check for external commands?

Nagios check for external commands under the following conditions:

  • At regular intervals specified by the command_check_interval option in the main configuration file or,
  • Immediately after event handlers are executed. This is in addition to the regular cycle of external command checks and is done to provide immediate action if an event handler submits commands to Nagios.

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.

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.

How does Nagios work?

  • 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. Refer the diagram below:

What are Plugins in Nagios?

Plugins 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 the plugins to determine the current status of hosts and services on your network.

Once you have defined Plugins I will suggest you to explain why we need plugins.

Nagios will execute a Plugin whenever there is a need to check the status of a host or service. The 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.

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.

Now I will advise you to explain the NRPE architecture on the basis of diagram shown below.

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.

There is a SSL (Secure Socket Layer) connection between monitoring host and the remote host as shown in the diagram.

What is meant by Nagios backend?(unable to find a relevant explanation)

Both Configuration and Logs can be stored in a backend. Configurations are stored in backend using NagiosQL. Historical data are stored using ndoutils. In addition, you also have nagdb and opdb.

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).

Now you can tell where it is present and how it is created.

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/).

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.

Once you have defined Flapping explain how Nagios detects Flapping.

Whenever Nagios checks the status of a host or service, it will check to see if it has started or stopped flapping. Nagios follow the below procedure to do that:

  • Storing the results of the last 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.

What are the three main variables that affect recursion and inheritance in Nagios?

First name the variables and then a small explanation of each of these variables:

  • Name
  • Use
  • Register

Name is a placeholder that is used by other objects. Use defines the “parent” object whose properties should be used. Register can have a value of (indicating its only a template) and (an actual object). The register value is never inherited.

What is meant by saying Nagios is Object Oriented?

One of the features of Nagios is object configuration format in that you can create object definitions that inherit properties from other object definitions and hence the name. This simplifies and clarifies relationships between various components.

Nagios data is stored in dat format, how do we store in MySQL db for better performance?

We have to install NDOutils and configure Nagios to use it.

  • Install MySQL and create database for nagios and set username and password.
  • Install NDOUtils.
  • Load Schema using ndoutils installdb command.
  • Change event_broker_options to – in nagios.cfg file and broker_module=/usr/lib/nagios/brokers/ndomod.so(location as per installation) config_file=/etc/nagios/ndomod.cfg
  • Edit ndodb.cfg and add mysql credentials
  • Start ndoutils and restart nagios Ref: https://support.nagios.com/kb/article/ndoutils-installing-ndoutils-.html

How can we relate nagios with DevOps?

Since DevOps follows agile methodology, continuos monitoring is an integral part of it. This can be achieved using nagios.

When we use AWS servers for monitoring, how can we automate the monitoring via nagios, as and when the instance is created.

We have to use and automation or configuration management tool to get this task done. Ansible will be best suited to perform this task.

How to we troubleshooting Nagios core other than host or service monitoring issues?

We have to enable debug mode in nagios.cfg and watch the logs. Which in turn help for find the root cause of the problem.

How to we enable debug log in Nagios?

Set debug_level=- in nagios.cfg

What is the normal way to provide arguments in nagios nrpe commands.

/usr/local/nagios/libexec/check_nrpe -H nrpe-agent -c check_disk -a ‘-w % -c %’
Replace nrpe-agent with the server hostname
  • -c is command to check
  • -a is for arguments

What is State Stalking in Nagios?

State Stalking is used for logging purposes. 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.
Depending on the discussion between you and interviewer you can also add:

It can be very helpful in later analysis of the log files. 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.

Nagios says my machine is unreachable, not down. What is the difference and how it is achieved?

When Nagios says a node is unreachable, a node is unreachable if Nagios is not able to find a path to the node.

Now you can mention the difference.

The node itself may be up but because Nagios is unable to connect to it, it has to mark this as unreachable. To achieve this, Nagios use parent-child relationship between components.

Finally, for better understanding explain it with an example.

A router may be defined as a parent for a server.

  • Now Nagios checks for server and marks it as down.
  • It then checks the parent (in our example, the router)
  • If parent is also down, then server is marked as unreachable.
  • If Parent is up, the server is marked as really down.

Explain Nagios state types?

The current state of monitored services and hosts is determined by two components:

The status of service or host i.e. OK, WARNING, UP, DOWN etc..

  • The type of state the service or host is in.

There are two types of states SOFT states and HARD states.

Now explain what is Soft and Hard states:

  • When a service or host check results are in a non-OK or non-UP state and the service check has not yet been rechecked the number of times specified by the max_check_attempts directives in the service or host definition. This is called Soft Error. When a service or a host recovers from Soft Error that is considered as Soft Recovery.
  • When a service or host check results are in a non-OK or non-UP state and the service check has been rechecked the number of times specified by the max_check_attempts directives in the service or host definition. This is called Hard Error. When a service or a host recovers from Hard Error that is considered as Hard Recovery.

What is Nagios?

Nagios commonly known as the Nagios core is the open-source software that is designed to monitor networks, systems, applications, and infrastructures. The software directly sends the track down all the changes in the subject and send alerts if necessary.

Explain what active check means?

Active check is the globally recognized way to monitor the hosts and services. Both Nagios XI and Nagios core use it on the pre-determined schedule.

 

Describe the Nagios Network Analyzer?

A network analyzer is a crucial aspect of the Nagios software that allows it to deeply scan the entire system in a search of any potential threat. The quick and reliable scan allows system admin to gather necessary data regarding the health of the system and granular data through network analysis.

Highlight the primary benefits of monitoring the websites with Nagios?

The key benefits of monitoring websites with Nagios are given below:

  • It enhances the website availability
  • Increase website performance
  • Quick detection of online threats such as bugs and hijacking

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

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.

What do you understand by the fact that Nagios is object-oriented?

As already mentioned above, Nagios is open-source object-oriented monitoring software. Here the term “object-oriented” means that users can create the object definitions in the Nagios that inheritance from other objects. This essential feature of the Nagios further simplifies the complex relationship between components.

Can I use Nagios for both cloud computing and cloud monitoring?

Yes, Nagios has a reputation as one of the best monitoring software in the market and you can use it for various monitoring purposes including both virtual and physical.

state the name of any four virtualization platforms that supports Nagios?

VMware, Amazon EC, Xen and Microsoft Virtual PC are some of the most common examples of the virtualization platforms that support the Nagios monitoring.

Do you know the port numbers Nagios use to monitor its clients?

Yes, the Nagios uses port number; , and to monitor its clients.

Describe the process to verify the Nagios configuration?

If you want to configure the Nagios, then you have to run it with the -v command line with option like: nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg.

Define the objects in Nagios?

In the Nagios, objects refer to all the elements that are involved in the entire monitoring and alerting logic.

What are the types of objects you can witness in Nagios?

The types of objects you can witness in the Nagios include; Services, Hosts, commands, host groups, contact, time periods, and notification escalations.

How can you use plugin X in Nagios?

Just like any other plugin, you have to download plugin X from the official website of Nagios which is https://exchange.nagios.org/. Once downloaded, you can run it manually to see if it is working correctly.

When it comes to monetary terms what is the main difference between Nagios Core and Nagios XI?

Well, when it comes to monetary terms, Nagios Core is the free open-source version while Nagios XI is the paid version limited to the individual who held the license.

What is the current Nagios state type?

On the current basis, the monitoring host and services are determined by the two major components
First: Status of the host and service
Second: Types of the state the host or service is in

What are the two main state types in Nagios?

The Nagios have two key state types; soft states and hard states.

Define NRPRE in Nagios?

The term NRPE stands for the Nagios Remote Plugin Executor addon which is specifically designed by the experts to execute Nagios plugins on the Linux machines.

What database format Nagios support to store status data?

RRD is the database format Nagios support and uses to store the status data.

How Nagios help DevOps professionals?

Nagios was designed in the first place to monitor applications, networks, and infrastructures. The software automatically keeps an eagle eye and immediately report in case of failure. The quick response helps the DevOps professional to track down and resolve the problem in the early stages before it can cause any serious damage to the organization.

What makes Nagios an ideal tool for continuous monitoring?

The below features of the Nagios is what makes it an ideal tool for continuous monitoring:

  • Automatic problem fixing
  • Infrastructure upgrades
  • Business process and infrastructure monitoring
  • Quick respond to the system issues

Write down some of the names of the Nagios monitoring tool for Linux mentoring?

When you are using the Nagios to monitor the Linux environment then you need to understand that you are using one of the best tools on the planet. The complete package of Nagios includes service state, file system usage, system metrics, process state, and more.

How Icinga is related to the Nagios?

Icinga is also an open-source software that is used to monitor the networks and applications. The core objective of designing Icinga in the first place to lift up the Nagios back in . But it works as a separate monitor software.

Describe the active and passive check in Nagios

In the Nagios, an active check is leveraged to “poll” a service or device for the status information every once in a while. Nagios basically supports the way to host down the devices and services passively. The key feature of the passive check is it can only be performed by the external applications.

Explain OID Nagios?

Simple Network Management Protocol (SNMP)- a network protocol that is also designed for the monitoring purpose uses the Object Identifiers to define the Management Information Base.

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

Describe the Nagios XI?

On the current basis, Nagios XI is one of the most powerful monitoring software in the market. when it comes to monitoring critical infrastructures such as network protocols, applications, services, systems metrics, and network protocols experts only rely upon the Nagios XI.

Highlights the benefits of using Nagios for monitoring?

There are various benefits of using Nagios software for critical monitoring. The list of benefits includes:

  • Infrastructure updates before the outdated system cause any sort of failure
  • Automatic tracking and troubleshooting of problem
  • Coordinate responses
  • Continuously Monitor infrastructure without any break
  • Response to issues on an immediate basis

Write down the components of NDO Utilities?

The NDO utilities are the right mixture of the:

  • NDOMOD Event Broker Module
  • FILESOCK Utility
  • LOGNDO Utility
  • NDODB Daemon

Can we monitor the operating system through Nagios?

Yes, you can monitor any operation system through Nagios as long as it supports the software.

What is the base language for nagios core?

PHP+CGI, Requires Apache as webserver to run php and cgi

What is the default credentials of nagios?

User and Password : nagiosadmin

Which location do we place the plugins for nagios?

Location is /usr/lib/nagios/plugins

What is inheritance in nagios?

Consider the following definition

define host{

name linux-box

use generic-host

check_command check-host-alive

}

Here in the line “use generic-host” is the concept of inheritance as it will grab all the properties of generic-host which is already defined in templates.cfg

Suppose I need all host definition file to be read by nagios instead of mentioning each and every host definition file location in configuration file.

Use cfg_dir=”Directory Location” so that it will consider all configuration under that directory.

While setting-up nrpe, what all things need to be taken care inorder the nagios server connect nrpe client without any issues.

In nrpe configuration, do the following

  • allow_hosts=”nagios server ip”
  • dont_blame_nrpe=
  • Allow port in firewall of nrpe agent

What is the exit status in nagios custom plugin?

– OK, – WARN, – CRITICAL, – UNKNOWN

How to monitor Asynchronous services via Nagios?

Passive monitoring can be used. Data for monitoring is being collected and stored in to passive poll store from where Nagios can pickup and display.

What all services can be monitored using Nagios active checks?

SSH, HTTP, FTP, SMTP, Disk Usage, Memory Usage, Network status etc.

I need to monitor the load average of set of webservers, how can this be achieved?

We need to write a custom plugin script(Bash/Python) which in turn get the status of each and every load average of servers, and then get average of those values.

How can we get alerts for AWS services using Nagios other than alerts from AWS SNS?

We need to configure aws-cli with required privileges and we have to write custom plugin for the required service to be monitored.

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.
URL : https://assets.nagios.com/downloads/nagioscore/docs/nagioscore//en/eventhandlers.html

How to write custom plugin in Nagios?

URL https://www.unixmen.com/write-nagios-plugin-using-bash-script/
a) Write a bash script in following format.

#!/bin/bash

# Nagios Plugin Bash Script - check_service.sh

# This script checks if program is running

# Check for missing parameters

if [[ -z "$" ]]

thenecho "Missing parameters! Syntax: ./check_service.sh service_name"exit

fi

if ps ax | grep -v grep | grep $ > /dev/null

then echo "OK, $SERVICE service is running"exit

else

echo "CRITICAL , $SERVICE service is not running"

exit fi

b) Save the above script in a file and move to the Nagios Plugings Location.
c) Change permission of the script to
d) Write a command definition in command.cfg
e) Use this command definition in other service definitions.

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.

URL : https://kifarunix.com/how-to-install-nsclient-nagios-monitoring-agent-on-windows-system/
; Undocumented key
CheckDisk = enabled
; Undocumented key
CheckSystem = enabled

Test as nagios server side :

/usr/lib/nagios/plugins/check_nt -H HOSTNAME -p -s PASSWORD -v CPULOAD -l ,,

What is port relevant for?

This is NSClient++ client port for monitoring windows servers.

We specify $USER$/check_load in commands.cfg, what is the $USERS$ ?

USER is a macro in nagios which will expand to the plugin location in the command. Nagios supports up to user macros ($USER$ through $USER$).
Eg:  $USER$/check_load is /usr/lib/nagios/plugins/check_load
Ref:   https://assets.nagios.com/downloads/nagioscore/docs/nagioscore//en/macrolist.html

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.

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.

How to process and store performance data?

. Enable the process_performance_data option.

Example:   process_performance_data= in Service definition.
. Configure Nagios so that performance data is either written to files and/or processed by executing commands.

Example:

define command
{

command_name store-service-perfdata

command_line /bin/echo -e

"$LASTSERVICECHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$

\t$SERVICEATTEMPT$\t$SERVICESTATETYPE$\t$SERVICEEXECUTIONTIME$\

t$SERVICELATENCY$\

t$SERVICEOUTPUT$\t$SERVICEPERFDATA$" >> /usr/local/nagios/var/service-perfdata.dat

}

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.

How do we monitor Router or Switches using Nagios?

We have to use SNMP protocol

define service

{use generic-service ; Inherit values from a templatehost_name linksys-srwpservice
_description Port Link Statuscheck_command check_snmp!-C public -o ifOperStatus. -r 
-m RFC-MIB

}

How to monitor Bandwidth/traffic rate using nagios?

We need to install and use check_mrtgtraf plugin.

define service{

use generic-service ; Inherit values from a template

host_name linksys-srwp

service_description Port Bandwidth Usage

check_command

check_local_mrtgtraf!/var/lib/mrtg/..._.log!AVG!,!,!

}

Can we achieve distributed monitoring in Nagios?

Yes, via DNX, NSCA, Monit etc plugins are used for distributed monitoring.

Can we customize charts in nagios for better display and alert it?

Yes, by using different rd Party convertor for services like CACTI, RRD, Graphite etc

So, this brings us to the end of the Nagios Interview Questions blog.
This Tecklearn ‘ Top Nagios  Interview Questions and Answers’  helps you with commonly asked questions if you are looking out for a job in Nagios or DevOps Domain. If you wish to learn Nagios and build a career in DevOps domain, then check out our interactive Continuous Monitoring using Nagios Training, that comes with 24*7 support to guide you throughout your learning period.

https://www.tecklearn.com/course/continuous-monitoring-using-nagios/

Continuous Monitoring using Nagios Training

About the Course

Tecklearn has specially designed this Continuous Monitoring using Nagios Training Course to advance your skills for a successful career in this domain. The course will cover different components of Nagios and how they are used in software development operations. You will get an in-depth knowledge of these concepts and will be able to work on related demos. Upon completion of this online training, you will hold a solid understanding and hands-on experience with Nagios.

Why Should you take Continuous Monitoring using Nagios Training?

  • The average salary for Nagios Monitoring Engineer is $107,506 per year, ranging from $85,655 to $124,818.
  • Oracle, Raytheon, Abacus, Next, Apple, Wells Fargo & many other MNC’s worldwide use Nagios across industries.
  • According to Grand View Research, the DevOps market size is estimated to be worth $12.85 billion by 2025. DevOps professionals are highly paid and in-demand throughout industries including retail, eCommerce, finance, and technology.

What you will Learn in this Course?

Introduction to DevOps

  • What is Software Development
  • Software Development Life Cycle
  • Why DevOps?
  • What is DevOps?
  • DevOps Lifecycle
  • DevOps Tools
  • Benefits of DevOps
  • How DevOps is related to Agile Delivery
  • DevOps Implementation

Continuous Monitoring using Nagios

  • Introduction to Continuous Monitoring
  • Introduction to Nagios
  • Nagios Architecture
  • Monitoring Services in Nagios
  • Installing Nagios
  • Nagios Plugins (NRPE) and Objects
  • Nagios Commands and Notification
  • Monitoring of different servers using Nagios

Got a question for us? Please mention it in the comments section and we will get back to you.

 

0 responses on "Top Nagios Interview Questions and Answers"

Leave a Message

Your email address will not be published. Required fields are marked *