How to run Nagios plugins on other machines remotely using NRPE

Last updated on Nov 28 2021
Nitin Bajabalkar

Table of Contents

How to run Nagios plugins on other machines remotely using NRPE

Nagios – NRPE

The Nagios daemon which run checks on remote machines in NRPE (Nagios Remote Plugin Executor). It allows you to run Nagios plugins on other machines remotely. You can monitor remote machine metrics such as disk usage, CPU load etc. It can also check metrics of remote windows machines through some windows agent addons.

image1 7

Let us see how to install and configure NRPE step by step on client machine which needs to be monitored.

Step 1 − Run below command to install NRPE on the remote linux machine to be monitored.

sudo apt-get install nagios-nrpe-server nagios-plugins

Step 2 − Now, create a host file inside the server directory, and put all the necessary definitions for the host.

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
}

define service {
host_name ubuntu_host
service_description Check Users
check_command check_local_users!20!50
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
}

define service {
host_name ubuntu_host
service_description Local Disk
check_command check_local_disk!20%!10%!/
max_check_attempts 2
check_interval 2
retry_interval 2
check_period 24x7
check_freshness 1
groups admins
notification_interval 2
notification_period 24x7
notifications_enabled 1
register 1
}

define service {
host_name ubuntu_host
service_description Check SSH
check_command check_ssh
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
}

define service {
host_name ubuntu_host
service_description Total Process
check_command check_local_procs!250!400!RSZDT
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
}

Step 3 − Run the command shown below for the verification of configuration file.

sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
image2 6

Step 4 − Restart NRPE, Apache and Nagios if there are no errors.

service nagios-nrpe-server restart
service apache2 restart
service nagios restart
 

Step 5 − Open your browser and go to Nagios web interface. You can see the host which needs to be monitored has been added to Nagios core service. Similarly, you can add more hosts to be monitored by Nagios.

image3 3

So, this brings us to the end of blog. This Tecklearn ‘How to run Nagios plugins on other machines remotely using NRPE’ 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 "How to run Nagios plugins on other machines remotely using NRPE"

Leave a Message

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