rboss 0.5.4 → 0.5.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/README.md +84 -2
- data/bin/twiddle +1 -0
- data/lib/rboss/twiddle/monitor.rb +1 -0
- data/lib/rboss/version.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -72,6 +72,90 @@ And used with -c or --config
|
|
72
72
|
|
73
73
|
twiddle -c jon --server-config
|
74
74
|
|
75
|
+
### Customizing MBeans
|
76
|
+
|
77
|
+
Every time you run the twiddle command, this gem will load the ~/.rboss/twiddle.rb file,
|
78
|
+
which can be used to customize the mbeans.
|
79
|
+
|
80
|
+
defaults = JBoss::Twiddle::Monitor.defaults
|
81
|
+
defaults[:logger] = {
|
82
|
+
:description => 'Logger Service',
|
83
|
+
:pattern => 'jboss.system:service=Logging,type=Logger'
|
84
|
+
}
|
85
|
+
|
86
|
+
This will add a custom mbean whose identifier is 'logger'. From that, you can use the
|
87
|
+
twiddle command on it.
|
88
|
+
|
89
|
+
twiddle --invoke logger debug,message
|
90
|
+
|
91
|
+
If your mbean name depends on a resource name (like the connector mbean), you can use
|
92
|
+
a '#{resource}' string to pass the resource in the command line.
|
93
|
+
|
94
|
+
defaults[:mymbean] => {
|
95
|
+
:description => 'My Custom MBean',
|
96
|
+
:pattern => 'jboss.custom:type=CustomMBean,name=#{resource}'
|
97
|
+
}
|
98
|
+
|
99
|
+
Don't forget to use single quotes on that. The twiddle command will be:
|
100
|
+
|
101
|
+
twiddle --get mymbean:Name,MBeanProperty
|
102
|
+
|
103
|
+
If this mbean is scannable, you can use a :scan key:
|
104
|
+
|
105
|
+
defaults[:mymbean] => {
|
106
|
+
:description => 'My Custom MBean',
|
107
|
+
:pattern => 'jboss.custom:type=CustomMBean,name=#{resource}',
|
108
|
+
:scan => proc do
|
109
|
+
# queries and pass each result do the block
|
110
|
+
query "jboss.custom:type=CustomMBean,*" do |path|
|
111
|
+
path.gsub "jboss.custom:type=CustomMBean,name=", ""
|
112
|
+
end
|
113
|
+
end
|
114
|
+
}
|
115
|
+
|
116
|
+
Now you can scan for resources of your custom MBean by using:
|
117
|
+
|
118
|
+
twiddle --mymbean
|
119
|
+
|
120
|
+
If your MBean has some properties that should appear in a table for instant monitoring,
|
121
|
+
just add a :properties key:
|
122
|
+
|
123
|
+
defaults[:mymbean] => {
|
124
|
+
:description => 'My Custom MBean',
|
125
|
+
:pattern => 'jboss.custom:type=CustomMBean,name=#{resource}',
|
126
|
+
:properties => %W(activeCount currentFree maxAvailable),
|
127
|
+
:header => ['Active Count', 'Current Free', 'Max Available'],
|
128
|
+
:scan => proc do
|
129
|
+
# queries and pass each result do the block
|
130
|
+
query "jboss.custom:type=CustomMBean,*" do |path|
|
131
|
+
path.gsub "jboss.custom:type=CustomMBean,name=", ""
|
132
|
+
end
|
133
|
+
end
|
134
|
+
}
|
135
|
+
|
136
|
+
If this MBean maps a component that can be monitored for health state, you can map the
|
137
|
+
limits by using a :health key:
|
138
|
+
|
139
|
+
defaults[:mymbean] => {
|
140
|
+
:description => 'My Custom MBean',
|
141
|
+
:pattern => 'jboss.custom:type=CustomMBean,name=#{resource}',
|
142
|
+
:properties => %W(activeCount currentFree maxAvailable),
|
143
|
+
:header => ['Active Count', 'Current Free', 'Max Available'],
|
144
|
+
:health => {
|
145
|
+
:max => :max_available,
|
146
|
+
:using => :active_count #or use :free if you have the number of free resources
|
147
|
+
},
|
148
|
+
:scan => proc do
|
149
|
+
# queries and pass each result do the block
|
150
|
+
query "jboss.custom:type=CustomMBean,*" do |path|
|
151
|
+
path.gsub "jboss.custom:type=CustomMBean,name=", ""
|
152
|
+
end
|
153
|
+
end
|
154
|
+
}
|
155
|
+
|
156
|
+
You can use the indexes of the values (in that case, 2 for :max and 0 for :using) or the
|
157
|
+
header values in downcase and underscores.
|
158
|
+
|
75
159
|
Using jboss-profile
|
76
160
|
-----------
|
77
161
|
|
@@ -248,8 +332,6 @@ Use an array with the services to remove, the current supported are:
|
|
248
332
|
|
249
333
|
Any slimmed service will be removed logically by using a ".rej" suffix in the files/directories.
|
250
334
|
|
251
|
-
### Configuring connectors
|
252
|
-
|
253
335
|
Tools
|
254
336
|
-----------
|
255
337
|
|
data/bin/twiddle
CHANGED
@@ -85,6 +85,7 @@ opts.on('--all', "Detail all mapped mbeans") do
|
|
85
85
|
end
|
86
86
|
|
87
87
|
(defaults.sort_by { |k, v| k }).each do |mbean_id, mbean|
|
88
|
+
next if mbean[:properties] and not mbean[:scan] and mbean[:pattern]['#{resource}']
|
88
89
|
command = mbean_id.to_s.gsub /_/, '-'
|
89
90
|
if mbean[:scan]
|
90
91
|
opts.on("--#{command} [name_a,name_b,...]", Array,
|
@@ -89,6 +89,7 @@ module JBoss
|
|
89
89
|
:description => 'JBoss Server specifications',
|
90
90
|
:pattern => 'jboss.system:type=Server',
|
91
91
|
:properties => %W(VersionName VersionNumber Version),
|
92
|
+
:layout => :vertical,
|
92
93
|
:header => ['Version Name', 'Version Number', 'Version'],
|
93
94
|
},
|
94
95
|
:server_info => {
|
data/lib/rboss/version.rb
CHANGED