Skip to content

Nagios Plugin Execution Error — Quick Fix

DodaTech Updated 2026-06-24 2 min read

In this tutorial, you'll learn about Nagios Plugin Execution Error. We cover key concepts, practical examples, and best practices.

The Problem

A Nagios check returns "Plugin not found" or "NRPE: Unable to execute command." The plugin binary may be missing, lack executable permissions, or have unresolved library dependencies. The Nagios server or NRPE agent cannot run the check command.

Error example:

NRPE: Unable to execute command: check_disk
Plugin not found: /usr/lib/nagios/plugins/check_http
check_disk: error while loading shared libraries: libssl.so.1.1: cannot open shared object file

The Fix

Step 1: Verify the plugin exists and is executable

WRONG — assuming plugins are always installed:

# Plugins must be installed separately on each host

RIGHT — check the plugin file:

ls -la /usr/lib/nagios/plugins/check_http

Output:

-rw-r--r-- 1 root root 12345 Jun 24 10:00 /usr/lib/nagios/plugins/check_http

If the file exists but is not executable:

chmod +x /usr/lib/nagios/plugins/check_http

If the file does not exist:

# Install the plugins package
apt install nagios-plugins-contrib
# or
dnf install nagios-plugins-all

Step 2: Fix library dependencies

WRONG — ignoring missing library errors:

# The plugin will silently fail or return incorrect results

RIGHT — check and fix dependencies:

ldd /usr/lib/nagios/plugins/check_http

Output:

linux-vdso.so.1 (0x00007fff)
libssl.so.1.1 => not found
libcrypto.so.1.1 => not found

Install the missing libraries:

apt install libssl1.1

Use DodaTech's Plugin Dependency Checker to scan plugin directories for missing libraries and permission issues across all monitored hosts.

Prevention Tips

  • Install the full nagios-plugins package on all monitored hosts
  • Keep plugin packages updated with system updates
  • Test plugins locally after installation before adding them to Nagios configs
  • Use check_nrpe with the -d flag to debug plugin execution
  • Use DodaTech's Plugin Version Manager to track plugin versions across your fleet

Common Mistakes with plugin error

  1. Forgetting that lazy evaluation defers computation until the value is forced, causing space leaks with unevaluated thunks
  2. Using return to exit a function early instead of wrapping a pure value in the monad
  3. Mixing let bindings with <- bindings in do notation, producing type errors

These mistakes appear frequently in real-world NAGIOS code. DodaTech's contributors have identified these patterns through analysis of open-source projects and production systems.

Practice Exercise

Write a pure function that safely divides two integers using Maybe, then test it with edge cases like division by zero and negative numbers.

This exercise reinforces the concepts covered in this guide. Try implementing it before checking online solutions.

FAQ

### What is the difference between Nagios and NRPE plugins?

Nagios plugins run on the Nagios server (e.g., check_ping, check_http). NRPE plugins run on the remote host and are executed by the NRPE daemon. Both types share the same plugin format and return values but are located on different machines.

Why does a plugin work on the command line but not through Nagios?

The Nagios user (usually nagios) may not have permissions to execute the plugin or access the files it needs. Check that the plugin is executable by the nagios user and that any required files (log files, temp directories) are accessible.

How do I add a custom plugin to Nagios?

Place the plugin script in /usr/lib/nagios/plugins/ (or the Nagios plugins directory). Make it executable: chmod +x /usr/lib/nagios/plugins/custom_check.sh. Then define a command in Nagios configuration that references the plugin and its arguments.

Related: DodaTech's Nagios Plugin Library provides pre-built plugins for common infrastructure checks with documentation and dependency metadata.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro