M/Monit Collector in mongodb
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
config
db
lib
spec
views
.gitignore
.rvmrc
.travis.yml
Gemfile
Gemfile.lock
README.md
Rakefile
config.ru
monit.rb

README.md

Build Status

Description

Monitrb is a m/monit event collector which works on Sinatra and mongodb

Goals

In the main goal is be able to set a collector for monit information but we want it be easy to use to collect any information that we send to the system.

Monit Collection

the M/monit portocol sen information over Server, Platform, Services, Events.

In the part of Services they have 8 types of events with diferent data which are:

  • FILESYSTEM
  • DIRECTORY
  • FILE
  • PROCESS
  • HOST
  • SYSTEM
  • FIFO
  • PROGRAM

Using a mongodb all the information is saved in the Service collection but with dynamic field for the especific data for each type

Collector

There's a internal collector in the url/collector you can send data with a POST request

{ 
	'server' : 'server_name',
  	'timestamp' : '2011-11-24 13:18:12 +0100',
  	'domain' : 'domain_name',
  	'type' : 'type_name',
	'dataset' : { 
					:data1 => 'data1', 
					:data2 => 'data2', 
					:data3 => 'data3' 
				}
}

Installation

You should have rvm installed.

	% git clone 
	% rvm create gemset monitrb
	% bundle install
  • Change the password and username in the monitrb.rb
  • Change the mongodb connection in db.rb

start the server

% rackup

In your monit script add:

	set mmonit http://user:password@server:port/monit/collector

Start your monit.