Build Status Dependency Status Gem Version Code Climate

ONESnooper Server

Simple server snooping on and recording OpenNebula's VM & Host monitoring traffic.

Requirements

  • Ruby >= 1.9.3
  • Rubygems
  • Database (SQLite, MySQL, MongoDB)
  • OpenNebula >= 4.10 (doesn't have to be present on the same machine)
  • iptables with TEE

Some dependencies require dev versions of various lib packages to compile native extensions.

Installation

gem install onesnooper-server

Configuration

UDP Datagram Mirroring

  • OpenNebula Manager Host: bash iptables -I PREROUTING -p udp -m udp --dport 4124 -j TEE --gateway $ONESNOOPER_HOST
  • ONESnooper Server Host: bash iptables -I PREROUTING -d $ONE_MANAGER_HOST/32 -p udp -m udp --dport 4124 -j DNAT --to-destination $ONESNOOPER_HOST:9000

Database Configuration

You can use multiple databases at the same time!

You can choose from:

  • SQLite3 (not recommended for production)
  • MySQL
  • MongoDB

For SQL-based databases, you can use this Sequel migration script:

cd /tmp
mkdir migrations
cd migrations
wget https://raw.githubusercontent.com/arax/onesnooper-server/master/migrations/001_create_db.rb
cd ..
sequel -m migrations sqlite:///tmp/onesnooper-server.sqlite

For MySQL, just adapt the DB location on the last line according to your local MySQL configuration and Sequel documentation.

ONESnooper Server Configuration

You can configure ONESnooper Server by saving an updated version of the following configuration file as /etc/onesnooper-server/onesnooper-server.yml.

---
defaults: &defaults
  bind_address: 127.0.0.1
  bind_port: 9000
  log_level: info
  store:
  - mongodb
  stores:
    sqlite:
      database_file: /tmp/onesnooper-server.sqlite
    mysql:
      database: one_monitoring
      host: localhost
      port: 3306
      username:
      password:
    mongodb:
      database: one_monitoring
      host: localhost
      port: 27017
  allowed_sources:
  - 127.0.0.1

###############################################
#######  DO NOT EDIT AFTER THIS POINT  ########
###############################################

production:
  <<: *defaults

development:
  <<: *defaults
  log_level: debug
  store:
  - sqlite

test:
  <<: *defaults
  log_level: debug
  store:
  - sqlite

Usage

Start onesnooper-server and wait ...

Code Documentation

Code Documentation for OneacctExport by YARD

Continuous integration

Continuous integration for OneacctExport by Travis-CI

Contributing

  1. Fork it ( https://github.com/arax/onesnooper-server/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request