Nagios Core check results come from executable plugins that return a status line and an exit code. A monitoring server can load its configuration without them, but common host and service checks such as ping, HTTP, disk, load, and users need the standard plugin commands on the same host that runs the checks.

On current Ubuntu package installs, the standard plugin set is split across monitoring-plugins-basic and monitoring-plugins-standard. The packages place commands under /usr/lib/nagios/plugins and add command-snippet files under /etc/nagios-plugins/config for packaged Nagios Core integrations.

A completed install should show the plugin packages in the package database, expose commands such as check_http and check_ping in the plugin directory, and run at least one plugin with an OK result. Source installs and some older distributions may use /usr/local/nagios/libexec or legacy package names, so keep command definitions aligned with the path that exists on the monitoring host.

Steps to install Nagios plugins:

  1. Open a terminal with sudo privileges on the Nagios Core host.
  2. Refresh the package index.
    $ sudo apt update
  3. Install the standard plugin packages.
    $ sudo apt install --assume-yes monitoring-plugins-basic monitoring-plugins-standard

    Debian also provides the monitoring-plugins metapackage for the standard plugin set. Current Ubuntu releases use the split package names above, and the old nagios-plugins package name may not have an install candidate.

  4. Confirm the plugin packages are installed.
    $ dpkg-query -W monitoring-plugins-basic monitoring-plugins-standard
    monitoring-plugins-basic	2.4.0-1ubuntu2
    monitoring-plugins-standard	2.4.0-1ubuntu2
  5. Check that common plugin commands exist in the packaged directory.
    $ ls /usr/lib/nagios/plugins/check_http /usr/lib/nagios/plugins/check_ping /usr/lib/nagios/plugins/check_dummy
    /usr/lib/nagios/plugins/check_dummy
    /usr/lib/nagios/plugins/check_http
    /usr/lib/nagios/plugins/check_ping
  6. Run a local ping check from the plugin directory.
    $ /usr/lib/nagios/plugins/check_ping -H 127.0.0.1 -w 100.0,20% -c 500.0,60% -p 1
    PING OK - Packet loss = 0%, RTA = 0.81 ms|rta=0.805000ms;100.000000;500.000000;0.000000 pl=0%;20;60;0;
  7. Run a plugin that does not need a network target.
    $ /usr/lib/nagios/plugins/check_dummy 0 "plugins installed"
    OK: plugins installed

    Run service-specific plugins as the nagios user before copying options into command or service objects.
    Related: How to run a Nagios plugin manually
    Related: How to define a Nagios Core check command