curl http://pkg.ci.collectd.org/pubkey.asc | sudo apt-key add -
sudo bash -c 'echo "deb http://pkg.ci.collectd.org/deb/ trusty collectd-5.5" > /etc/apt/sources.list.d/collectd-ci.list'
sudo apt-get update
sudo apt-get install collectd # This should install collectd version 5.5.x
wget https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.1/rabbitmq-server_3.6.1-1_all.deb
sudo apt-get install erlang-nox
sudo dpkg -i rabbitmq-server_3.6.1-1_all.deb
Edit /etc/collectd/collectd.conf and uncomment the line:
LoadPlugin amqp
Add the following lines in /etc/collectd/collectd.conf
<Plugin amqp>
<Publish "name">
Host "localhost"
Port "5672"
VHost "/"
User "guest"
Password "guest"
Exchange "collectd.amq.fanout"
ExchangeType "fanout"
RoutingKey "collectd"
Persistent false
StoreRates false
ConnectionRetryDelay 0
Format "json"
</Publish>
</Plugin>
In Rabbitmq management webapp, create a new exchange named collectd.amq.fanout
of type fanout
. The Format
parameter supports 3 formats:
- json
- command
- graphite
You can check the results running the python script in the gist after installing pika:
sudo pip install pika