Don't know how to setup an openITCOCKPIT development system? Read our guide: Creating a openITCOCKPIT Development System
openITCOCKPIT uses a plugin-based system for checking the status of hosts and services. The Plugin API of openITCOCKPIT is 100% compatible to the Nagios, Naemon, Shinken and Icinga 1.x Plugin API. By default, openITCOCKPIT comes with a preset of standard plugins to check basic network features such as ports, running processes, cpu usage and so on.
In some cases, it can be handy to develop an own specialized plugin for a deep application monitoring.
Plugins for openITCOCKPIT can be written in any language. From a simple bash script to a complex Python or C binary – everything is possible. For some languages like Perl or Python there are even helper classes that make plugin development much faster and easier.
A plugin needs to fulfill at least the following requirements to be compatible with openITCOCKPIT.
- Script or binary has to be executable
- Exit with a valid return code (see below)
- Return at least one line of text (plugin output) to STDOUT
The default set of plugins shipped with openITCOCKPIT is located at /opt/openitc/nagios/libexec.
It is recommended (but not necessary) to create a separate folder for custom plugins like /opt/openitc/my_checks/.
The underlying monitoring engine of openITCOCKPIT uses the provided return code (exit code) of a plugin to determine the state of a host or service.
By default the "Plugin output" has to be one line to STDOUT like in this example:
openITCOCKPIT supports BBCode for styling or embedding hyperlinks in the plugin output.
Performance data (metrics)
Performance data (metrics) gets used by openITCOCKPIT to create charts for the interface, notifications and Grafana.
Performance data gets separated from the plugin output by a pipe (|) character. It is optional if a plugin returns performance data or not.
The format of performance data is the following
- A space seperated list of label/value pairs
- If the label contains a space sounding single quotes (') are required
- Numeric values has to be US format (10.5 instead of 10,5)
- optional unit of measurement like s, ms, or kg
- Optional warning threshold
- Optional critical threshold
- Optional miniumum value
- Optional maximum value
|Example Plugin Output||Legend|
|PING OK - Packet loss = 0%, RTA = 17.30 ms|rta=17.302000ms;100.000000;500.000000;0.000000 pl=0%;20;60;0|
Long plugin output
If a plugin returns more than one output line, all other lines are saved as long plugin output.