Nagios Plugin Execution Error — Quick Fix
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
- Forgetting that lazy evaluation defers computation until the value is forced, causing space leaks with unevaluated thunks
- Using
returnto exit a function early instead of wrapping a pure value in the monad - 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
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