The collectd API, the selection of available plugins (90+) coupled with the modular nature of collectd architecture, provides a generic path to expose platform statistics from all existing plugins and newly developed plugins to OpenStack or other fault management applications.
collectd also has bindings for several programming languages, which allows a developer to implement a plug-in in their language of choice, without having to modify the receiver of the collected metrics, for example Ceilometer itself.
Statistics in collectd consist of a value list. A value list includes:
meta data: an opaque data structure that enables the passing of additional information about a value list. “Meta data in the global cache can be used to store arbitrary information about an identifier”
Host, plugin, plugin instance, type and type instance uniquely identify a collectd value
Values lists are often accompanied by data sets that describe the values in more detail. Data sets consist of:
Examples of types in types.db:
bitrate value:GAUGE:0:4294967295
counter value:COUNTER:U:U
if_octets rx:COUNTER:0:4294967295,tx:COUNTER:0:4294967295
In the example above if_octets has two data sources: tx and rx.
Notifications in collectd are generic messages containing:
https://collectd.org/documentation/manpages/collectd-threshold.5.shtml
Example of a script used by the exec plugin to write notifications to a file /tmp/notifications :
<Plugin exec>
# Exec "user:group" "/path/to/exec"
NotificationExec "stack" "write_notification.sh"
</Plugin>
write_notification.sh just writes the notification passed from exec through STDIN to a file (/tmp/notifications).
#!/bin/bash
rm /tmp/notifications
while read x y
do
echo $x$y >> /tmp/notifications
done
an example generated file is shown below:
cat /tmp/notifications contents
Severity:FAILURE
Time:1472552207.385
Host:pod3-node1
Plugin:dpdkevents
PluginInstance:dpdk0
Type:gauge
TypeInstance:link_status
DataSource:value
CurrentValue:1.000000e+00
WarningMin:nan
WarningMax:nan
FailureMin:2.000000e+00
FailureMax:nan
Hostpod3-node1, plugin dpdkevents (instance dpdk0) type gauge (instance link_status): Data source "value" is currently 1.000000. That is below the failure threshold of 2.000000.
Submit statistics and notifications to the daemon as well as query the current value of collected statistics.
Plugins currently using this protocol are Exec (partially) and UnixSock
Please see https://wiki.opnfv.org/display/fastpath/Collectd+how+to+implement+a+simple+plugin
Coding Style: https://wiki.ith.intel.com/display/HA/CollectD+plugin+code+style
https://collectd.org/faq.shtml
https://collectd.org/documentation.shtml
https://collectd.org/wiki/index.php/Notifications_and_thresholds
https://collectd.org/wiki/index.php/First_steps
https://collectd.org/wiki/index.php/Plugin_architecture
https://www.netways.de/fileadmin/images/Events_Trainings/Events/OSMC/2015/Slides_2015/collectd_Thresholds_Plugin_and_Icinga_-_Florian_Forster.pdf
https://collectd.org/documentation/manpages/collectd.conf.5.shtml