Ubuntu / Debian sudo nano /usr/local/nagios/etc/objects/commands.cfgĬommand_line /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$Ĭreate a client configuration file /usr/local/nagios/etc/servers/ to define the host and service definitions of remote Linux host. command definitionĬommand_line /usr/lib64/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ CentOS / RHEL vi /usr/local/nagios/etc/objects/commands.cfgĪdd the following Nagios command definition to the file. Now it’s time to configure the Nagios server to monitor the remote client machine, and You’ll need to create a command definition in Nagios object configuration file to use the check_nrpe plugin. Sudo mkdir /usr/local/nagios/etc/servers Add Command Definition cfg_dir=/usr/local/nagios/etc/serversĬreate a configuration directory. Sudo nano /usr/local/nagios/etc/nagios.cfgĪdd or uncomment the following line. cfg files inside the /usr/local/nagios/etc/servers directory. sudo apt install -y nagios-nrpe-pluginĮdit the Nagios configuration file to include all. Use the following command to install the NRPE plugin on your machine. yum -y install nagios-plugins-nrpe Ubuntu / Debian So, configure the EPEL repository your CentOS / RHEL system. Nagios NRPE plugin is available in the EPEL repository for CentOS / RHEL. This NRPE plugin provides check_nrpe plugin which contacts the NRPE server on remote machines to check the services or resource. etc/init.d/iptables save On Nagios Server Install NRPE plugin Iptables -I OUTPUT -p tcp -sport 5666 -m conntrack -ctstate ESTABLISHED -j ACCEPT IP Tables iptables -I INPUT -p tcp -dport 5666 -m conntrack -ctstate NEW,ESTABLISHED -j ACCEPT FirewallD firewall-cmd -permanent -add-port=5666/tcp Run these commands on a remote Linux machine. Sudo systemctl restart nagios-nrpe-server FirewallĬonfigure the firewall so that the Nagios server can able to reach the NRPE server running on a remote Linux host. These command definitions have to be entered on a template file on the Nagios server host to enable the monitoring. Output: PROCS OK: 189 processes | procs=189 200 250 0 usr/lib/nagios/plugins/check_procs -w 200 -c 250 You can adjust the alert level as per your requirements.Ĭhange warning to 200 and critical to 250 for testing purposes. Nagios plugin will count running processes and will warn you if the process count is more than 150, or it will report you critical if the process count is more than 200, and at the same time, the output will state OK if the count is below 150. Output: PROCS WARNING: 190 processes | procs=190 150 200 0 Test Nagios Checksįor example, execute the below command in another terminal to see the check result. In the above command definition -w stands for warning and -c stands for critical. The /etc/nagios/nrpe.cfg file contains the basic commands to check the attributes (CPU, Memory, Disk, etc.architecure) and services (HTTP, FTP, etc.) on remote hosts. allowed_hosts= 192.168.0.10 Configure Nagios Checks # CentOS / RHEL #Īdd the Nagios servers IP address, separated by comma like below. Modify the NRPE configuration file to accept the connection from the Nagios server, Edit the /etc/nagios/nrpe.cfg file. Sudo apt install -y nagios-nrpe-server nagios-plugins Configure NRPE Add-on Use the following command to install NRPE Add-on and Nagios plugins. yum install -y nrpe nagios-plugins-all Ubuntu / Debian NRPE Server and Nagios plugins are available in the EPEL repository for CentOS / RHEL. Install NRPE Add-on & Nagios Plugins CentOS / RHEL This NRPE Add-on helps Nagios to monitor local resources like CPU, Memory, Disk, Swap, etc. Nagios Remote Plugin Executor (abbreviated as NRPE) plugin allows you to monitor applications and services running on remote Linux / Windows hosts. READ: How To Install Nagios on Debian 10 / 9 Monitor Remote Linux Systems With Nagios On Remote Linux System READ: How To Install Nagios on Ubuntu 18.04 & Ubuntu 16.04 READ: How To Install Nagios on CentOS 7 / RHEL 7 READ: How to Install Nagios on CentOS 8 / RHEL 8 I’m assuming that you have a working Nagios setup, if not, use any one of the below links and setup the Nagios server. Here, in this post, we will add Linux host to the Nagios monitoring tool using the NRPE plugin. In the last article, we discussed the installation of Nagios server on CentOS 8, CentOS 7, Ubuntu 18.04 / 16.
0 Comments
Leave a Reply. |