Code Monkey home page Code Monkey logo

sensu-plugins-rabbitmq's Introduction

Sensu Bonsai Asset Build Status Gem Version Code Climate Test Coverage Dependency Status

Sensu Plugins RabbitMQ Plugin

Overview

This plugin provides native RabbitMQ instrumentation for monitoring and metrics collection, including service health, message, consumer, and queue health/metrics via rabbitmq_management, and more.

Files

  • bin/check-rabbitmq-alive.rb
  • bin/check-rabbitmq-amqp-alive.rb
  • bin/check-rabbitmq-cluster-health.rb
  • bin/check-rabbitmq-consumers.rb
  • bin/check-rabbitmq-consumer-utilisation.rb
  • bin/check-rabbitmq-messages.rb
  • bin/check-rabbitmq-network-partitions.rb
  • bin/check-rabbitmq-node-health.rb
  • bin/check-rabbitmq-node-usage.rb
  • bin/check-rabbitmq-queue-drain-time.rb
  • bin/check-rabbitmq-queue.rb
  • bin/check-rabbitmq-queues-synchronised.rb
  • bin/check-rabbitmq-stomp-alive.rb
  • bin/metrics-rabbitmq-overview.rb
  • bin/metrics-rabbitmq-queue.rb
  • bin/metrics-rabbitmq-exchange.rb

check-rabbitmq-alive Checks if RabbitMQ server is alive using the REST API.

check-rabbitmq-amqp-alive Checks if RabbitMQ server is alive using AMQP.

check-rabbitmq-cluster-health Checks if RabbitMQ server's cluster nodes are in a running state. Also accepts an optional list of nodes and verifies that those nodes are present in the cluster.

check-rabbitmq-consumers Checks the number of consumers on the RabbitMQ server.

check-rabbitmq-consumer-utilisation Checks the consumer utilisation percentage (the fraction of time in which the queue is able to immediately deliver messages to consumer). If this number drops in percentage this may result in slower message delivery and indicate issues with the queue.

check-rabbitmq-messages Checks the total number of messages queued on the RabbitMQ server.

check-rabbitmq-network-partitions Checks if a RabbitMQ network partition has occured.

check-rabbitmq-node-health Checks if RabbitMQ server node is in a running state.

check-rabbitmq-node-usage Checks and shows usage for RabbitMQ server node.

check-rabbitmq-queue-drain-time Checks the time it will take for each queue on the RabbitMQ server to drain based on the current message egress rate. For example, if a queue has 1,000 messages in it but egresses only 1 message per second, the alert would fire because this is greater than the default critical level of 360 seconds.

check-rabbitmq-queue Checks the number of messages queued on the RabbitMQ server in a specific queues.

check-rabbitmq-queues-synchronised Checks that all mirrored queues that have slaves are synchronised.

check-rabbitmq-stomp-alive Checks if RabbitMQ server is alive and responding to STOMP requests.

metrics-rabbitmq-overview Shows RabbitMQ 'overview' stats similar to those shown on the main page of the rabbitmq_management web UI.

metrics-rabbitmq-queue Gathers the following per-queue rabbitmq metrics: message count, average egress rate, "drain time" metric (the time a queue will take to reach 0 based on the egress rate), and consumer count.

metrics-rabbitmq-exchange Gathers all the available exchange metrics.

Usage examples

Help

check-rabbitmq-alive

Usage: check-rabbitmq-alive.rb (options)
    -w, --host HOST                  RabbitMQ host
    -i, --ini VALUE                  Configuration ini file
    -p, --password PASSWORD          RabbitMQ password
    -P, --port PORT                  RabbitMQ API port
        --ssl                        Enable SSL for connection to RabbitMQ
    -u, --username USERNAME          RabbitMQ username
        --verify_ssl_off             Do not check validity of SSL cert. Use for self-signed certs, etc (insecure)
    -v, --vhost VHOST                RabbitMQ vhost

metrics-rabbitmq-overview

Usage: metrics-rabbitmq-overview.rb (options)
        --host HOST                  RabbitMQ management API host
    -i, --ini VALUE                  Configuration ini file
        --password PASSWORD          RabbitMQ management API password
        --port PORT                  RabbitMQ management API port
        --scheme SCHEME              Metric naming scheme, text to prepend to $queue_name.$metric
        --ssl                        Enable SSL for connection to the API
        --username USER              RabbitMQ management API user

Configuration

Sensu Go

Asset registration

Assets are the best way to make use of this plugin. If you're not using an asset, please consider doing so! If you're using sensuctl 5.13 or later, you can use the following command to add the asset:

sensuctl asset add sensu-plugins/sensu-plugins-rabbitmq

If you're using an earlier version of sensuctl, you can download the asset definition from this project's Bonsai asset index page.

Asset definition

---
type: Asset
api_version: core/v2
metadata:
  name: sensu-plugins-rabbitmq
spec:
  url: https://assets.bonsai.sensu.io/7d56607309127ff0a9f6b198b3014a4f35b99e2b/sensu-plugins-rabbitmq_8.0.0_centos_linux_amd64.tar.gz
  sha512: a0c33a5649199efc4926cc0125923df1678191a81bd7f833136016c98d32aa399b75ba8433e8551f93b6c56ec09a2af31207b22544e25f085f559ffbac352d45

Check definition

---
type: CheckConfig
spec:
  command: "check-rabbitmq-alive.rb"
  handlers: []
  high_flap_threshold: 0
  interval: 10
  low_flap_threshold: 0
  publish: true
  runtime_assets:
  - sensu-plugins/sensu-plugins-rabbitmq
  - sensu/sensu-ruby-runtime
  subscriptions:
  - linux

Sensu Core

Check definition

{
  "checks": {
    "check-rabbitmq": {
      "command": "check-rabbitmq-alive.rb",
      "subscribers": ["linux"],
      "interval": 10,
      "refresh": 10,
      "handlers": ["influxdb"]
    }
  }
}

Installation from source

Sensu Go

See the instructions above for asset registration.

Sensu Core

Install and setup plugins on Sensu Core.

Additional notes

Sensu Go Ruby Runtime Assets

The Sensu assets packaged from this repository are built against the Sensu Ruby runtime environment. When using these assets as part of a Sensu Go resource (check, mutator, or handler), make sure to include the corresponding Sensu Ruby Runtime Asset in the list of assets needed by the resource.

Permissions

To run these checks, you need to set the following permissions:

:conf => '^aliveness-test$',
:write => '^amq\.default$',
:read => '.*'

You must also add the monitoring tag:

rabbitmqctl add_user sensu_monitoring $MY_SUPER_LONG_SECURE_PASSWORD
rabbitmqctl set_permissions  -p / sensu_monitoring "^aliveness-test$" "^amq\.default$" "^(amq\.default|aliveness-test)$"
rabbitmqctl set_user_tags sensu_monitoring monitoring

We recommended that you use minimum permissions and do not give administrator access.

Contributing

See CONTRIBUTING.md for information about contributing to this plugin.

sensu-plugins-rabbitmq's People

Contributors

analytically avatar bookest avatar bootswithdefer avatar br0ch0n avatar brianvans avatar chuckwired avatar dalesit avatar dependabot-support avatar eheydrick avatar eslamelhusseiny avatar fessyfoo avatar hany avatar hillaryfraley avatar jamieduby avatar kjord1 avatar majormoses avatar mattdoller avatar mattyjones avatar mdzidic avatar milosmdodic avatar monkey670 avatar multani avatar naftulikay avatar parisholley avatar pedroluislopez avatar portertech avatar rthouvenin avatar sean-kang avatar tas50 avatar thisisjaid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sensu-plugins-rabbitmq's Issues

Cluster Health - Can't modify frozen String

Examples:

Correct servers:

/opt/sensu/embedded/bin/check-rabbitmq-cluster-health.rb -w 10.0.0.6 -u monitoring -p pass -n rabbit1,rabbit2,rabbit3
CheckRabbitMQCluster OK: 3 healthy cluster nodes

One server is invalid:

/opt/sensu/embedded/bin/check-rabbitmq-cluster-health.rb -w 10.0.0.6 -u monitoring -p pass -n rabbit1,rabbit2,incorrect
CheckRabbitMQCluster UNKNOWN: can't modify frozen String

Versions:

  • Sensu 1.2.1
  • sensu-plugins-rabbitmq-4.1.0

400 "Bad Request" when running check-rabbitmq-queue.rb

I had to upgrade my rabbit server to ubuntu 14.04 and now I getting the following error when running this command:

ruby /etc/sensu/plugins/check-rabbitmq-queue.rb --h localhost --user --password --queue queuename -w 10 -c 20

Check failed to run: 400 "Bad Request", ["/usr/lib/ruby/2.3.0/net/http/response.rb:120:in error!'", "/var/lib/gems/2.3.0/gems/carrot-top-0.0.7/lib/carrot-top.rb:59:in fetch_uri'", "/var/lib/gems/2.3.0/gems/carrot-top-0.0.7/lib/carrot-top.rb:24:in query_api'", "/var/lib/gems/2.3.0/gems/carrot-top-0.0.7/lib/carrot-top.rb:28:in method_missing'", "/etc/sensu/plugins/check-rabbitmq-queue.rb:106:in run'", "/var/lib/gems/2.3.0/gems/sensu-plugin-2.3.0/lib/sensu-plugin/cli.rb:57:in block in class:CLI'"]

ruby version: ruby 2.3.5p376 (2017-09-14 revision 59905) [x86_64-linux-gnu]
gem version: 2.5.2.1

I have sensu-plugin, cli, check and carrot-top gems installed. (I couldn't find "socket" to install but looking at my old server, it doesnt have that installed either).

Any help is appreciated.

Dependabot can't resolve your Ruby dependency files

Dependabot can't resolve your Ruby dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Bundler::VersionConflict with message: Bundler could not find compatible versions for gem "bundler":
  In Gemfile:
    bundler (~> 1.7)

  Current Bundler version:
    bundler (2.2.15)

Your bundle requires a different version of Bundler than the one you're running.
Install the necessary version with `gem install bundler:1.17.3` and rerun bundler using `run.rb _1.17.3_`

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Checks are not sent to graphite

Hello,
Seems like the rabbitmq metrics are not sent to my graphite cluster. I have other metrics like CPU, memory, network traffic, all work and i receive traffic. But with these metrics it doesn't work.
Where you able to use these scripts are send metrics to graphite?
Thank you

undefined method zero?' for nil:NilClass while executing check-rabbitmq-queue-drain-time.rb

@majormoses Sometimes We are getting undefined method zero?' for nil:NilClass` while executing check-rabbitmq-queue-drain-time.rb check.Below is the complete error snippet

{"timestamp":"2019-03-04T00:51:07.881054+0000","level":"info","message":"publishing check result","payload":{"client":"sensu-redis-rmq-test","check":{"command":"/opt/sensu/embedded/bin/check-rabbitmq-queue-drain-time.rb","standalone":true,"handler":" ","contact":"","playbook":"","interval":60,"name":"checkRMQqueuedraintime","issued":1551660667,"executed":1551660667,"duration":0.205,"output":"Check failed to run: undefined method `zero?' for nil:NilClass, [\"/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-plugins-rabbitmq-6.0.0/bin/check-rabbitmq-queue-drain-time.rb:129:in `block in run'\", \"/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-plugins-rabbitmq-6.0.0/bin/check-rabbitmq-queue-drain-time.rb:127:in `each'\", \"/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-plugins-rabbitmq-6.0.0/bin/check-rabbitmq-queue-drain-time.rb:127:in `run'\", \"/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-plugin-2.7.0/lib/sensu-plugin/cli.rb:57:in `block in <class:CLI>'\"]\n","status":3}}

Environment Details:
sensu enterprise : 1.6.1
sensu-plugins-rabbitmq : 6.0.0
sensu-plugin: 2.7.0

check-rabbitmq-node-health.rb check bug

in node_healthy! func
# Parse our json data
nodeinfo = JSON.parse(resource.get)[0]
only get the first node info is incomplete.
Singleton rabbitmq node is OK. when rabbitmq cluster,will not normal working.

Add extra metrics to metrics-rabbitmq-queue.rb

I have a use case where I would like to monitor the publish and deliver rates of particular queues. However the metrics provided by this plugin only gives the average egress rate.

Can we add more data to the queue metrics?

I can make a PR for these 2 extra metrics that I need, but I feel that rather than starting to do that, we should have an option to indicate which metrics to output, so that it's more flexible and anyone can benefit from it. However I am not sure of the best way to go about this. Maybe a dotted pattern to indicate the path to the value in the queue stats? E.g. : message_stats.*.rate or backing_queue_status.avg_(in|e)gress_rate.

Any thought?

Could not find a valid gem 'sensu-plugins-rabbitmq' (= 1.3.0) in any repository

       [2016-06-15T16:00:20+00:00] ERROR: gem_package[sensu-plugins-rabbitmq] (/tmp/kitchen/cache/cookbooks/sensu/providers/gem.rb line 2) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '2'
       ---- Begin output of /opt/sensu/embedded/bin/gem install sensu-plugins-rabbitmq -q --no-rdoc --no-ri -v "1.3.0" ----
       STDOUT: 
       STDERR: ERROR:  Could not find a valid gem 'sensu-plugins-rabbitmq' (= 1.3.0) in any repository
       ERROR:  Possible alternatives: sensu-plugins-rabbitmq
       ---- End output of /opt/sensu/embedded/bin/gem install sensu-plugins-rabbitmq -q --no-rdoc --no-ri -v "1.3.0" ----
       Ran /opt/sensu/embedded/bin/gem install sensu-plugins-rabbitmq -q --no-rdoc --no-ri -v "1.3.0" returned 2
       [2016-06-15T16:00:21+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

check-rabbitmq-messages.rb not checking against the correct queues

Hi,

No matter what i do, it is keep on only checking against one queue:

"trigger_form_post_action.error"

I always get this as a result:

"CheckRabbitMQMessages WARNING: trigger_form_post_action.error: 366"

I tried running commands like:

check-rabbitmq-queue.rb --h localhost --user user --password pw --queuelevel testqueue -w 100 -c 200

check-rabbitmq-queue.rb --h localhost --user user --password pw -q testqueue -w 100 -c 200

I am using the embedded ruby gem and i believe have the latest version of check-rabbitmq-messages.rb

Create an updated release

There has been a few commits lately and no release. Latest release doesn't even support tls certificates for the amqp alive test.

sensu update 0.23 -> 0.24 compatibility

Hello,

This plugin worked well for me with sensu-0.23.2. Now my systems are running 0.24.1 and I get the following error:

/opt/sensu/embedded/bin//check-rabbitmq-amqp-alive.rb -u <...> -p <...>
/opt/sensu/embedded/lib/ruby/site_ruby/2.3.0/rubygems/specification.rb:1436:in `block in activate_dependencies': can't satisfy 'amq-protocol (= 1.9.2)', already activated 'amq-protocol-2.0.1' (Gem::LoadError)
    from /opt/sensu/embedded/lib/ruby/site_ruby/2.3.0/rubygems/specification.rb:1428:in `each'
    from /opt/sensu/embedded/lib/ruby/site_ruby/2.3.0/rubygems/specification.rb:1428:in `activate_dependencies'
    from /opt/sensu/embedded/lib/ruby/site_ruby/2.3.0/rubygems/specification.rb:1410:in `activate'
    from /opt/sensu/embedded/lib/ruby/site_ruby/2.3.0/rubygems.rb:279:in `block in activate_bin_path'
    from /opt/sensu/embedded/lib/ruby/site_ruby/2.3.0/rubygems.rb:279:in `synchronize'
    from /opt/sensu/embedded/lib/ruby/site_ruby/2.3.0/rubygems.rb:279:in `activate_bin_path'
    from /opt/sensu/embedded/bin//check-rabbitmq-amqp-alive.rb:22:in `<main>'

It seems that somehow amq-protocol got updated which causes an dependency issue ???

Thanks!

404 error after upgrading to RabbitMQ 3.6.9

After upgrading to RabbitMQ 3.6.9 (from 3.6.6) I get the following error from the queue check:
check-rabbitmq-queue.rb -u monitoring --password monitoring -w 5000 -c 10000 --queue results,keepalives

Check failed to run: 404 "Not Found", 
["/opt/sensu/embedded/lib/ruby/2.4.0/net/http/response.rb:122:in `error!'", 
"/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/carrot-top-0.0.7/lib/carrot-top.rb:59:in `fetch_uri'", 
"/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/carrot-top-0.0.7/lib/carrot-top.rb:24:in `query_api'", 
"/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/carrot-top-0.0.7/lib/carrot-top.rb:28:in `method_missing'", 
"/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-plugins-rabbitmq-2.1.0/bin/check-rabbitmq-queue.rb:118:in `run'", 
"/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-plugin-1.4.5/lib/sensu-plugin/cli.rb:58:in `block in <class:CLI>'"]

check-rabbitmq-queues-synchronised.rb does not allow skipping verification of ssl certs

The check-rabbitmq-alive.rb, check-rabbitmq-cluster-health.rb, and check-rabbitmq-node-health.rb scripts allow for skipping verification of SSL certs when performing the checks. This is common and useful when in a setup where self-signed certs are used to setup RabbitMQ over TLS. The check-rabbitmq-queues-synchronised.rb script, however, does not allow skipping cert verification.

I've opened a pull request to address this here: #82

missing runtime dependency ?

Contained scripts require non described gems in gemspec as runtime dependency, such like below.

  • bunny
  • rest-client
  • stomp

These gems should be added to sensu-plugins-rabbitmq.gemspec, I think.

Please fix check-rabbitmq-amqp-alive.rb

Please fix check-rabbitmq-amqp-alive.rb, this currently results in:

=INFO REPORT==== 16-Jun-2016::10:59:56 ===
accepting AMQP connection <0.1208.39> (127.0.0.1:48320 -> 127.0.0.1:5672)

=WARNING REPORT==== 16-Jun-2016::10:59:56 ===
closing AMQP connection <0.1208.39> (127.0.0.1:48320 -> 127.0.0.1:5672):
connection_closed_abruptly

The conn.start should be closed somewhere with conn.stop, otherwise the connection is closed as it said abruptly.
Thanks!

Rabbitmq api defaults 15_672 :confounded:

Its not a issue, but lets stick to the default port...
one line change here and it would save a lots of un-necessay lines and issues post like this 😉

I am talking about these :neckbeard:

option :port,
         description: 'RabbitMQ management API port',
         long: '--port PORT',
         proc: proc(&:to_i),
         default: 15_672

check-rabbitmq-node-health picks only first nodes in the cluster

When we have a list of nodes in cluster it always pick first nodes in list and show health is ok.

call is made for nodes ("#{url_prefix}://#{host}:#{port}/api/nodes/) -> returns a list of all nodes in cluster
function to pick node nodeinfo = JSON.parse(resource.get)[0] -> picked first nodes in the list.

ex: if the list is rabbitmq1, rabbitmq2, rabbitmq3, it checks the health on rabbitmq1 only always as it is first is list.

check-rabbitmq-queue-drain-time.rb fails "no implicit conversion of nil into String"

I got this error:

Check failed to run: no implicit conversion of nil into String, ["/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-rabbitmq-1.2.0/bin/check-rabbitmq-queue-drain-time.rb:96:in `initialize'", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-rabbitmq-1.2.0/bin/check-rabbitmq-queue-drain-time.rb:96:in `new'", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-rabbitmq-1.2.0/bin/check-rabbitmq-queue-drain-time.rb:96:in `block in acquire_rabbitmq_queues'", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-rabbitmq-1.2.0/bin/check-rabbitmq-queue-drain-time.rb:96:in `select'", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-rabbitmq-1.2.0/bin/check-rabbitmq-queue-drain-time.rb:96:in `acquire_rabbitmq_queues'", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-rabbitmq-1.2.0/bin/check-rabbitmq-queue-drain-time.rb:109:in `run'", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugin-1.2.0/lib/sensu-plugin/cli.rb:56:in `block in <class:CLI>'"]

check-rabbitmq-node-health.rb - option flags duplicated

All of the options for warning/critical for memory, socket and file descriptor usage are using -m and -c, these seem to be colliding and returning incorrect results, also they don't allow the user to set different thresholds for these three different stats. I feel like these should use different flags.

check-rabbitmq-node-health fails on OSX because fd_used = unknown

It seems that on OSX (tested on OSX 10.10 and 10.9) the RabbitMQ API cannot obtain the current number of used file descriptors and the value of fd_used becomes 'unknown' which generates the following exception:

undefined method fdiv' for nil:NilClass`

The error causes the probe to fail and return an UNKNOWN status code.

I've made an attempt at working around the problem by checking the fd_used variable is Numeric, though I'm not 100% sure that failing silently is the way to go. Unfortunately I don't know of any other way to obtain the fd_used value from RabbitMQ and getting it at the OS level may complicate things.

Connection reset by peer when running checks

Hello, seems like that both scripts when i run them I get an error saying that connection reset by peer. Note that this rabbitmq works and it's used by my sensu server so I know it's functional, I've also verified the user, pass, etc. I'm running rabbitmq-server-3.6.6-1.el7.noarch
./metrics-rabbitmq-queue.rb --host localhost --port 5671 --user sensu --password pass345

Check failed to run: Connection reset by peer, ["<internal:prelude>:76:in `__read_nonblock'", "<internal:prelude>:76:in `read_nonblock'", "/opt/sensu/embedded/lib/ruby/2.3.0/net/protocol.rb:154:in `rbuf_fill'", "/opt/sensu/embedded/lib/ruby/2.3.0/net/protocol.rb:136:in `readuntil'", "/opt/sensu/embedded/lib/ruby/2.3.0/net/protocol.rb:146:in `readline'", "/opt/sensu/embedded/lib/ruby/2.3.0/net/http/response.rb:40:in `read_status_line'", "/opt/sensu/embedded/lib/ruby/2.3.0/net/http/response.rb:29:in `read_new'", "/opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:1437:in `block in transport_request'", "/opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:1434:in `catch'", "/opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:1434:in `transport_request'", "/opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:1407:in `request'", "/opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:1400:in `block in request'", "/opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:853:in `start'", "/opt/sensu/embedded/lib/ruby/2.3.0/net/http.rb:1398:in `request'", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/carrot-top-0.0.7/lib/carrot-top.rb:49:in `fetch_uri'", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/carrot-top-0.0.7/lib/carrot-top.rb:24:in `query_api'", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/carrot-top-0.0.7/lib/carrot-top.rb:28:in `method_missing'", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-rabbitmq-2.1.0/bin/metrics-rabbitmq-queue.rb:93:in `acquire_rabbitmq_queues'", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-rabbitmq-2.1.0/bin/metrics-rabbitmq-queue.rb:98:in `run'", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugin-1.4.2/lib/sensu-plugin/cli.rb:58:in `block in <class:CLI>'"]

Exchange metrics

I need to monitor some metrics about an exchange. Gathering the metrics is very similar to queue metrics, it took me a few minutes to copy and adapt metrics-rabbitmq-queue.rb and have something working. I am happy to PR, but wanted to check:

  • Is this something you are interested in?
  • Simply adding a mostly copy-pasted script feels bad, but then it seems that's how all scripts were done. For example acquire_rabbitmq_info is duplicated all over. Is there a reason, or is it just lazyness? :) Should I also just add my script?

check-rabbitmq-queue-drain-time.rb match virtualhost

We use this check with the option vhost.
We have two virtualHost (xxx and xxx-test).
The problems is this check queue in virtualhost xxx and xxx-test.
To correct the problem, i have replace:
return queues.select { |x| x['vhost'].match(config[:vhost]) }

By
return queues.select { |x| x['vhost']==config[:vhost] }.

Can you integrate this modification ?

Rabbitmq checks do not work against Rabbitmq 3.7.x

Rabbitmq checks do not appear to be working with Rabbitmq 3.7x versions. Instead of the expected output a varying range of errors are output. Most noteable are:

Check failed to run: can't modify frozen String, ["/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/mixlib-cli-1.7.0/lib/mixlib/cli.rb:315:in build_option_arguments'", "/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/mixlib-cli-1.7.0/lib/mixlib/cli.rb:269:in block (2 levels) in opt_parser'", "/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/mixlib-cli-1.7.0/lib/mixlib/cli.rb:268:in each'", "/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/mixlib-cli-1.7.0/lib/mixlib/cli.rb:268:in block in opt_parser'", "/opt/sensu/embedded/lib/ruby/2.4.0/optparse.rb:1062:in initialize'", "/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/mixlib-cli-1.7.0/lib/mixlib/cli.rb:263:in new'", "/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/mixlib-cli-1.7.0/lib/mixlib/cli.rb:263:in opt_parser'", "/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/mixlib-cli-1.7.0/lib/mixlib/cli.rb:230:in parse_options'", "/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-plugin-1.4.5/lib/sensu-plugin/cli.rb:13:in initialize'", "/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-plugin-1.4.5/lib/sensu-plugin/cli.rb:57:in new'", "/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-plugin-1.4.5/lib/sensu-plugin/cli.rb:57:in `block in '"]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.