1080*80 ad

Installing Nagios Plugins on CentOS 8

How to Install Nagios Plugins on CentOS 8: A Step-by-Step Guide

A powerful Nagios Core setup is incomplete without its plugins. These plugins are the essential scripts and executables that perform the actual checks on your hosts and services, forming the backbone of your entire monitoring infrastructure. Whether you’re checking server load, disk space, or HTTP response times, the plugins do the heavy lifting.

This guide provides a clear, straightforward process for compiling and installing Nagios Plugins from source on a CentOS 8 server. Following these steps will ensure you have the standard, essential plugins ready to integrate with your Nagios Core instance.

Step 1: Install Required Dependencies

Before we can compile the plugins, we need to ensure our system has the necessary development tools and libraries. These packages provide the compiler and other components needed to build the software from its source code.

Open your terminal and run the following command to install the required packages using the DNF package manager. This command also enables the EPEL (Extra Packages for Enterprise Linux) repository, which is often useful for monitoring tools.

sudo dnf install -y gcc glibc glibc-common make gettext automake autoconf wget openssl-devel net-snmp net-snmp-utils epel-release

This command installs several crucial components, including:

  • gcc: The GNU Compiler Collection, used to compile the source code.
  • make: A utility that automates the build process.
  • wget: A tool for downloading files from the internet.
  • openssl-devel: Development libraries for SSL/TLS, required by many plugins.

Step 2: Download the Nagios Plugins Source Code

Next, we will download the latest stable version of the Nagios Plugins. It’s always a good practice to check the official Nagios Plugins downloads page for the most recent version number.

We’ll use the wget command to download the compressed source code archive directly to our server.

wget --no-check-certificate -O nagios-plugins.tar.gz https://github.com/nagios-plugins/nagios-plugins/archive/release-2.4.6.tar.gz

Once the download is complete, you will have a file named nagios-plugins.tar.gz in your current directory.

Step 3: Compile and Install the Plugins

With the source code downloaded, we can now extract, compile, and install it. This is a standard three-part process for many Linux applications.

First, extract the contents of the downloaded archive:

tar zxf nagios-plugins.tar.gz

This will create a new directory containing the source files. Navigate into that directory:

cd nagios-plugins-release-2.4.6/

(Note: Your directory name may differ slightly depending on the version you downloaded.)

Now, run the configure script. This script checks your system for all required dependencies and prepares the build environment. For proper permissions and security, it’s highly recommended to specify the Nagios user and group during this step.

./tools/setup
./configure --with-nagios-user=nagios --with-nagios-group=nagios

After the configure script finishes successfully, compile the plugins using the make command:

make

Finally, install the compiled plugins onto your system. This command will copy all the executable plugin files into the standard Nagios directory.

sudo make install

Step 4: Verify the Installation

The installation process is now complete. The plugins should be located in /usr/local/nagios/libexec/. You can verify this by listing the contents of that directory.

ls -l /usr/local/nagios/libexec/

You should see a long list of executable files, such as check_http, check_load, check_disk, and many others.

As a final check, you can run one of the plugins to see its help output. This confirms that it is executable and functioning correctly. For example, to check the check_http plugin:

/usr/local/nagios/libexec/check_http --help

This should return a detailed list of options and usage instructions for that specific plugin.

With the Nagios Plugins successfully installed, you are now ready to configure your Nagios Core server to use them. You can begin defining commands and service checks to build a comprehensive and powerful monitoring solution for your entire infrastructure.

Source: https://kifarunix.com/install-nagios-plugins-on-centos-8/

900*80 ad

      1080*80 ad