Collectd::Plugin::Write::Message::Passing - Write collectd metrics via Message::Passing
<LoadPlugin perl> Globals true </LoadPlugin> <Plugin perl> BaseName "Collectd::Plugin" LoadPlugin "Write::Message::Passing" <Plugin "Write::Message::Passing"> # MANDATORY - You MUST configure an output class outputclass "ZeroMQ" <outputoptions> connect "tcp://192.168.0.1:5552" </outputoptions> # OPTIONAL - Defaults to JSON #encoderclass "JSON" #<encoderoptions> # pretty "0" #</encoderoptions> </Plugin> </Plugin> Will emit 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":"GAUGE" }, { "value":0.13, "min":0, "max":100, "name":"midterm", "type":"GAUGE" }, { "value":0.08 "min":0, "max":100, "name":"longterm", "type":"GAUGE" } ], "interval":10, "host":"t0m.local" }
A collectd plugin to emit metrics from collectd into Message::Passing.
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::Output:: will be prepended. Required.
+
Message::Passing::Output::
The hash of options for the output class. Not required, but almost certainly needed.
The name of the class which will act the Message::Passing encoder. Will be used as-is if prefixed with +, otherwise Message::Passing::Filter::Encoder:: will be prepended. Optional, defaults to JSON.
Message::Passing::Filter::Encoder::
The hash of options for the encoder class.
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 $OUTPUT
$OUTPUT
Writes a metric to the output in $OUTPUT.
Never enters the AnyEvent event loop, and therefore may only work reliably with (and is only tested with) Message::Passing::Output::ZeroMQ.
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.