What is collectd?

Why use collectd?

collectd architecture

collectd data flow

collectd statistics: 

Statistics in collectd consist of a value list. A value list includes:

collectd Values

Values, can be one of:

 

collectd Data Sets

Values lists are often accompanied by data sets that describe the values in more detail. Data sets consist of:

Examples of types in collectd

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.

 

collectd notifications

Notifications in collectd are generic messages containing:

Notifications and thresholds

https://collectd.org/documentation/manpages/collectd-threshold.5.shtml

 

Collectd cool features

Exec Plugin

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.

 

Collectd Plain Text Protocol

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

 

Filter Configuration

 

 

Network plugin

 


 

Writing a simple plugin

 

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

 

 

References

https://collectd.org/

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

https://collectd.org/wiki/index.php/Plain_text_protocol

https://collectd.org/wiki/index.php/Plugin_architecture