Discovery plugins

A discovery plugin (also called plugin) is a script that lists a set of similar elements such as file systems or network interfaces on a given equipment.

This plugins must be executable from the command line (shell) by the centreon user (or the user running the monitoring engine). It can be run locally or remotely using protocols such as SSH or NRPE.

The result must be a valid XML stream where each element must be described as an attribute of a XML node. This execution must be available using an option. The Centreon Plugins use ‘–mode=xxx –disco-show’.

For example:

# /usr/lib/centreon/plugins/centreon_linux_snmp.pl --mode=list-interfaces --hostname=192.168.220.129 --snmp-version=2 --snmp-community=public --disco-show
<?xml version="1.0" encoding="utf-8"?>
<data>
    <label status="1" name="lo" total="10" interfaceid="1"/>
    <label status="1" name="eth0" total="1000" interfaceid="2"/>
</data>

In the previous example, the name attribute corresponds to the network interface. The status describes the IFOPERSTATUS, total describes the IFSPEED of the interface and interfaceid describes the IFINDEX.

The discovery plugin should also list (XML output) the available XML attributes using an option. The The Centreon Plugins use ‘–mode=xxx –disco-format’.

For example:

# /usr/lib/centreon/plugins/centreon_linux_snmp.pl --mode=list-interfaces --hostname=127.0.0.1 --disco-format
<?xml version="1.0" encoding="utf-8"?>
<data>
    <element>name</element>
    <element>total</element>
    <element>status</element>
    <element>interfaceid</element>
</data>

Here, four attributes are available: name, total, status and interfaceid.