rabbithutch 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +24 -24
- data/Gemfile +4 -4
- data/Gemfile.lock +68 -55
- data/LICENSE.txt +21 -21
- data/README.md +137 -107
- data/bin/rabbithutch +1 -1
- data/bin/rabbithutchmgr +1 -1
- data/bin/rabbithutchweb +5 -0
- data/config.yaml +32 -32
- data/config/config.yaml +32 -0
- data/index.html +1 -0
- data/lib/configurator.rb +38 -38
- data/lib/consumer.rb +31 -31
- data/lib/consumers/console_consumer.rb +20 -20
- data/lib/consumers/log4r_consumer.rb +35 -35
- data/lib/consumers/mongo_consumer.rb +34 -34
- data/lib/logger.rb +16 -16
- data/lib/rabbithutch.rb +78 -78
- data/lib/rabbithutchmgr.rb +47 -47
- data/lib/worker.rb +32 -32
- data/rabbithutch.gemspec +43 -37
- data/rabbithutchservice.rb +18 -18
- data/rakefile +5 -5
- data/web/public/assets/css/bootstrap-responsive.css +1092 -0
- data/web/public/assets/css/bootstrap-responsive.min.css +9 -0
- data/web/public/assets/css/bootstrap.css +6046 -0
- data/web/public/assets/css/bootstrap.min.css +9 -0
- data/web/public/assets/css/main.css +30 -0
- data/web/public/assets/img/glyphicons-halflings-white.png +0 -0
- data/web/public/assets/img/glyphicons-halflings.png +0 -0
- data/web/public/assets/js/bootstrap.js +2159 -0
- data/web/public/assets/js/bootstrap.min.js +6 -0
- data/web/rabbithutchweb.rb +13 -0
- data/web/views/index.haml +26 -0
- data/web/views/layout.haml +66 -0
- metadata +170 -29
data/.gitignore
CHANGED
@@ -1,24 +1,24 @@
|
|
1
|
-
*~
|
2
|
-
*.gem
|
3
|
-
*.rbc
|
4
|
-
.bundle
|
5
|
-
.config
|
6
|
-
coverage
|
7
|
-
InstalledFiles
|
8
|
-
lib/bundler/man
|
9
|
-
pkg
|
10
|
-
rdoc
|
11
|
-
spec/reports
|
12
|
-
test/tmp
|
13
|
-
test/version_tmp
|
14
|
-
tmp
|
15
|
-
|
16
|
-
# YARD artifacts
|
17
|
-
.yardoc
|
18
|
-
_yardoc
|
19
|
-
doc/
|
20
|
-
|
21
|
-
.project
|
22
|
-
*.pid
|
23
|
-
|
24
|
-
|
1
|
+
*~
|
2
|
+
*.gem
|
3
|
+
*.rbc
|
4
|
+
.bundle
|
5
|
+
.config
|
6
|
+
coverage
|
7
|
+
InstalledFiles
|
8
|
+
lib/bundler/man
|
9
|
+
pkg
|
10
|
+
rdoc
|
11
|
+
spec/reports
|
12
|
+
test/tmp
|
13
|
+
test/version_tmp
|
14
|
+
tmp
|
15
|
+
|
16
|
+
# YARD artifacts
|
17
|
+
.yardoc
|
18
|
+
_yardoc
|
19
|
+
doc/
|
20
|
+
|
21
|
+
.project
|
22
|
+
*.pid
|
23
|
+
|
24
|
+
|
data/Gemfile
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
|
3
|
-
# Specify your gem's dependencies in hash-that-tree.gemspec
|
4
|
-
gemspec
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
# Specify your gem's dependencies in hash-that-tree.gemspec
|
4
|
+
gemspec
|
data/Gemfile.lock
CHANGED
@@ -1,55 +1,68 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
rabbithutch (0.1.
|
5
|
-
amqp
|
6
|
-
bson_ext
|
7
|
-
daemons
|
8
|
-
eventmachine
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
amq-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
bson_ext (1.8.
|
35
|
-
bson (~> 1.8.
|
36
|
-
daemons (1.1.9)
|
37
|
-
eventmachine (1.0.0)
|
38
|
-
|
39
|
-
log4r (1.1.10)
|
40
|
-
logger (1.2.8)
|
41
|
-
mongo (1.8.
|
42
|
-
bson (~> 1.8.
|
43
|
-
mongo_ext (0.19.3)
|
44
|
-
mq (0.1.3)
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
rabbithutch (0.1.4)
|
5
|
+
amqp
|
6
|
+
bson_ext
|
7
|
+
daemons
|
8
|
+
eventmachine
|
9
|
+
haml
|
10
|
+
log4r
|
11
|
+
logger
|
12
|
+
mongo
|
13
|
+
mongo_ext
|
14
|
+
mq
|
15
|
+
mustache
|
16
|
+
shotgun
|
17
|
+
sinatra
|
18
|
+
thin
|
19
|
+
thor
|
20
|
+
yard
|
21
|
+
|
22
|
+
GEM
|
23
|
+
remote: https://rubygems.org/
|
24
|
+
specs:
|
25
|
+
amq-client (0.9.10)
|
26
|
+
amq-protocol (>= 0.9.4)
|
27
|
+
eventmachine
|
28
|
+
amq-protocol (1.0.1)
|
29
|
+
amqp (0.9.8)
|
30
|
+
amq-client (~> 0.9.5)
|
31
|
+
amq-protocol (>= 0.9.4)
|
32
|
+
eventmachine
|
33
|
+
bson (1.8.2)
|
34
|
+
bson_ext (1.8.1)
|
35
|
+
bson (~> 1.8.1)
|
36
|
+
daemons (1.1.9)
|
37
|
+
eventmachine (1.0.0)
|
38
|
+
haml (3.1.7)
|
39
|
+
log4r (1.1.10)
|
40
|
+
logger (1.2.8)
|
41
|
+
mongo (1.8.1)
|
42
|
+
bson (~> 1.8.1)
|
43
|
+
mongo_ext (0.19.3)
|
44
|
+
mq (0.1.3)
|
45
|
+
mustache (0.99.4)
|
46
|
+
rack (1.4.4)
|
47
|
+
rack-protection (1.3.2)
|
48
|
+
rack
|
49
|
+
shotgun (0.9)
|
50
|
+
rack (>= 1.0)
|
51
|
+
sinatra (1.3.3)
|
52
|
+
rack (~> 1.3, >= 1.3.6)
|
53
|
+
rack-protection (~> 1.2)
|
54
|
+
tilt (~> 1.3, >= 1.3.3)
|
55
|
+
thin (1.5.0)
|
56
|
+
daemons (>= 1.0.9)
|
57
|
+
eventmachine (>= 0.12.6)
|
58
|
+
rack (>= 1.0.0)
|
59
|
+
thor (0.16.0)
|
60
|
+
tilt (1.3.3)
|
61
|
+
yard (0.8.3)
|
62
|
+
|
63
|
+
PLATFORMS
|
64
|
+
ruby
|
65
|
+
x86-mingw32
|
66
|
+
|
67
|
+
DEPENDENCIES
|
68
|
+
rabbithutch!
|
data/LICENSE.txt
CHANGED
@@ -1,22 +1,22 @@
|
|
1
|
-
Copyright (c) 2012 John Ryan
|
2
|
-
|
3
|
-
MIT License
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
-
a copy of this software and associated documentation files (the
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
11
|
-
the following conditions:
|
12
|
-
|
13
|
-
The above copyright notice and this permission notice shall be
|
14
|
-
included in all copies or substantial portions of the Software.
|
15
|
-
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
1
|
+
Copyright (c) 2012 John Ryan
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
22
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,107 +1,137 @@
|
|
1
|
-
#rabbit-hutch
|
2
|
-
|
3
|
-
RabbitMq Trace Logger - Listen to multiple RabbitMq instances and log them to a
|
4
|
-
single location or MongoDb database.
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
##
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
#
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
1
|
+
#rabbit-hutch
|
2
|
+
|
3
|
+
RabbitMq Trace Logger - Listen to multiple RabbitMq instances and log them to a
|
4
|
+
single location or MongoDb database.
|
5
|
+
|
6
|
+
Applications included
|
7
|
+
* rabbithutch - a service to listen to the exchanges
|
8
|
+
* rabbithutchweb - a web site to configure the service
|
9
|
+
|
10
|
+
# Overview
|
11
|
+
|
12
|
+
A ruby service for monotoring the trace output on RabbitMq Nodes and writing the
|
13
|
+
output to console, Log files or MongoDb.
|
14
|
+
|
15
|
+
Once tracing is started on the target rabbitMQ nodes, the service creates a queue
|
16
|
+
"rabbithutch" that binds to the exchange "amq.rabbitmq.trace". All messages that arrive
|
17
|
+
on the queue are then picked up by any registered consumers and written to standard
|
18
|
+
output, a log file or a MongoDb Database.
|
19
|
+
|
20
|
+
# Environment
|
21
|
+
|
22
|
+
This has been tested on
|
23
|
+
* Ubuntu Linux
|
24
|
+
* Windows 8
|
25
|
+
|
26
|
+
# Installation
|
27
|
+
|
28
|
+
##Activate tracing on rabbitmq server
|
29
|
+
|
30
|
+
run the following command on each server you want to trace
|
31
|
+
rabbitmqctl trace_on
|
32
|
+
|
33
|
+
##Install the rabbit-hutch service
|
34
|
+
|
35
|
+
gem install rabbithutch
|
36
|
+
|
37
|
+
#RabbitMq Configuration
|
38
|
+
|
39
|
+
In order for tracing to work, the trace_on option must be enabled on all rabbitMq nodes.
|
40
|
+
Turn on tracing on the nodes using the following command:
|
41
|
+
rabbitmqctl trace_on
|
42
|
+
|
43
|
+
# Usage
|
44
|
+
|
45
|
+
Start up the Web Interface
|
46
|
+
|
47
|
+
rabbithutchweb
|
48
|
+
|
49
|
+
Run as a command line process with a config file
|
50
|
+
|
51
|
+
rabbithutch run -- ~/config.yaml
|
52
|
+
|
53
|
+
Run as a service
|
54
|
+
|
55
|
+
rabbithutch start -- ~/config.yaml
|
56
|
+
|
57
|
+
For help on the service
|
58
|
+
|
59
|
+
rabbithutch
|
60
|
+
|
61
|
+
# Troubleshooting
|
62
|
+
|
63
|
+
Web Manager
|
64
|
+
If the web service has not been shut down properly the process my still be alive in the background
|
65
|
+
ERROR:
|
66
|
+
(/home/USERNAME/.rvm/gems/ruby-1.9.3-p327/gems/eventmachine-1.0.0/lib/eventmachine.rb:526:in
|
67
|
+
`start_tcp_server': no acceptor (port is in use or requires root privileges) (RuntimeError))
|
68
|
+
To fix this kill the process named shotgun
|
69
|
+
- ps aux | grep shot
|
70
|
+
- kill -9 (the process number)
|
71
|
+
|
72
|
+
# Configuration
|
73
|
+
|
74
|
+
To add RabbitMq nodes to monitor and consumers to enable you will need to change the configuration.
|
75
|
+
|
76
|
+
The config below shows two RabbitMq nodes with each with console, mongoDb and log file consumers
|
77
|
+
|
78
|
+
./config.yaml
|
79
|
+
|
80
|
+
application:
|
81
|
+
exchangename: amq.rabbitmq.trace
|
82
|
+
queuename: rabbithutch
|
83
|
+
|
84
|
+
rabbitmq:
|
85
|
+
hosts:
|
86
|
+
- displayname: local1
|
87
|
+
enabled: true
|
88
|
+
hostname: 127.0.0.1
|
89
|
+
username: guest
|
90
|
+
password: guest
|
91
|
+
- displayname: local2
|
92
|
+
enabled: false
|
93
|
+
hostname: 127.2.2.2
|
94
|
+
username: guest
|
95
|
+
password: guest
|
96
|
+
|
97
|
+
consumers_config:
|
98
|
+
consumers:
|
99
|
+
- name: console_consumer
|
100
|
+
enabled: true
|
101
|
+
- name: mongo_consumer
|
102
|
+
enabled: true
|
103
|
+
hostname: 127.0.0.1
|
104
|
+
username: guest
|
105
|
+
password: guest
|
106
|
+
database_prefix: rhutch_
|
107
|
+
port: 27017
|
108
|
+
- name: log4r_consumer
|
109
|
+
enabled: true
|
110
|
+
log_location: /tmp
|
111
|
+
log_prefix: rhutch_
|
112
|
+
|
113
|
+
#Contributing
|
114
|
+
|
115
|
+
Fork it
|
116
|
+
Create your feature branch (git checkout -b my-new-feature)
|
117
|
+
Commit your changes (git commit -am 'Add some feature')
|
118
|
+
Push to the branch (git push origin my-new-feature)
|
119
|
+
Create new Pull Request
|
120
|
+
|
121
|
+
## Create the gem
|
122
|
+
|
123
|
+
Build and Test Locally
|
124
|
+
-gem build rabbithutch.gemspec
|
125
|
+
-gem install rabbithutch-X.X.X # where X.X.X is the version of the compiled gemspec
|
126
|
+
|
127
|
+
Build and deploy to rubygems.org
|
128
|
+
-gem update --system
|
129
|
+
-gem build rabbithutch.gemspec
|
130
|
+
-gem push rabbithutch-0.0.1.gem # where X.X.X is the version of the compiled gemspec
|
131
|
+
|
132
|
+
#To do
|
133
|
+
|
134
|
+
- [ ] Add Http Appender to post messages to url e.g. pastebin.org or mongodb REST interface
|
135
|
+
- [ ] Come up with better config mgt for gems like adding a management Command Line Interface to set env settings
|
136
|
+
- [x] Add a Web UI to manage the service
|
137
|
+
|