Look into Nagios Features, applications, Hosts and services and Commands

Last updated on Nov 17 2021
Nitin Bajabalkar

Table of Contents

Look into Nagios Features, applications, Hosts and services and Commands

Nagios – Features

Nagios is the monitoring tool with multitude of features as given below −

  • Nagios Core is open source, hence free to use.
  • Powerful monitoring engine which can scale and manage 1000s of hosts and servers.
  • Comprehensive web dashboard giving the visibility of complete network components and monitoring data.
  • It has multi-tenant capabilities where multiple users have access to Nagios dashboard.
  • It has extendable architecture which can easily integrate with third-party applications with multiple APIs.
  • Nagios has a very active and big community with over 1 million + users across the globe.
  • Fast alerting system, sends alerts to admins immediately after any issue is identified.
  • Multiple plugins available to support Nagios, custom coded plugins can also be used with Nagios.
  • It has good log and database system storing everything happening on the network with ease.
  • Proactive Planning feature helps to know when it’s time to upgrade the infrastructure.

Nagios – Applications

Nagios can be applicable to a wide range of applications. They are given here −

  • Monitor host resources such as disk space, system logs etc.
  • Monitor network resources – http, ftp, smtp, ssh etc.
  • Monitor log files continuously to identify infra-issue.
  • Monitor windows/linux/unix/web applications and its state.
  • Nagios Remote Plugin Executer (NRPE) can monitor services remotely.
  • Run service checks in parallel.
  • SSH or SSL tunnels can also be used for remote monitoring.
  • Send alerts/notifications
  • via email, sms, pager of any issue on infrastructure
  • Recommending when to upgrade the IT infrastructure.

 Nagios – Hosts and Services

Nagios is the most popular tool which is used to monitor hosts and services running in your IT infrastructure. Hosts and service configurations are the building blocks of Nagios Core.

  • Host is just like a computer; it can be a physical device or virtual.
  • Services are those which are used by Nagios to check something about a host.

You can create a host file inside the server directory of Nagios and mention the host and service definitions. For example −

sudo gedit /usr/local/nagios/etc/servers/ubuntu_host.cfg
# Ubuntu Host configuration file
define host {
use linux-server
host_name ubuntu_host
alias Ubuntu Host
address 192.168.1.10
register 1
}

define service {
host_name ubuntu_host
service_description PING
check_command check_ping!100.0,20%!500.0,60%
max_check_attempts 2
check_interval 2
retry_interval 2
check_period 24x7
check_freshness 1
contact_groups admins
notification_interval 2
notification_period 24x7
notifications_enabled 1
register 1
}

The above definitions add a host called ubuntu_host and defines the services which will run on this host. When you restart the Nagios, this host will start getting monitored by Nagios and the specified services will run.

There are many more services in Nagios which can be used to monitor pretty much anything on the running host.

Nagios – Commands

A command definition defines a command. Commands include service checks, service notifications, service event handlers, host checks, host notifications, and host event handlers. Command definitions for Nagios are defined in commands.cfg file.

The following is the format for defining of a Command −

define command {
command_name command_name
command_line command_line
}

Command name − This directive is used to identify the command. The definitions of contact, host, and service is referenced by command name.

Command line − This directive is used to define what is executed by Nagios when the command is used for service or host checks, notifications, or event handlers.

Example

define command{
command_name check_ssh
command_line /usr/lib/nagios/plugins/check_ssh ‘$HOSTADDRESS$’
}

This command will execute the plugin − /usr/libl/nagios/plugins/check_ssh with 1 parameter : ‘$HOSTADDRESS$’

A very short host definition that would use this check command could be similar to the one shown here −

define host{
host_name host_tutorial
address 10.0.0.1
check_command check_ssh
}

The command definitions tell how to perform host/service checks. The also define how to generate notifications if any issue is identified and to handle any event. There are several commands to perform the checks, such as commands to check if SSH is working properly or not, command to check that database is up and running, command to check if a host is alive or not and many more.

There are commands which tell users what issues are present in the infrastructure. You can create your own custom commands or use any third-party command in Nagios, and they are treated similar to Nagios plugins project, there is no distinction between them.

You can also pass arguments in the command, this give more flexibility in performing the checks. This is how you need to define a command with parameter −

define command {
command_name check-host-alive-limits
command_line $USER5$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
}

The host definition for the above command −

define host {
host_name system2
address 10.0.15.1
check_command check-host-alive-limits!1000.0,70%!5000.0,100%
}

You can run external commands in Nagios by adding them to commands file which is processed by Nagios daemon periodically.

With External commands you can achieve lot many checks while Nagios is running. You can temporarily disable few checks, or force some checks to run immediately, disable notifications temporarily etc. The following is the syntax of external commands in Nagios that must be written in command file −

[time] command_id;command_arguments

You can also check out the list of all external commands that can be used in Nagios here − https://assets.nagios.com/downloads/nagioscore/docs/externalcmds/

So, this brings us to the end of blog. This Tecklearn ‘Look into Nagios Features, applications, Hosts and services and Commands’ blog helps you with commonly asked questions if you are looking out for a job in DevOps. 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. Please find the link for course details:

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 "Look into Nagios Features, applications, Hosts and services and Commands"

Leave a Message

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