Page tree
Skip to end of metadata
Go to start of metadata

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.


Plugin Overview

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

Plugin locations

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/.

Return codes

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.

HostsServices
Plugin Return CodeHost state
0
UP 
1
DOWN
2
UNREACHABLE
Plugin Return CodeService state
0
OK
1
WARNING
2
CRITICAL
3
UNKNOWN

Plugin output

By default the "Plugin output" has to be one line to STDOUT like in this example:

Example Plugin
#!/bin/bash

echo "This is the minimum plugin output"

# Return with status UP or OK
exit 0

openITCOCKPIT supports BBCode for styling or embedding hyperlinks in the plugin output.

Example Plugin
echo "This os [b]bold text[/b]"

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

'label'=value[UOM];[warn];[crit];[min];[max]
  1. A space seperated list of label/value pairs
  2. If the label contains a space sounding single quotes (') are required
  3. Numeric values has to be US format (10.5 instead of 10,5)
  4. optional unit of measurement like s, ms, or kg
    1. Optional warning threshold
    2. Optional critical threshold
    3. Optional miniumum value
    4. Optional maximum value



Example Plugin OutputLegend
PING OK - Packet loss = 0%, RTA = 17.30 ms|rta=17.302000ms;100.000000;500.000000;0.000000 pl=0%;20;60;0

Plugin Output

Performance Data


Long plugin output

If a plugin returns more than one output line, all other lines are saved as long plugin output.


  • No labels