Nagios is a powerful tool for monitoring your IT infrastructure. It helps keep track of system performance and alerts you to any issues. This guide will walk you through how to install and configure the Nagios NRPE (Nagios Remote Plugin Executor) client on Ubuntu 24.04. We'll also show you how to add a host on the Nagios server for monitoring.
You'll need:
A server running Ubuntu 24.04
A Nagios server already set up and running
A basic understanding of Linux commands
First, make sure your system is up to date. Open the terminal and run:
sudo apt update
sudo apt upgrade
Install the NRPE client and Nagios plugins by running:
Ensure NRPE is working correctly by running the following command from your Nagios server. Replace <Client_IP> with the IP address of your Ubuntu server:
/usr/lib/nagios/plugins/check_nrpe -H <Client_IP>
You should see a response like this:
NRPE v4.0.3
Now, let's add the Ubuntu server as a host in Nagios for monitoring.
On your Nagios server, create a configuration file for the new host. For example:
Add the following configuration to the file. Replace <Host_Name> and <Client_IP> with appropriate values.
define host {
use linux-server
host_name <Host_Name>
alias Ubuntu 24.04 Server
address <Client_IP>
max_check_attempts 5
check_period 24x7
notification_interval 30
notification_period 24x7
}
To monitor services like disk usage, CPU load, and memory usage, add the following configuration in the same file:
define service {
use generic-service
host_name <Host_Name>
service_description Check Disk
check_command check_nrpe!check_disk
}
define service {
use generic-service
host_name <Host_Name>
service_description Check Load
check_command check_nrpe!check_load
}
define service {
use generic-service
host_name <Host_Name>
service_description Check Memory
check_command check_nrpe!check_mem
}
sudo systemctl restart nagios
You have successfully installed and configured the Nagios NRPE client on Ubuntu 24.04. You also added your Ubuntu server as a host on the Nagios server for monitoring. Now, Nagios will keep an eye on your server's health and alert you if anything goes wrong.
0 comments:
Post a Comment