Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Send mongo monitoring info into graphite

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 bin
Octocat-spinner-32 lib
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 README.md
Octocat-spinner-32 mongodb-graphite.gemspec
README.md

Very simple gem to monitor a mongodb cluster and send data to a graphite server.

Usage :

You have to set an environment variable MONGODB_GRAPHITE_DIR (or it will use the config dir in the current directory). Then write a yml file to contain basic settings:

log_dir: log
pid_dir: pids
graphite: graphite.mydomain:3333
interval: 3
instances_file: 'config/instances.rb'

Then in config/instances.rb, you can set instances to monitor:

instance 'mongoD' do
  host 'onemongo.mydomain'
  port '27021'
  prefix_callback (lambda { |stats|
    process_type = stats['process']
    "production.onemongo.#{process_type}"
  } )
end

instance 'mongoD' do
  host 'anothermongo.mydomain'
  port '27017'
  prefix_callback (lambda { |stats|
    process_type = stats['process']
    "test.anothermongo.#{process_type}"
  } )
end

Finally, you can use the gem as a service (start, status, stop)

mongodb-graphite start
Something went wrong with that request. Please try again.