omf_web 1.2.8 → 1.2.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. data/.gitignore +1 -0
  2. data/README.md +23 -7
  3. data/example/bridge/bridge.yaml +11 -0
  4. data/example/bridge/data_sources/sensor-sqlite.rb +1 -1
  5. data/example/topo_discovery/Gemfile +3 -0
  6. data/example/topo_discovery/data_sources/links_full.csv +43 -0
  7. data/example/topo_discovery/data_sources/links_groundtruth.csv +39 -0
  8. data/example/topo_discovery/data_sources/links_incomplete.csv +41 -0
  9. data/example/topo_discovery/data_sources/node_info_full.csv +55 -0
  10. data/example/topo_discovery/data_sources/node_info_groundtruth.csv +53 -0
  11. data/example/topo_discovery/data_sources/node_info_incomplete.csv +54 -0
  12. data/example/topo_discovery/data_sources/nodes_full.csv +16 -0
  13. data/example/topo_discovery/data_sources/nodes_groundtruth.csv +15 -0
  14. data/example/topo_discovery/data_sources/nodes_incomplete.csv +16 -0
  15. data/example/topo_discovery/data_sources/truth.sh +16 -0
  16. data/example/topo_discovery/docs/full_network.md +6 -0
  17. data/example/topo_discovery/docs/incomplete_network.md +6 -0
  18. data/example/topo_discovery/{introduction.md → docs/introduction.md} +0 -0
  19. data/example/topo_discovery/topo_discovery.yaml +25 -0
  20. data/example/topo_discovery/widgets_combined/network_full.yaml +57 -0
  21. data/example/topo_discovery/widgets_combined/network_groundtruth.yaml +57 -0
  22. data/example/topo_discovery/widgets_combined/network_groundtruth_small.yaml +59 -0
  23. data/example/topo_discovery/widgets_combined/network_incomplete.yaml +58 -0
  24. data/example/topo_discovery/widgets_combined/node_info_full.yaml +23 -0
  25. data/example/topo_discovery/widgets_combined/node_info_groundtruth.yaml +23 -0
  26. data/example/topo_discovery/widgets_combined/node_info_incomplete.yaml +23 -0
  27. data/example/topo_discovery/widgets_combined/tabs.yaml +49 -0
  28. data/example/{topo_discovery → topo_discovery2}/data_sources/links.csv +0 -0
  29. data/example/{topo_discovery → topo_discovery2}/data_sources/links2.csv +0 -0
  30. data/example/{topo_discovery → topo_discovery2}/data_sources/node_info.csv +0 -0
  31. data/example/{topo_discovery → topo_discovery2}/data_sources/nodes.csv +0 -0
  32. data/example/{topo_discovery → topo_discovery2}/data_sources/nodes2.csv +0 -0
  33. data/example/topo_discovery2/introduction.md +17 -0
  34. data/example/{topo_discovery → topo_discovery2}/topo_discovery_simple.yaml +0 -0
  35. data/example/{topo_discovery → topo_discovery2}/topo_discovery_simple2.yaml +0 -0
  36. data/example/{topo_discovery → topo_discovery2}/widgets/network.yaml +0 -0
  37. data/example/{topo_discovery → topo_discovery2}/widgets/node_info.yaml +0 -0
  38. data/lib/omf-web/thin/server.rb +47 -6
  39. data/lib/omf-web/version.rb +1 -1
  40. metadata +34 -11
data/.gitignore CHANGED
@@ -2,6 +2,7 @@
2
2
  *.rbc
3
3
  .bundle
4
4
  .config
5
+ .idea
5
6
  coverage
6
7
  InstalledFiles
7
8
  lib/bundler/man
data/README.md CHANGED
@@ -1,12 +1,20 @@
1
1
  # OMF Web
2
2
 
3
- This Ruby 1.9 gem provides the components for building a web-based data visualization service.
3
+ This Ruby gem provides the components for building a web-based data visualization service.
4
4
  The typical use case is to allow a user to investigate a data set stored in one or more databases
5
5
  as well as life data streams.
6
6
 
7
7
  Installation
8
8
  ------------
9
9
 
10
+ gem install omf_web
11
+
12
+ or if you want to create a standalone visualisation solution you may want to
13
+ add the following to a local 'Gemfile':
14
+
15
+ source 'https://rubygems.org'
16
+ gem 'omf_web'
17
+
10
18
  At this stage the best course of action is to clone the repository
11
19
 
12
20
  % git clone https://github.com/mytestbed/omf_web.git
@@ -14,12 +22,16 @@ At this stage the best course of action is to clone the repository
14
22
  % export OMF_WEB=`pwd`
15
23
  % bundle install
16
24
 
17
- On some systems you will need to install 'libicu'
25
+ On some systems you will need to install 'libicu'.
26
+
27
+ sudo apt-get install libicu-dev
28
+
29
+ On Debian (Ubuntu)
18
30
 
19
31
  On Mac with Ports
20
32
 
21
- % sudo port install icu
22
- % bundle config build.charlock_holmes --with-icu-dir=/opt/local
33
+ sudo port install icu
34
+ bundle config build.charlock_holmes --with-icu-dir=/opt/local
23
35
 
24
36
  Getting Started
25
37
  ---------------
@@ -27,16 +39,20 @@ Getting Started
27
39
  There are a few example sites in the 'example' directory. They have been developed in the context of various demos and
28
40
  may not always be kept up to date. The one which should always work is 'example/simple'. Try it out.
29
41
 
30
- % $OMF_WEB/bin/omf_web_server.rb --config $OMF_WEB/example/simple/simple.yaml start
42
+ omf_web_server --example simple start
31
43
 
32
- This starts a webserver which can be accessed locally via 'http:localhost:4050'. Connecting to it through your favorite
44
+ This starts a webserver which can be accessed locally via 'http:localhost:4010'. Connecting to it through your favorite
33
45
  web browser should display a web page approx. looking like:
34
46
 
35
47
  ![Screenshot of starting page](https://raw.github.com/mytestbed/omf_web/master/doc/screenshot2.png "Screenshot")
36
48
 
37
49
  Don't forget to press the icon buttons
38
50
  ![icon buttons](https://raw.github.com/mytestbed/omf_web/master/doc/widget_detail.png "icon buttons")
39
- on the left widget header.
51
+ on the right widget header.
52
+
53
+ A list of all the available examples can be obtained through:
54
+
55
+ omf_web_server --example
40
56
 
41
57
  Overview
42
58
  --------
@@ -2,6 +2,17 @@
2
2
  server:
3
3
  page_title: Bridge Monitoring
4
4
  port: 4020
5
+ options:
6
+ - separator: "BRIDGE options:"
7
+ - name: fake-events
8
+ var_name: oml_database
9
+ description: If set, create fake sensor events
10
+ var_name: fake_bridge_events
11
+ - name: oml-database
12
+ param: DATABASE
13
+ var_name: oml_database
14
+ default: sqlite://example/bridge/data_sources/test3.sq3
15
+ description: "Database containing bridge data"
5
16
 
6
17
  include: tabs/*.yaml
7
18
 
@@ -98,4 +98,4 @@ class BridgeSensor < OMF::Base::LObject
98
98
  end
99
99
  end
100
100
  end
101
- wv = BridgeSensor.new($oml_database, $fake_bridge_events).run()
101
+ wv = BridgeSensor.new($oml_database || 'sqlite://example/bridge/data_sources/test3.sq3', $fake_bridge_events).run()
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'omf_web'
@@ -0,0 +1,43 @@
1
+ id:int,from_id:string,to_id:string,zone:int
2
+ 3,10:10:10:10:10:fe,rf2,0
3
+ 11,rf2,10:10:10:10:10:fe,0
4
+ 21,00:00:00:00:c1:00,sw1,0
5
+ 22,sw1,rf1,0
6
+ 23,00:00:00:00:c1:00,sw2,0
7
+ 24,sw2,rf1,0
8
+ 25,00:00:00:00:c2:00,sw2,0
9
+ 26,sw2,rf1,0
10
+ 27,rf1,sw1,0
11
+ 28,sw1,00:00:00:00:c1:00,0
12
+ 29,rf1,sw2,0
13
+ 30,sw2,00:00:00:00:c1:00,0
14
+ 31,rf1,sw2,0
15
+ 32,sw2,00:00:00:00:c2:00,0
16
+ 33,rf1,sw3,0
17
+ 34,sw3,rf2,0
18
+ 35,rf1,sw3,0
19
+ 36,sw3,ba:5e:ba:11:00:00,0
20
+ 37,rf2,sw3,0
21
+ 38,sw3,rf1,0
22
+ 39,rf2,sw3,0
23
+ 40,sw3,ba:5e:ba:11:00:00,0
24
+ 41,rf2,sw5,0
25
+ 42,sw5,ba:5e:ba:11:ad:00,0
26
+ 43,rf3,sw4,0
27
+ 44,sw4,ba:5e:ba:11:db:00,0
28
+ 45,rf3,sw5,0
29
+ 46,sw5,ba:5e:ba:11:ad:00,0
30
+ 47,ba:5e:ba:11:00:00,sw3,0
31
+ 48,sw3,rf1,0
32
+ 49,ba:5e:ba:11:00:00,sw3,0
33
+ 50,sw3,rf2,0
34
+ 51,ba:5e:ba:11:00:01,sw4,0
35
+ 52,sw4,ba:5e:ba:11:db:00,0
36
+ 53,ba:5e:ba:11:ad:00,sw5,0
37
+ 54,sw5,rf2,0
38
+ 55,ba:5e:ba:11:ad:00,sw5,0
39
+ 56,sw5,rf3,0
40
+ 57,ba:5e:ba:11:db:00,sw4,0
41
+ 58,sw4,rf3,0
42
+ 59,ba:5e:ba:11:db:00,sw4,0
43
+ 60,sw4,ba:5e:ba:11:00:01,0
@@ -0,0 +1,39 @@
1
+ id:int,from_id:string,to_id:string,zone:int
2
+ 3,Internet,rf2,0
3
+ 21,client1,sw1,0
4
+ 23,sw1,sw2,0
5
+ 24,sw2,rf1,0
6
+ 25,client2,sw2,0
7
+ 26,sw2,rf1,0
8
+ 28,sw1,client1,0
9
+ 29,rf1,sw2,0
10
+ 31,rf1,sw2,0
11
+ 32,sw2,client2,0
12
+ 33,rf1,sw3,0
13
+ 34,sw3,rf2,0
14
+ 35,rf1,sw3,0
15
+ 36,sw3,WWWServer,0
16
+ 37,rf2,sw3,0
17
+ 38,sw3,rf1,0
18
+ 39,rf2,sw3,0
19
+ 40,sw3,WWWServer,0
20
+ 41,rf2,sw5,0
21
+ 42,sw5,admin,0
22
+ 43,rf3,sw4,0
23
+ 44,sw4,PsqlServer,0
24
+ 45,rf3,sw5,0
25
+ 46,sw5,admin,0
26
+ 47,WWWServer,sw3,0
27
+ 48,sw3,rf1,0
28
+ 49,WWWServer,sw3,0
29
+ 50,sw3,rf2,0
30
+ 51,WWWServer,sw4,0
31
+ 52,sw4,PsqlServer,0
32
+ 53,admin,sw5,0
33
+ 54,sw5,rf2,0
34
+ 55,admin,sw5,0
35
+ 56,sw5,rf3,0
36
+ 57,PsqlServer,sw4,0
37
+ 58,sw4,rf3,0
38
+ 59,PsqlServer,sw4,0
39
+ 60,sw4,WWWServer,0
@@ -0,0 +1,41 @@
1
+ id:int,from_id:string,to_id:string,zone:int
2
+ 19,00:00:00:00:c1:00,sw1,0
3
+ 20,sw1,30:00:00:00:01:00,0
4
+ 21,00:00:00:00:c1:00,sw2,0
5
+ 22,sw2,30:00:00:00:01:00,0
6
+ 23,00:00:00:00:c2:00,sw2,0
7
+ 24,sw2,30:00:00:00:01:00,0
8
+ 25,30:00:00:00:01:00,sw1,0
9
+ 26,sw1,00:00:00:00:c1:00,0
10
+ 27,30:00:00:00:01:00,sw2,0
11
+ 28,sw2,00:00:00:00:c1:00,0
12
+ 29,30:00:00:00:01:00,sw2,0
13
+ 30,sw2,00:00:00:00:c2:00,0
14
+ 31,30:00:00:00:01:01,sw3,0
15
+ 32,sw3,rf2,0
16
+ 33,30:00:00:00:01:01,sw3,0
17
+ 34,sw3,ba:5e:ba:11:00:00,0
18
+ 35,rf2,sw3,0
19
+ 36,sw3,30:00:00:00:01:01,0
20
+ 37,rf2,sw3,0
21
+ 38,sw3,ba:5e:ba:11:00:00,0
22
+ 39,rf2,sw5,0
23
+ 40,sw5,ba:5e:ba:11:ad:00,0
24
+ 41,rf3,sw4,0
25
+ 42,sw4,ba:5e:ba:11:db:00,0
26
+ 43,rf3,sw5,0
27
+ 44,sw5,ba:5e:ba:11:ad:00,0
28
+ 45,ba:5e:ba:11:00:00,sw3,0
29
+ 46,sw3,30:00:00:00:01:01,0
30
+ 47,ba:5e:ba:11:00:00,sw3,0
31
+ 48,sw3,rf2,0
32
+ 49,ba:5e:ba:11:00:01,sw4,0
33
+ 50,sw4,ba:5e:ba:11:db:00,0
34
+ 51,ba:5e:ba:11:ad:00,sw5,0
35
+ 52,sw5,rf2,0
36
+ 53,ba:5e:ba:11:ad:00,sw5,0
37
+ 54,sw5,rf3,0
38
+ 55,ba:5e:ba:11:db:00,sw4,0
39
+ 56,sw4,rf3,0
40
+ 57,ba:5e:ba:11:db:00,sw4,0
41
+ 58,sw4,ba:5e:ba:11:00:01,0
@@ -0,0 +1,55 @@
1
+ nodeID, property, value
2
+ rf1,name,rf1
3
+ rf1,type,router
4
+ rf1,intf,MAC 30:00:00:00:01:00 with IP 192.168.1.254
5
+ rf1,intf,MAC 30:00:00:00:01:01 with IP 192.168.2.1
6
+ rf2,name,rf2
7
+ rf2,type,router
8
+ rf2,intf,MAC 30:00:00:00:02:00 with IP 192.168.2.254
9
+ rf2,intf,MAC 30:00:00:00:02:01 with IP 192.168.4.1
10
+ rf2,intf,MAC 30:00:00:00:02:02 with IP 192.168.10.1
11
+ rf3,name,rf3
12
+ rf3,type,router
13
+ rf3,intf,MAC 30:00:00:00:03:00 with IP 192.168.3.254
14
+ rf3,intf,MAC 30:00:00:00:03:01 with IP 192.168.4.2
15
+ sw1,name,sw1
16
+ sw1,type,sw1
17
+ sw1,intf,MAC 20:00:00:00:01:00
18
+ sw1,intf,MAC 20:00:00:00:01:01
19
+ sw2,name,sw2
20
+ sw2,type,sw2
21
+ sw2,intf,MAC 20:00:00:00:02:01
22
+ sw2,intf,MAC 20:00:00:00:02:01
23
+ sw3,name,sw3
24
+ sw3,type,sw3
25
+ sw3,intf,MAC 20:00:00:00:03:00
26
+ sw3,intf,MAC 20:00:00:00:03:01
27
+ sw4,name,sw4
28
+ sw4,type,sw4
29
+ sw4,intf,MAC 20:00:00:00:04:00
30
+ sw4,intf,MAC 20:00:00:00:04:01
31
+ sw5,name,sw5
32
+ sw5,type,sw5
33
+ sw5,intf,MAC 20:00:00:00:05:00
34
+ sw5,intf,MAC 20:00:00:00:05:01
35
+ 00:00:00:00:c1:00,name,device1
36
+ 00:00:00:00:c1:00,type,WWW client
37
+ 00:00:00:00:c1:00,intf,MAC 192.168.1.22 with IP 192.168.1.22
38
+ 00:00:00:00:c2:00,name,device2
39
+ 00:00:00:00:c2:00,type,WWW client
40
+ 00:00:00:00:c2:00,intf,MAC 192.168.1.23 with IP 192.168.1.23
41
+ ba:5e:ba:11:00:00,name,device3
42
+ ba:5e:ba:11:00:00,type,WWW server
43
+ ba:5e:ba:11:00:00,intf,MAC 192.168.2.22 with IP 192.168.2.22
44
+ ba:5e:ba:11:00:01,name,device4
45
+ ba:5e:ba:11:00:01,type,DB client
46
+ ba:5e:ba:11:00:01,intf,MAC 192.168.3.22 with IP 192.168.3.22
47
+ ba:5e:ba:11:ad:00,name,device5
48
+ ba:5e:ba:11:ad:00,type,admin
49
+ ba:5e:ba:11:ad:00,intf,MAC 192.168.4.22 with IP 192.168.4.22
50
+ ba:5e:ba:11:db:00,name,device6
51
+ ba:5e:ba:11:db:00,type,DB
52
+ ba:5e:ba:11:db:00,intf,MAC 192.168.3.23 with IP 192.168.3.23
53
+ 10:10:10:10:10:fe,name,device1
54
+ 10:10:10:10:10:fe,type,unknown
55
+ 10:10:10:10:10:fe,intf,MAC 10:10:10:10:10:fe with IP 192.168.10.22
@@ -0,0 +1,53 @@
1
+ nodeID, property, value
2
+ rf1,name,rf1
3
+ rf1,type,router
4
+ rf1,intf,MAC 30:00:00:00:01:00 with IP 192.168.1.254
5
+ rf1,intf,MAC 30:00:00:00:01:01 with IP 192.168.2.1
6
+ rf2,name,rf2
7
+ rf2,type,router
8
+ rf2,intf,MAC 30:00:00:00:02:00 with IP 192.168.2.254
9
+ rf2,intf,MAC 30:00:00:00:02:01 with IP 192.168.4.1
10
+ rf2,intf,MAC 30:00:00:00:02:02 with IP 192.168.10.1
11
+ rf3,name,rf3
12
+ rf3,type,router
13
+ rf3,intf,MAC 30:00:00:00:03:00 with IP 192.168.3.254
14
+ rf3,intf,MAC 30:00:00:00:03:01 with IP 192.168.4.2
15
+ sw1,name,sw1
16
+ sw1,type,switch
17
+ sw1,intf,MAC 20:00:00:00:01:00
18
+ sw1,intf,MAC 20:00:00:00:01:01
19
+ sw2,name,sw2
20
+ sw2,type,switch
21
+ sw2,intf,MAC 20:00:00:00:02:01
22
+ sw2,intf,MAC 20:00:00:00:02:01
23
+ sw3,name,sw3
24
+ sw3,type,switch
25
+ sw3,intf,MAC 20:00:00:00:03:00
26
+ sw3,intf,MAC 20:00:00:00:03:01
27
+ sw4,name,sw4
28
+ sw4,type,switch
29
+ sw4,intf,MAC 20:00:00:00:04:00
30
+ sw4,intf,MAC 20:00:00:00:04:01
31
+ sw5,name,sw5
32
+ sw5,type,switch
33
+ sw5,intf,MAC 20:00:00:00:05:00
34
+ sw5,intf,MAC 20:00:00:00:05:01
35
+ client1,name,client1
36
+ client1,type,WWW client
37
+ client1,intf,MAC 00:00:00:00:c1:00 with IP 192.168.1.22
38
+ client2,name,client2
39
+ client2,type,WWW client
40
+ client2,intf,MAC 00:00:00:00:c2:00 with IP 192.168.1.23
41
+ WWWServer,name,WWWServer
42
+ WWWServer,type,WWW server
43
+ WWWServer,intf,MAC ba:5e:ba:11:00:00 with IP 192.168.2.22
44
+ WWWServer,intf,MAC ba:5e:ba:11:00:01 with IP 192.168.3.22
45
+ admin,name,admin
46
+ admin,type,admin
47
+ admin,intf,MAC ba:5e:ba:11:ad:00 with IP 192.168.4.22
48
+ Internet,name,Internet
49
+ Internet,type,Internet
50
+ Internet,intf,MAC 10:10:10:10:10:fe with IP 192.168.10.22
51
+ PsqlServer,name,PsqlServer
52
+ PsqlServer,type,DB
53
+ PsqlServer,intf,MAC ba:5e:ba:11:db:00 with IP 192.168.3.23
@@ -0,0 +1,54 @@
1
+ nodeID, property, value
2
+ rf2,name,rf2
3
+ rf2,type,router
4
+ rf2,intf,MAC 30:00:00:00:02:00 with IP 192.168.2.254
5
+ rf2,intf,MAC 30:00:00:00:02:01 with IP 192.168.4.1
6
+ rf2,intf,MAC 30:00:00:00:02:02 with IP 192.168.10.1
7
+ rf3,name,rf3
8
+ rf3,type,router
9
+ rf3,intf,MAC 30:00:00:00:03:00 with IP 192.168.3.254
10
+ rf3,intf,MAC 30:00:00:00:03:01 with IP 192.168.4.2
11
+ sw1,name,sw1
12
+ sw1,type,sw1
13
+ sw1,intf,MAC 20:00:00:00:01:00
14
+ sw1,intf,MAC 20:00:00:00:01:01
15
+ sw2,name,sw2
16
+ sw2,type,sw2
17
+ sw2,intf,MAC 20:00:00:00:02:01
18
+ sw2,intf,MAC 20:00:00:00:02:01
19
+ sw3,name,sw3
20
+ sw3,type,sw3
21
+ sw3,intf,MAC 20:00:00:00:03:00
22
+ sw3,intf,MAC 20:00:00:00:03:01
23
+ sw4,name,sw4
24
+ sw4,type,sw4
25
+ sw4,intf,MAC 20:00:00:00:04:00
26
+ sw4,intf,MAC 20:00:00:00:04:01
27
+ sw5,name,sw5
28
+ sw5,type,sw5
29
+ sw5,intf,MAC 20:00:00:00:05:00
30
+ sw5,intf,MAC 20:00:00:00:05:01
31
+ 00:00:00:00:c1:00,name,device1
32
+ 00:00:00:00:c1:00,type,WWW client
33
+ 00:00:00:00:c1:00,intf,MAC 192.168.1.22 with IP 192.168.1.22
34
+ 30:00:00:00:01:00,name,device2
35
+ 30:00:00:00:01:00,type,MANUAL INSPECT
36
+ 30:00:00:00:01:00,intf,MAC 192.168.2.22 with IP 192.168.2.22
37
+ 30:00:00:00:01:01,name,device3
38
+ 30:00:00:00:01:01,type,MANUAL INSPECT
39
+ 30:00:00:00:01:01,intf,MAC 192.168.1.22 with IP 192.168.1.22
40
+ ba:5e:ba:11:00:00,name,device4
41
+ ba:5e:ba:11:00:00,type,WWW server
42
+ ba:5e:ba:11:00:00,intf,MAC 192.168.2.22 with IP 192.168.2.22
43
+ ba:5e:ba:11:00:01,name,device5
44
+ ba:5e:ba:11:00:01,type,DB client
45
+ ba:5e:ba:11:00:01,intf,MAC 192.168.3.22 with IP 192.168.3.22
46
+ ba:5e:ba:11:db:00,name,device6
47
+ ba:5e:ba:11:db:00,type,DB
48
+ ba:5e:ba:11:db:00,intf,MAC 192.168.3.23 with IP 192.168.3.23
49
+ 00:00:00:00:c2:00,name,device1
50
+ 00:00:00:00:c2:00,type,unknown
51
+ 00:00:00:00:c2:00,intf,MAC 00:00:00:00:c2:00 with IP 192.168.1.23
52
+ ba:5e:ba:11:ad:00,name,device2
53
+ ba:5e:ba:11:ad:00,type,unknown
54
+ ba:5e:ba:11:ad:00,intf,MAC ba:5e:ba:11:ad:00 with IP None
@@ -0,0 +1,16 @@
1
+ id:string,name,type
2
+ 00:00:00:00:c1:00,00:00:00:00:c1:00,genericclient
3
+ 00:00:00:00:c2:00,00:00:00:00:c2:00,genericclient
4
+ 10:10:10:10:10:fe,10:10:10:10:10:fe,unknown
5
+ sw1,sw1,switch
6
+ sw2,sw2,switch
7
+ sw3,sw3,switch
8
+ sw4,sw4,switch
9
+ sw5,sw5,switch
10
+ rf1,rf1,router
11
+ rf2,rf2,router
12
+ rf3,rf3,router
13
+ ba:5e:ba:11:00:00,ba:5e:ba:11:00:00,wwwserver
14
+ ba:5e:ba:11:00:01,ba:5e:ba:11:00:01,dbclient
15
+ ba:5e:ba:11:ad:00,ba:5e:ba:11:ad:00,admin
16
+ ba:5e:ba:11:db:00,ba:5e:ba:11:db:00,dbserver
@@ -0,0 +1,15 @@
1
+ id:string,name,type
2
+ client1,client1,client
3
+ client2,client2,client
4
+ Internet,Internet,Internet
5
+ sw1,sw1,switch
6
+ sw2,sw2,switch
7
+ sw3,sw3,switch
8
+ sw4,sw4,switch
9
+ sw5,sw5,switch
10
+ rf1,rf1,router
11
+ rf2,rf2,router
12
+ rf3,rf3,router
13
+ WWWServer,WWWServer,WWWServer
14
+ admin,admin,admin
15
+ PsqlServer,PsqlServer,PsqlServer
@@ -0,0 +1,16 @@
1
+ id:string,name,type
2
+ 00:00:00:00:c1:00,00:00:00:00:c1:00,genericclient
3
+ 00:00:00:00:c2:00,00:00:00:00:c2:00,unknown
4
+ sw1,sw1,switch
5
+ sw2,sw2,switch
6
+ sw3,sw3,switch
7
+ sw4,sw4,switch
8
+ sw5,sw5,switch
9
+ 30:00:00:00:01:00,30:00:00:00:01:00,special
10
+ 30:00:00:00:01:01,30:00:00:00:01:01,special
11
+ rf2,rf2,router
12
+ rf3,rf3,router
13
+ ba:5e:ba:11:00:00,ba:5e:ba:11:00:00,wwwserver
14
+ ba:5e:ba:11:00:01,ba:5e:ba:11:00:01,dbclient
15
+ ba:5e:ba:11:ad:00,ba:5e:ba:11:ad:00,unknown
16
+ ba:5e:ba:11:db:00,ba:5e:ba:11:db:00,dbserver
@@ -0,0 +1,16 @@
1
+ #!/bin/bash
2
+ sed -i 's/00:00:00:00:c1:00/client1/g' nodes_groundtruth.csv
3
+ sed -i 's/00:00:00:00:c2:00/client2/g' nodes_groundtruth.csv
4
+ sed -i 's/10:10:10:10:10:fe/Internet/g' nodes_groundtruth.csv
5
+ sed -i 's/ba:5e:ba:11:00:00/WWWServer/g' nodes_groundtruth.csv
6
+ sed -i 's/ba:5e:ba:11:00:01/WWWServer/g' nodes_groundtruth.csv
7
+ sed -i 's/ba:5e:ba:11:ad:00/admin/g' nodes_groundtruth.csv
8
+ sed -i 's/ba:5e:ba:11:db:00/PsqlServer/g' nodes_groundtruth.csv
9
+
10
+ sed -i 's/00:00:00:00:c1:00/client1/g' links_groundtruth.csv
11
+ sed -i 's/00:00:00:00:c2:00/client2/g' links_groundtruth.csv
12
+ sed -i 's/10:10:10:10:10:fe/Internet/g' links_groundtruth.csv
13
+ sed -i 's/ba:5e:ba:11:00:00/WWWServer/g' links_groundtruth.csv
14
+ sed -i 's/ba:5e:ba:11:00:01/WWWServer/g' links_groundtruth.csv
15
+ sed -i 's/ba:5e:ba:11:ad:00/admin/g' links_groundtruth.csv
16
+ sed -i 's/ba:5e:ba:11:db:00/PsqlServer/g' links_groundtruth.csv
@@ -0,0 +1,6 @@
1
+ title: Fully Instrumented Network
2
+
3
+ In this scenario we have probes on every ???
4
+
5
+
6
+
@@ -0,0 +1,6 @@
1
+ title: Partially Instrumented Network
2
+
3
+ In this scenario we have probes on every ???
4
+
5
+
6
+
@@ -0,0 +1,25 @@
1
+
2
+
3
+
4
+ # Simple tab showing a line chart with supporting table
5
+ #
6
+
7
+ server:
8
+ name: 'Topology Discovery'
9
+ page_title: 'Topology Discovery'
10
+ port: 4020
11
+ footer_left: NICTA
12
+ footer_right: V1.2
13
+
14
+
15
+
16
+ repositories:
17
+ - id: content
18
+ type: file
19
+ top_dir: ./docs
20
+
21
+ include: widgets_combined/*.yaml
22
+
23
+
24
+
25
+
@@ -0,0 +1,57 @@
1
+
2
+ data_sources:
3
+ - id: network/nodes
4
+ file: data_sources/nodes_full.csv # checking that node ids can be anything
5
+ - id: network/links
6
+ file: data_sources/links_full.csv
7
+
8
+ widgets:
9
+ - id: network_full
10
+ name: Discovered Network
11
+ type: data/network2
12
+ height: 1.0
13
+ #data_source: network
14
+ data_sources:
15
+ - name: nodes
16
+ stream: network/nodes
17
+ - name: links
18
+ stream: network/links
19
+
20
+ mapping:
21
+ nodes:
22
+ x: auto
23
+ y: auto
24
+ radius: 15
25
+ # property: capacity
26
+ # scale: 20
27
+ # min: 4
28
+ fill_color: #white
29
+ property: type
30
+ color:
31
+ router: orange
32
+ switch: '#FFDD00'
33
+ genericclient: lightskyblue
34
+ unknown: white
35
+ dbserver: '#D473D4' #Mauve is the best colour for a DB: http://search.dilbert.com/comic/Database%20Color
36
+ dbclient: '#915F6D' # clients have similar colour
37
+ wwwserver: darkgreen
38
+ admin: '#0000FF' # deep blue for admin
39
+ internet: '#eeeeee'
40
+ # property: capacity
41
+ # color: red_yellow20_green()
42
+ stroke_width: 2
43
+ label_color: black
44
+ label_size: 14
45
+ links:
46
+ stroke_width: 8
47
+ stroke_color:
48
+ property: zone
49
+ color: category10()
50
+
51
+ force:
52
+ link_distance: 50
53
+ charge: -1000
54
+
55
+ line_mode: straight
56
+ interaction_mode: click
57
+
@@ -0,0 +1,57 @@
1
+
2
+ data_sources:
3
+ - id: network_gt/nodes
4
+ file: data_sources/nodes_groundtruth.csv # checking that node ids can be anything
5
+ - id: network_gt/links
6
+ file: data_sources/links_groundtruth.csv
7
+
8
+ widgets:
9
+ - id: network_groundtruth
10
+ name: Network (Ground truth)
11
+ type: data/network2
12
+ height: 1.0
13
+ #data_source: network
14
+ data_sources:
15
+ - name: nodes
16
+ stream: network_gt/nodes
17
+ - name: links
18
+ stream: network_gt/links
19
+
20
+ mapping:
21
+ nodes:
22
+ x: auto
23
+ y: auto
24
+ radius: 15
25
+ # property: capacity
26
+ # scale: 20
27
+ # min: 4
28
+ fill_color: #white
29
+ property: type
30
+ color:
31
+ router: orange
32
+ switch: '#FFDD00'
33
+ client: lightskyblue
34
+ unknown: white
35
+ PsqlServer: '#D473D4' #Mauve is the best colour for a DB: http://search.dilbert.com/comic/Database%20Color
36
+ PsqlClient: '#915F6D' # clients have similar colour
37
+ WWWServer: darkgreen
38
+ admin: '#0000FF' # deep blue for admin
39
+ Internet: '#eeeeee'
40
+ # property: capacity
41
+ # color: red_yellow20_green()
42
+ stroke_width: 2
43
+ label_color: black
44
+ label_size: 14
45
+ links:
46
+ stroke_width: 8
47
+ stroke_color:
48
+ property: zone
49
+ color: category10()
50
+
51
+ force:
52
+ link_distance: 50
53
+ charge: -1000
54
+
55
+ line_mode: straight
56
+ interaction_mode: click
57
+
@@ -0,0 +1,59 @@
1
+
2
+
3
+
4
+ widgets:
5
+ - id: network_groundtruth_small
6
+ name: Ground Truth
7
+ type: data/network2
8
+ height: 1.0
9
+ #data_source: network
10
+ data_sources:
11
+ - name: nodes
12
+ stream: network_gt/nodes
13
+ - name: links
14
+ stream: network_gt/links
15
+
16
+ mapping:
17
+ nodes:
18
+ x: auto
19
+ y: auto
20
+ radius: 10
21
+ # property: capacity
22
+ # scale: 20
23
+ # min: 4
24
+ fill_color: #white
25
+ property: type
26
+ color:
27
+ router: orange
28
+ switch: '#FFDD00'
29
+ client: lightskyblue
30
+ unknown: white
31
+ PsqlServer: '#D473D4' #Mauve is the best colour for a DB: http://search.dilbert.com/comic/Database%20Color
32
+ PsqlClient: '#915F6D' # clients have similar colour
33
+ WWWServer: darkgreen
34
+ admin: '#0000FF' # deep blue for admin
35
+ Internet: '#eeeeee'
36
+ # property: capacity
37
+ # color: red_yellow20_green()
38
+ stroke_width: 2
39
+ label_color: black
40
+ label_size: 8
41
+ links:
42
+ stroke_width: 2
43
+ stroke_color:
44
+ property: zone
45
+ color: category10()
46
+
47
+ force:
48
+ link_distance: 15
49
+ charge: -300
50
+
51
+ line_mode: straight
52
+ interaction_mode: none
53
+
54
+ margin:
55
+ left: 20
56
+ top: 20
57
+ right: 20
58
+ bottom: 20
59
+
@@ -0,0 +1,58 @@
1
+
2
+ data_sources:
3
+ - id: network_ic/nodes
4
+ file: data_sources/nodes_incomplete.csv # checking that node ids can be anything
5
+ - id: network_ic/links
6
+ file: data_sources/links_incomplete.csv
7
+
8
+ widgets:
9
+ - id: network_incomplete
10
+ name: Discovered Network
11
+ type: data/network2
12
+ height: 1.0
13
+ #data_source: network
14
+ data_sources:
15
+ - name: nodes
16
+ stream: network_ic/nodes
17
+ - name: links
18
+ stream: network_ic/links
19
+
20
+ mapping:
21
+ nodes:
22
+ x: auto
23
+ y: auto
24
+ radius: 15
25
+ # property: capacity
26
+ # scale: 20
27
+ # min: 4
28
+ fill_color: #white
29
+ property: type
30
+ color:
31
+ router: orange
32
+ switch: '#FFDD00'
33
+ genericclient: lightskyblue
34
+ unknown: white
35
+ special: red
36
+ dbserver: '#D473D4' #Mauve is the best colour for a DB: http://search.dilbert.com/comic/Database%20Color
37
+ dbclient: '#915F6D' # clients have similar colour
38
+ wwwserver: darkgreen
39
+ admin: '#0000FF' # deep blue for admin
40
+ internet: '#eeeeee'
41
+ # property: capacity
42
+ # color: red_yellow20_green()
43
+ stroke_width: 2
44
+ label_color: black
45
+ label_size: 14
46
+ links:
47
+ stroke_width: 8
48
+ stroke_color:
49
+ property: zone
50
+ color: category10()
51
+
52
+ force:
53
+ link_distance: 50
54
+ charge: -1000
55
+
56
+ line_mode: straight
57
+ interaction_mode: click
58
+
@@ -0,0 +1,23 @@
1
+ data_sources:
2
+ - id: node_info_fl
3
+ file: data_sources/node_info_full.csv
4
+
5
+ widgets:
6
+ - id: node_info_full
7
+ type: data/table2
8
+ title: Node Info
9
+ data_source:
10
+ name: node_info_fl
11
+ slice:
12
+ slice_column: nodeID
13
+ event:
14
+ name: "graph.network/nodes.selected"
15
+ key: id
16
+ columns:
17
+ - field: property
18
+ #name: Name
19
+ - field: value
20
+ #name: Value
21
+
22
+ margin:
23
+ left: 5
@@ -0,0 +1,23 @@
1
+ data_sources:
2
+ - id: node_info_gt
3
+ file: data_sources/node_info_groundtruth.csv
4
+
5
+ widgets:
6
+ - id: node_info_groundtruth
7
+ type: data/table2
8
+ title: Node Info
9
+ data_source:
10
+ name: node_info_gt
11
+ slice:
12
+ slice_column: nodeID
13
+ event:
14
+ name: "graph.network/nodes.selected"
15
+ key: id
16
+ columns:
17
+ - field: property
18
+ #name: Name
19
+ - field: value
20
+ #name: Value
21
+
22
+ margin:
23
+ left: 5
@@ -0,0 +1,23 @@
1
+ data_sources:
2
+ - id: node_info_ic
3
+ file: data_sources/node_info_incomplete.csv
4
+
5
+ widgets:
6
+ - id: node_info_incomplete
7
+ type: data/table2
8
+ title: Node Info
9
+ data_source:
10
+ name: node_info_ic
11
+ slice:
12
+ slice_column: nodeID
13
+ event:
14
+ name: "graph.network_ic/nodes.selected"
15
+ key: id
16
+ columns:
17
+ - field: property
18
+ #name: Name
19
+ - field: value
20
+ #name: Value
21
+
22
+ margin:
23
+ left: 5
@@ -0,0 +1,49 @@
1
+
2
+ widgets:
3
+ - id: main
4
+ name: Home
5
+ top_level: true
6
+ priority: 900
7
+ type: layout/two_columns/50_50
8
+ left:
9
+ - name: Introduction
10
+ type: text
11
+ content:
12
+ url: file:content:introduction.md
13
+ right:
14
+ - network_groundtruth
15
+
16
+ - id: full
17
+ name: Full
18
+ top_level: true
19
+ priority: 800
20
+ type: layout/two_columns/66_33
21
+ left:
22
+ - network_full
23
+ right:
24
+ - type: layout/one_column
25
+ widgets:
26
+ - name: Introduction
27
+ type: text
28
+ content:
29
+ url: file:content:full_network.md
30
+ - node_info_full
31
+ - network_groundtruth_small
32
+
33
+ - id: incomplete
34
+ name: Incomplete
35
+ top_level: true
36
+ priority: 700
37
+ type: layout/two_columns/66_33
38
+ left:
39
+ - network_incomplete
40
+ right:
41
+ - type: layout/one_column
42
+ widgets:
43
+ - name: Introduction
44
+ type: text
45
+ content:
46
+ url: file:content:incomplete_network.md
47
+ - node_info_incomplete
48
+ - network_groundtruth_small
49
+
@@ -0,0 +1,17 @@
1
+ title: Introduction
2
+
3
+
4
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin
5
+ sollicitudin nibh eu ligula lobortis ornare. Sed nibh nibh,
6
+ ullamcorper at vehicula ac, molestie ac nunc. Duis sodales, nisi vel
7
+ pellentesque imperdiet, nisi massa accumsan lorem, gravida scelerisque
8
+ velit est vitae eros. Suspendisse eu lacinia elit.
9
+
10
+
11
+ Suspendisse laoreet, lacus quis dignissim volutpat, dolor augue convallis lectus,
12
+ ac consectetur yyyy sem iaculis diam. Donec iaculis mattis iaculis.
13
+ Curabitur ut nisl in sapien semper ullamcorper in id turpis. Vivamus
14
+ sed sapien justo, ac scelerisque nibh. Sed eget quam velit. Lorem
15
+ ipsum dolor sit amet, consectetur adipiscing elit.
16
+
17
+
@@ -23,6 +23,13 @@ module OMF::Web
23
23
  pre_parse: lambda do |p, runner|
24
24
  p.on("--config CONF_FILE", "File holding description of web site") {|f| runner.options[:omf_config_file] = f}
25
25
  p.on("--top-dir DIR", "Directory to start from for relative data paths [directory of config file]") {|td| @top_dir = td }
26
+ p.on("--example [EXAMPLE]", "Run an example [#{list_of_examples.join(', ')}]") do |e|
27
+ unless e
28
+ puts "Available examples: #{list_of_examples.join(', ')}"
29
+ exit 0
30
+ end
31
+ runner.options[:omf_config_file] = "example:#{e}"
32
+ end
26
33
  end
27
34
  },
28
35
  authentication: {
@@ -44,13 +51,16 @@ module OMF::Web
44
51
 
45
52
  def load_environment(opts)
46
53
  unless cf = opts[:omf_config_file]
47
- fatal "Missing config file"
54
+ fatal "Missing config file '--config'"
48
55
  abort
49
56
  end
50
57
 
51
58
  unless File.readable? cf
52
- fatal "Can't read config file '#{cf}'"
53
- abort
59
+ unless cf2 = check_for_builtin(cf, opts)
60
+ fatal "Can't read config file '#{cf}'"
61
+ abort
62
+ end
63
+ cf = cf2 # found a builtin config file
54
64
  end
55
65
 
56
66
  @cfg_dir = File.dirname(cf)
@@ -59,12 +69,43 @@ module OMF::Web
59
69
  load_config_file(cf, opts)
60
70
  end
61
71
 
62
- def load_config_file(cf, opts)
63
- unless File.readable? cf
64
- fatal "Can't read config file '#{cf}'"
72
+ def check_for_builtin(cf, opts)
73
+ pa = cf.split(':')
74
+ unless pa.length == 2 && pa[0] == 'example'
75
+ return nil
76
+ end
77
+ path = File.join(@top_dir, 'example', pa[1])
78
+ if File.directory? path
79
+ dir = path
80
+ path = File.join(dir, "#{pa[1]}.yaml")
81
+ unless File.readable? path
82
+ # check .yml
83
+ path = File.join(dir, "#{pa[1]}.yml")
84
+ end
85
+ end
86
+ unless File.readable?(path)
87
+ da = list_of_examples
88
+ ex = pa[1].split('/')[0]
89
+ if da.include? ex
90
+ ya = Dir.glob(File.join(@top_dir, 'example', ex, '*.yaml')).map do |fn|
91
+ File.basename(fn)
92
+ end
93
+ fatal "Unknown config file. Did you mean '#{ya.join(', ')}'?"
94
+ else
95
+ fatal "Unknown example '#{}'. Did you mean '#{da.join(', ')}'?"
96
+ end
65
97
  abort
66
98
  end
99
+ return path
100
+ end
67
101
 
102
+ def list_of_examples()
103
+ Dir.entries(File.join(@top_dir, 'example')).select do |n|
104
+ !(n == 'NOT_WORKING' || n.start_with?('.'))
105
+ end
106
+ end
107
+
108
+ def load_config_file(cf, opts)
68
109
  debug "Loading config file '#{cf}'"
69
110
  cfg = _rec_sym_keys(YAML.load_file(cf))
70
111
 
@@ -1,7 +1,7 @@
1
1
 
2
2
  module OMF
3
3
  module Web
4
- VERSION = '1.2.8'
4
+ VERSION = '1.2.9'
5
5
  # Used for finding the example directory
6
6
  TOP_DIR = File.dirname(File.dirname(File.dirname(__FILE__)))
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omf_web
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.8
4
+ version: 1.2.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -417,16 +417,39 @@ files:
417
417
  - example/simple/sample.sql
418
418
  - example/simple/simple.yaml
419
419
  - example/simple/simple_dynamic.yaml
420
- - example/topo_discovery/data_sources/links.csv
421
- - example/topo_discovery/data_sources/links2.csv
422
- - example/topo_discovery/data_sources/node_info.csv
423
- - example/topo_discovery/data_sources/nodes.csv
424
- - example/topo_discovery/data_sources/nodes2.csv
425
- - example/topo_discovery/introduction.md
426
- - example/topo_discovery/topo_discovery_simple.yaml
427
- - example/topo_discovery/topo_discovery_simple2.yaml
428
- - example/topo_discovery/widgets/network.yaml
429
- - example/topo_discovery/widgets/node_info.yaml
420
+ - example/topo_discovery/Gemfile
421
+ - example/topo_discovery/data_sources/links_full.csv
422
+ - example/topo_discovery/data_sources/links_groundtruth.csv
423
+ - example/topo_discovery/data_sources/links_incomplete.csv
424
+ - example/topo_discovery/data_sources/node_info_full.csv
425
+ - example/topo_discovery/data_sources/node_info_groundtruth.csv
426
+ - example/topo_discovery/data_sources/node_info_incomplete.csv
427
+ - example/topo_discovery/data_sources/nodes_full.csv
428
+ - example/topo_discovery/data_sources/nodes_groundtruth.csv
429
+ - example/topo_discovery/data_sources/nodes_incomplete.csv
430
+ - example/topo_discovery/data_sources/truth.sh
431
+ - example/topo_discovery/docs/full_network.md
432
+ - example/topo_discovery/docs/incomplete_network.md
433
+ - example/topo_discovery/docs/introduction.md
434
+ - example/topo_discovery/topo_discovery.yaml
435
+ - example/topo_discovery/widgets_combined/network_full.yaml
436
+ - example/topo_discovery/widgets_combined/network_groundtruth.yaml
437
+ - example/topo_discovery/widgets_combined/network_groundtruth_small.yaml
438
+ - example/topo_discovery/widgets_combined/network_incomplete.yaml
439
+ - example/topo_discovery/widgets_combined/node_info_full.yaml
440
+ - example/topo_discovery/widgets_combined/node_info_groundtruth.yaml
441
+ - example/topo_discovery/widgets_combined/node_info_incomplete.yaml
442
+ - example/topo_discovery/widgets_combined/tabs.yaml
443
+ - example/topo_discovery2/data_sources/links.csv
444
+ - example/topo_discovery2/data_sources/links2.csv
445
+ - example/topo_discovery2/data_sources/node_info.csv
446
+ - example/topo_discovery2/data_sources/nodes.csv
447
+ - example/topo_discovery2/data_sources/nodes2.csv
448
+ - example/topo_discovery2/introduction.md
449
+ - example/topo_discovery2/topo_discovery_simple.yaml
450
+ - example/topo_discovery2/topo_discovery_simple2.yaml
451
+ - example/topo_discovery2/widgets/network.yaml
452
+ - example/topo_discovery2/widgets/node_info.yaml
430
453
  - lib/irods4r.rb
431
454
  - lib/irods4r/directory.rb
432
455
  - lib/irods4r/file.rb