Custom Nagios plugins

Nagios is a well-known monitoring framework; it’s also known for its plugins, the software components that are actually providing monitoring capabilities.
IPNetwork allows using Nagios plugins directly; we have detailed instructions on setting up and using Nagios plugins; below is the essence of these instructions.
Plugins can be anything executable — a native application, a script file (including shell scripts or PowerShell scripts), and so on. There are straightforward development guidelines, and the important part is that the plugin follows the expected output format and exit codes. This makes it possible to replace one custom check with another later without changing the overall monitoring approach.
Cygwin environment
Cygwin remains a workable way to run Unix-like tools on Windows, and we provide detailed instructions on setting up the Cygwin version of Nagios plugins. However, it is best viewed as a compatibility layer that you are responsible for keeping updated, together with the plugin build itself.
You can use any Cygwin-built executable or script as a Nagios plugin, provided it follows the corresponding guidelines. In many cases, though, this is the more maintenance-heavy option compared with a native Linux or SSH-based setup.
Windows Subsystem for Linux
Windows Subsystem for Linux can be used instead of Cygwin on supported Windows systems. Current Microsoft guidance uses the wsl –install workflow on Windows 10 version 2004 and later, or Windows 11, and new Linux installs use WSL 2 by default.
We provide instructions and monitor definition examples for running WSL-based Nagios plugins. Although Ubuntu is used as an example, any supported Linux distribution will do. WSL is generally the simpler local environment for creating and running Nagios plugins on Windows.
WSL-based plugins can be called either through “Script or Program” or through “SSH Script or Program”. As our current documentation notes, direct Bash-based execution requires the monitoring service to run under a Windows account that has access to WSL; otherwise, using SSH to the WSL environment or to another Unix-like host is usually cleaner.
External Nagios host
Typically, Nagios can be run and accessed from any OS type. Similarly, “Script or Program”/”SSH Script or Program” monitor types can be used. Please follow the corresponding OS’ guidelines on installing/building Nagios plugins.
Writing custom plugins
When in need of creating a custom monitor, you can consider using Nagios plugins interface for it. That way, you will easily integrate the custom script or program into existing monitoring environment. If you needed to replace it later, you would only have to replace it with a different plugin, as long as they both conform to corresponding calling standard. Whatever approach you use, it is worth running the plugin manually in the command line first and using verbose output where available, because this usually reveals parameter, dependency, or environment problems before the monitor is created in IPNetwork Monitor.
Do you need assistance writing or setting up your own Nagios plugin within IPNetwork Monitor? Please let us know.