collectd_rabbitmq package

Submodules

collectd_rabbitmq.rabbit module

python plugin for collectd to obtain rabbitmq stats

class collectd_rabbitmq.rabbit.RabbitMQStats(config)[source]

Bases: object

Class to interface with the RabbitMQ API.

get_exchange_names(vhost_name=None)[source]

Returns a list of all exchange names.

get_exchange_stats(exchange_name=None, vhost_name=None)[source]

Returns a dictionary of stats for exchange_name.

get_exchanges(vhost_name=None)[source]

Returns raw exchange data.

get_info(*args)[source]

return JSON object from URL.

static get_names(items)[source]

Return URL encoded names.

get_nodes()[source]

Return a list of nodes.

get_queue_names(vhost_name=None)[source]

Returns a list of all queue names.

get_queue_stats(queue_name=None, vhost_name=None)[source]

Returns a dictionary of stats for queue_name.

get_queues(vhost_name=None)[source]

Returns raw queue data.

get_stats(stat_type, stat_name, vhost_name)[source]

Returns a dictionary of stats.

get_vhost_names()[source]

Returns a list of vhost names.

get_vhosts()[source]

Returns a list of vhosts.

nodes

Return a list of nodes.

vhost_names

Returns a list of vhost names.

collectd_rabbitmq.collectd_plugin module

This module controls the interactions with collectd

class collectd_rabbitmq.collectd_plugin.CollectdPlugin[source]

Bases: object

Controls interaction between rabbitmq stats and collectd.

dispatch_exchanges(vhost_name)[source]

Dispatches exchange data for vhost_name.

dispatch_message_stats(data, vhost, plugin, plugin_instance)[source]

Sends message stats to collectd.

dispatch_nodes()[source]

Dispatches nodes stats.

dispatch_queues(vhost_name)[source]

Dispatches queue data for vhost_name.

static dispatch_values(values, host, plugin, plugin_instance, metric_type, type_instance=None)[source]

Dispatch metrics to collectd.

Parameters:
  • (tuple or list) (values) – The values to dispatch. It will be coerced into a list.
  • host – (str): The name of the vhost.
  • (str) (plugin_instance) – The name of the plugin. Should be queue/exchange.
  • (str) – The queue/exchange name.
  • metric_type – (str): The name of metric.
  • type_instance – Optional.
static generate_vhost_name(name)[source]

Generate a “normalized” vhost name without /.

message_details = ['avg', 'avg_rate', 'rate', 'sample']
message_stats = ['ack', 'publish', 'publish_in', 'publish_out', 'confirm', 'deliver', 'deliver_noack', 'get', 'get_noack', 'deliver_get', 'redeliver', 'return']
node_stats = ['disk_free', 'disk_free_limit', 'fd_total', 'fd_used', 'mem_limit', 'mem_used', 'proc_total', 'proc_used', 'processors', 'run_queue', 'sockets_total', 'sockets_used']
read()[source]

Dispatches values to collectd.

collectd_rabbitmq.collectd_plugin.configure(config_values)[source]

Converts a collectd configuration into rabbitmq configuration.

collectd_rabbitmq.collectd_plugin.init()[source]

Creates the logs stash plugin object.

collectd_rabbitmq.collectd_plugin.read()[source]

Reads and dispatches data.

collectd_rabbitmq.utils module

Module that contains utility classes and functions

class collectd_rabbitmq.utils.Auth(username='guest', password='guest', realm=None)[source]

Bases: object

Stores Auth data.

class collectd_rabbitmq.utils.Config(auth, connection, data_to_ignore=None)[source]

Bases: object

Class that contains configuration data.

is_ignored(stat_type, name)[source]

Return true if name of type qtype should be ignored.

class collectd_rabbitmq.utils.ConnectionInfo(host='localhost', port=15672, scheme='http')[source]

Bases: object

Stores connection information.

url

Returns a url made from scheme, host and port.

collectd_rabbitmq.utils.filter_dictionary(dictionary, keys)[source]

Returns a dictionary with only keys.

collectd_rabbitmq.utils.is_sequence(arg)[source]

Returns true if arg behaves like a sequence, unless it also implements strip, such as strings.

Module contents