Install Nagios Plugins on Rocky Linux 8

|
Last Updated:
|
|

This guide will walk you through how to install Nagios Plugins on Rocky Linux 8. Nagios plugins are standalone extensions to Nagios Core that enables Nagios to monitor databases, operating systems, services, applications, network equipment, protocols etc.

To use Nagios Plugins, you need to have installed and Setup Nagios Core server. Follow the link below to install Nagios server on Rocky Linux 8.

Install Nagios Server on Rocky Linux 8

Installing Nagios Plugins on Rocky Linux 8

Once you have setup the Nagios Core server, proceed to install the Nagios plugins.

Well, there are two ways in which you can install Nagios Plugins:

  1. Building Nagios Plugins from the source
  2. Installing Nagios Plugins from EPEL Repos (Probably the easiest)

We will cover the two installation methods.

Building Nagios Plugins from the Source on Rocky Linux 8

Install Required Build Tools and Dependencies

Nagios plugins are build from the source code. Hence, you need to install required build tools and dependencies.

Some of the packages below might have been installed if you followed the Nagios guide above.

dnf install gcc glibc glibc-common make gettext automake autoconf wget openssl-devel

Download Nagios Plugins Source Code

Check for any latest Nagios plugins on Nagios Plugins page.

Next, download Nagios plugins source code.

wget http://www.nagios-plugins.org/download/nagios-plugins-2.3.3.tar.gz

Extract Nagios Plugins

Once downloaded, extract it by running the command below

tar xzf nagios-plugins-2.3.3.tar.gz

Configure Nagios Plugins

Navigate to Nagios plugins source directory and run the configure script to adapt the plugins to the system and check for any missing dependency.

cd nagios-plugins-2.3.3
./configure --with-nagios-user=nagios --with-nagios-group=nagios

Compile Nagios Plugins on Rocky Linux 8

If there is no configuration error, proceed to compile Nagios.

Ensure that user nagios is already created before you can proceed. You might need to install NRPE agent first.

getent passwd nagios
nagios:x:974:974::/var/spool/nagios:/sbin/nologin

The compile Nagios plugins.

make

Install Nagios Plugins

You can now run the command below to install Nagios Plugins;

make install

This will install default Nagios plugins under the /usr/local/nagios/libexec/ directory.

ls /usr/local/nagios/libexec/

check_apt
check_breeze
check_by_ssh
check_clamd
check_cluster
check_dhcp
check_disk
check_disk_smb
check_dummy
check_file_age
check_flexlm
check_ftp
check_http
check_icmp
check_ide_smart
check_ifoperstatus
check_ifstatus
check_imap
check_ircd
check_jabber
check_ldap
check_ldaps
check_load
check_log
check_mailq
check_mrtg
check_mrtgtraf
check_nagios
check_nntp
check_nntps
check_nt
check_ntp
check_ntp_peer
check_ntp_time
check_nwstat
check_oracle
check_overcr
check_ping
check_pop
check_procs
check_real
check_rpc
check_sensors
check_simap
check_smtp
check_spop
check_ssh
check_ssl_validity
check_ssmtp
check_swap
check_tcp
check_time
check_udp
check_ups
check_uptime
check_users
check_wave
negate
remove_perfdata
urlize
utils.pm
utils.sh

Restart Nagios Core service

Now restart Nagios core service.

systemctl restart nagios

After that, login Nagios Server Web interface on the browser to confirm that the localhost services and state are now being monitored.

Check the local host status by clicking on the Hosts under Current Status on the left panel.

Install Nagios Plugins on Rocky Linux 8

Check the status of the localhost services by clicking Services under Current Status on the left panel.

service status

There you go. You have successfully installed Nagios Plugins on Rocky Linux 8 for localhost state and and service status monitoring.

Install Nagios Plugins from EPEL Repository

It is also possible to install Nagios plugins from EPEL repository.

Install EPEL repository on Rocky Linux 8

dnf install epel-release

Once the installation is done, you can search for the available Nagios plugins by running the command below;

dnf search nagios-plugins-*

====================================================================== Name Matched: nagios-plugins-* ======================================================================
nagios-plugins-all.x86_64 : Nagios Plugins - All plugins
nagios-plugins-apt.x86_64 : Nagios Plugin - check_apt
nagios-plugins-bonding.x86_64 : Nagios plugin to monitor Linux bonding interfaces
nagios-plugins-breeze.x86_64 : Nagios Plugin - check_breeze
nagios-plugins-by_ssh.x86_64 : Nagios Plugin - check_by_ssh
nagios-plugins-check-updates.x86_64 : A Nagios plugin to check if Red Hat or Fedora system is up-to-date
nagios-plugins-cluster.x86_64 : Nagios Plugin - check_cluster
nagios-plugins-dbi.x86_64 : Nagios Plugin - check_dbi
nagios-plugins-dhcp.x86_64 : Nagios Plugin - check_dhcp
nagios-plugins-dig.x86_64 : Nagios Plugin - check_dig
nagios-plugins-disk.x86_64 : Nagios Plugin - check_disk
nagios-plugins-disk_smb.x86_64 : Nagios Plugin - check_disk_smb
nagios-plugins-dns.x86_64 : Nagios Plugin - check_dns
nagios-plugins-dummy.x86_64 : Nagios Plugin - check_dummy
nagios-plugins-file_age.x86_64 : Nagios Plugin - check_file_age
nagios-plugins-flexlm.x86_64 : Nagios Plugin - check_flexlm
nagios-plugins-fping.x86_64 : Nagios Plugin - check_fping
nagios-plugins-fts.noarch : Nagios probes to be run remotely against FTS3 machines
nagios-plugins-hpjd.x86_64 : Nagios Plugin - check_hpjd
nagios-plugins-http.x86_64 : Nagios Plugin - check_http
nagios-plugins-icmp.x86_64 : Nagios Plugin - check_icmp
nagios-plugins-ide_smart.x86_64 : Nagios Plugin - check_ide_smart
nagios-plugins-ifoperstatus.x86_64 : Nagios Plugin - check_ifoperstatus
nagios-plugins-ifstatus.x86_64 : Nagios Plugin - check_ifstatus
nagios-plugins-ircd.x86_64 : Nagios Plugin - check_ircd
nagios-plugins-ldap.x86_64 : Nagios Plugin - check_ldap
nagios-plugins-load.x86_64 : Nagios Plugin - check_load
nagios-plugins-log.x86_64 : Nagios Plugin - check_log
nagios-plugins-mailq.x86_64 : Nagios Plugin - check_mailq
nagios-plugins-mrtg.x86_64 : Nagios Plugin - check_mrtg
nagios-plugins-mrtgtraf.x86_64 : Nagios Plugin - check_mrtgtraf
nagios-plugins-mysql.x86_64 : Nagios Plugin - check_mysql
nagios-plugins-nagios.x86_64 : Nagios Plugin - check_nagios
nagios-plugins-nrpe.x86_64 : Provides nrpe plugin for Nagios
nagios-plugins-nt.x86_64 : Nagios Plugin - check_nt
nagios-plugins-ntp.x86_64 : Nagios Plugin - check_ntp
nagios-plugins-nwstat.x86_64 : Nagios Plugin - check_nwstat
nagios-plugins-openmanage.x86_64 : Nagios plugin to monitor hardware health on Dell servers
nagios-plugins-oracle.x86_64 : Nagios Plugin - check_oracle
nagios-plugins-overcr.x86_64 : Nagios Plugin - check_overcr
nagios-plugins-perl.x86_64 : Nagios plugins perl dep.
nagios-plugins-pgsql.x86_64 : Nagios Plugin - check_pgsql
nagios-plugins-ping.x86_64 : Nagios Plugin - check_ping
nagios-plugins-procs.x86_64 : Nagios Plugin - check_procs
nagios-plugins-radius.x86_64 : Nagios Plugin - check_radius
nagios-plugins-real.x86_64 : Nagios Plugin - check_real
nagios-plugins-remove_perfdata.x86_64 : Nagios plugin tool to remove perf data
nagios-plugins-rpc.x86_64 : Nagios Plugin - check_rpc
nagios-plugins-sensors.x86_64 : Nagios Plugin - check_sensors
nagios-plugins-smtp.x86_64 : Nagios Plugin - check_smtp
nagios-plugins-snmp.x86_64 : Nagios Plugin - check_snmp
nagios-plugins-ssh.x86_64 : Nagios Plugin - check_ssh
nagios-plugins-ssl_validity.x86_64 : Nagios Plugin - check_ssl_validity
nagios-plugins-swap.x86_64 : Nagios Plugin - check_swap
nagios-plugins-tcp.x86_64 : Nagios Plugin - check_tcp
nagios-plugins-time.x86_64 : Nagios Plugin - check_time
nagios-plugins-ups.x86_64 : Nagios Plugin - check_ups
nagios-plugins-uptime.x86_64 : Nagios Plugin - check_uptime
nagios-plugins-users.x86_64 : Nagios Plugin - check_users
nagios-plugins-wave.x86_64 : Nagios Plugin - check_wave

You can also run the command below to list all plugins.

dnf list nagios-plugins-*

You can now install the specific plugins that you require. For example, to install Nagios plugins that checks the load, http, users, processes, disk space, swap space, uptime,dns, run the command below;

dnf install nagios-plugins-{load,http,users,procs,disk,swap,nrpe,uptime,dns}

Plugins that are installed using the package manager as stored under /usr/lib64/nagios/plugins/.

ls -1 /usr/lib64/nagios/plugins/
check_disk
check_dns
check_http
check_load
check_nrpe
check_procs
check_swap
check_uptime
check_users
eventhandlers
negate
urlize
utils.sh

There you go.

In our next guide, we will discuss how to install Nagios Remote Execution Plugins for remote host monitoring.

See Other similar guides by following the link below;

Nagios SNMP Monitoring of Linux Hosts on AlienVault USM/OSSIM

How to Install Nagios Plugins and NRPE agents on CentOS 7/RHEL 7/Fedora 29

Configure Nagios Availability Monitoring on AlienVault USM/OSSIM

How to Install Nagios Plugins From Source RHEL/CentOS/Oracle Linux

SUPPORT US VIA A VIRTUAL CUP OF COFFEE

We're passionate about sharing our knowledge and experiences with you through our blog. If you appreciate our efforts, consider buying us a virtual coffee. Your support keeps us motivated and enables us to continually improve, ensuring that we can provide you with the best content possible. Thank you for being a coffee-fueled champion of our work!

Photo of author
gen_too
Co-founder of Kifarunix.com, Linux Tips and Tutorials. Linux/Unix admin and author at Kifarunix.com.

Leave a Comment