Module: Network::Monitor

Defined in:
lib/network/monitor.rb,
lib/network/monitor/schema.rb,
lib/network/monitor/version.rb,
lib/network/monitor/interface.rb

Defined Under Namespace

Classes: Interface

Constant Summary collapse

VERSION =
"0.2.0"

Class Method Summary collapse

Class Method Details

.migrate_database!Object


23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/network/monitor/schema.rb', line 23

def self.migrate_database!
	ActiveRecord::Schema.define(:version => 1) do
		create_table :interfaces do |t|
			t.string :host, :null => false
			t.integer :ifIndex, :null => false

			t.integer :ifSpeed, :null => false

			t.integer :ifInOctets, :null => false
			t.integer :ifOutOctets, :null => false

			t.integer :ifInErrors, :null => false
			t.integer :ifOutErrors, :null => false

			t.datetime :created_at
 
			t.index :host
			t.index :ifIndex
			t.index :created_at
		end
	end
end