Skip to content

How to Monitor CPU, Disk and Load on Linux with NRPE and Nagios

Updated 3 min read

Updated: 28 September 2026 · Applies to: NRPE 4.1 with Nagios plugins 2.4 and 2.5 on AlmaLinux and Rocky Linux 9 and 10 (EPEL), Ubuntu 24.04 and 26.04, Debian 13

NRPE (Nagios Remote Plugin Executor) lets a Nagios server run checks on another Linux server: load, disk space, swap, processes and anything else a plugin can measure. The monitored server runs the small NRPE service on TCP port 5666, and the Nagios server asks it for results with check_nrpe. We tested the setup below with NRPE 4.1.2 on AlmaLinux 9.

1. Install NRPE on the monitored server

dnf install epel-release
dnf install nrpe nagios-plugins-load nagios-plugins-disk nagios-plugins-swap nagios-plugins-procs nagios-plugins-users   # AlmaLinux, Rocky Linux
apt install nagios-nrpe-server monitoring-plugins-basic                                                                   # Ubuntu, Debian

2. Allow your Nagios server

In /etc/nagios/nrpe.cfg, add the Nagios server's address to allowed_hosts:

allowed_hosts=127.0.0.1,::1,203.0.113.50

Only listed addresses may ask for results.

3. Define the checks

Put your own commands in a separate file, /etc/nrpe.d/checks.cfg (on Ubuntu and Debian, /etc/nagios/nrpe.d/checks.cfg, with plugins in /usr/lib/nagios/plugins):

command[check_root_disk]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /
command[check_load]=/usr/lib64/nagios/plugins/check_load -r -w 2,1.5,1 -c 4,3,2
command[check_swap]=/usr/lib64/nagios/plugins/check_swap -w 20% -c 10%
command[check_zombies]=/usr/lib64/nagios/plugins/check_procs -w 5 -c 10 -s Z

-w and -c are the warning and critical limits. check_load -r divides the load by the number of CPU cores, so the same limits suit small and large servers. The standard plugins have no check for RAM use; a small third-party script is common for that, while swap use (above) shows memory pressure.

4. Start NRPE and open the port

systemctl enable --now nrpe                    # AlmaLinux, Rocky Linux
systemctl restart nagios-nrpe-server           # Ubuntu, Debian
firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="203.0.113.50" port port="5666" protocol="tcp" accept'
firewall-cmd --reload

5. Test from the Nagios server

/usr/lib64/nagios/plugins/check_nrpe -H 203.0.113.10                 # prints the NRPE version
/usr/lib64/nagios/plugins/check_nrpe -H 203.0.113.10 -c check_root_disk

A result such as DISK OK - free space: / ... means everything works. Install check_nrpe there with dnf install nagios-plugins-nrpe or apt install nagios-nrpe-plugin.

6. Add the service in Nagios

define service {
    use                   generic-service
    host_name             web1
    service_description   Root disk
    check_command         check_nrpe!check_root_disk
}

Common problems

  • "CHECK_NRPE: Error - Could not connect ... Connection refused": NRPE does not run, or a firewall blocks port 5666.
  • "CHECK_NRPE: (ssl_err != 5) Could not complete SSL handshake" or the connection closes at once: the Nagios server is not in allowed_hosts. Restart NRPE after changing it.
  • "NRPE: Command 'x' not defined": a typo in the command name, or the file in nrpe.d was not loaded; check include_dir in nrpe.cfg.

Official documentation: NRPE on GitHub and check_disk (Monitoring Plugins).

Related services

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Unmanaged dedicated servers

full root access and free IPMI KVM, with Free Basic Managed Support.

Linux server management

hardening, patching, monitoring and automation for Ubuntu, Debian, RHEL and AlmaLinux.

Was this answer helpful?

Still stuck? Open a ticket