A Plugin is command-line script or executable to check the status of host or specific service. Whenever Nagios wants to check the service- or host-state it executes an plugin on the server or the remote host via NSClient++, check_by_ssh or NRPE.
About Nagios Plugins in general
As you know, Nagios monitors hosts and services on your network.
Actual host and service checks are performed by separate programs called plugins which return the host or service status to Nagios.
Because the Nagios daemon doesn't do the checks by itself, but uses the plugins to do this work, there are some essential rules for plugins.
A plugin must:
- give you exactly one line as feedback and
- exit with one of the following return codes:
- 0 = OK
- 1 = WARNING
- 2 = CRITICAL
- 3 = UNKNOWN
A plugin should:
- give you its own short usage documentation if its called with the parameter -h