Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The following configuration options should be supported by snmp_agent collectd plugin:  

...

Block

...

Name

...

Description

...

Comment

...

Table

...

Block <Data>

...

The Data block defines a list OIDs that are to be handled inside the table.

...

Should be defined inside the table

...

 

...

IndexOID

<Table> – Defines a table consisting of several Data blocks being its columns.
    IndexOID (optional) OID that is handled by the plugin and is mapped to numerical index value that is
                                          generated by the plugin for each table record.

...

Optional

   

...

SizeOID

...

(optional) OID that is handled by the plugin. Returned value is the number of records in the table.
    <Data> – defines table

...

Optional

...

Data

...

 

...

The Data block defines Scalar OIDs.

...

Should be defined outside the table

...

 

...

Plugin

column while being inside Table block.
        <IndexKey> - Contains all data to build snmp table index.
            Source – This value indicates which field of corresponding collectd metric is taken as a key in SNMP
                            table index.
            Regex (optional) – This option can be used to parse variables out of field given in Source.
            Group (optional) – Can be specified in case groups are used in Regex.
        </IndexKey>
        Plugin Read plugin name whose collected data will be mapped to specified OIDs.
   

...

 

...

  Type

...

Collectd's type that is to be used for specified OID.

...

Types are read from the collectd TypesDB.
     

...

  TypeInstance

...

Collectd's type-instance that is to be used for specified OID.
 

...

   

...

  OIDs

...

Configures the OIDs to be handled by plugin. Values for these OIDs are taken from collectd data
                    type specified by Plugin, Type, TypeInstance fields of this block. Number of the OIDs configured
                    should correspond to number of values in specified Type.

...

For example two

...

OIDs "IF-MIB::ifInOctets"
                    "IF-MIB::ifOutOctets" can be mapped to "rx" and "tx" values of "if_octets" type.
     

...

Scale

...

  Scale (optional) – Values taken from collectd are multiplied by

...

this value.

...

The field is optional and the default is 1.0.

...

 

...

Shift

...

        Shift (optional) – Is added to values from collectd after they have been multiplied by Scale value.

...


    </Data>
    …
</Table>

<Data> – defines scalar field, must be put outside Table block
    Plugin – (see above)
    PluginInstance – Allowed only for scalars. It is used to map a field of a specific plugin instance.
    Type – (see above)
    TypeInstance – (see above)
    OIDs – (see above)
    Scale – (see above)
    Shift – (see above)
</Data>


...

The field is optional and the default value is 0.0.

 

Here is an example of the plugin configuration section of collectd.conf file:

  <Plugin snmp_agent>
        <Data "memAvailReal">
              Plugin "memory"
              Type "memory"
              TypeInstance "free"
              OIDs "1.3.6.1.4.1.2021.4.6.0"
        </Data>
        <Table "ifTable">
              IndexOID "IF-MIB::ifIndex"
              SizeOID "IF-MIB::ifNumber"
              <Data "ifDescr">

        Instance true

                    <IndexKey>
                Source “PluginInstance”
            </IndexKey>
            Plugin "interface"
                    OIDs "IF-MIB::ifDescr"
              </Data>
              <Data "ifOctets">
                    Plugin "interface"
                    Type "if_octets"
                    TypeInstance ""
                    OIDs "IF-MIB::ifInOctets" "IF-MIB::ifOutOctets"
              </Data>
        </Table>
  </Plugin>


Implementation details

 

Figure 8. SNMP Agent plugin design.

...