Collectd::Plugin::Read::Message::Passing - Read collectd metrics via Message::Passing
# Only tested with 1 read thread! ReadThreads 1 # You MUST setup types.db for all types you emit! TypesDB "/usr/share/collectd/types.db" TypesDB "/usr/local/share/collectd/types_local.db" <LoadPlugin perl> Globals true </LoadPlugin> <Plugin perl> BaseName "Collectd::Plugin" LoadPlugin "Read::Message::Passing" <Plugin "Read::Message::Passing"> # MANDATORY - You MUST configure an output class inputclass "ZeroMQ" <inputoptions> socket_bind "tcp://192.168.0.1:5552" </inputoptions> # OPTIONAL - Defaults to JSON #decoderclass "JSON" #<decoderoptions> #</decoderoptions> </Plugin> </Plugin> Will consume metrics like this: { "plugin":"ElasticSearch", "time":1341656031.18621, "values":[ { "value":0, "min":0, "name":"indices.get.time", "max":0, "type":0 } ], "type":"indices.get.time", "interval":10, "host":"t0m.local" } or, for multi-value metrics: { "plugin":"load", "time":1341655869.22588, "type":"load", "values":[ { "value":0.41, "min":0,"max":100,"name":"shortterm","type":1 }, { "value":0.13, "min":0, "max":100, "name": "midterm", "type":1 }, { "value":0.08 "min":0, "max":100, "name":"longterm", "type":1 } ], "interval":10, "host":"t0m.local" }
A collectd plugin to consume metrics from Message::Passing into collectd.
WARNING: This plugin is pre-alpha, and is only tested with 1 collectd thread and the ZeroMQ Input.
NOTE: You MUST have registered any types you ingest in a types.db for collectd. Failure to do this can result in segfaults!
types.db
A hash containing the following:
The name of the class which will act as the Message::Passing output. Will be used as-is if prefixed with +, otherwise Message::Passing::Input:: will be prepended. Required.
+
Message::Passing::Input::
The hash of options for the input class. Not required, but almost certainly needed.
The name of the class which will act the Message::Passing decoder. Will be used as-is if prefixed with +, otherwise Message::Passing::Filter::Decoder:: will be prepended. Optional, defaults to JSON.
Message::Passing::Filter::Decoder::
The hash of options for the decoder class.
The amount of time to block in Message::Passing's read loop. Defaults to 0.25 seconds, which could not be enough if you are consuming a lot of metrics..
Called first with configuration in the config file, munges it into the format expected and places it into the %CONFIG hash.
%CONFIG
Validates the config, and initializes the $INPUT
$INPUT
Blocks for a metric to the output in $INPUT.
Blocking collectd for a fixed time to allow the AnyEvent loop to run is a horrible horrible way of reading.
See Message::Passing::Collectd.
To install Message::Passing::Collectd, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Message::Passing::Collectd
CPAN shell
perl -MCPAN -e shell install Message::Passing::Collectd
For more information on module installation, please visit the detailed CPAN module installation guide.