rboss 0.9.1 → 0.9.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/.idea/encodings.xml +5 -0
  3. data/.idea/misc.xml +5 -0
  4. data/.idea/modules.xml +9 -0
  5. data/.idea/rboss.iml +65 -0
  6. data/.idea/scopes/scope_settings.xml +5 -0
  7. data/.idea/vcs.xml +7 -0
  8. data/Gemfile +2 -2
  9. data/README.md +34 -397
  10. data/bin/rboss-cli +77 -28
  11. data/lib/rboss.rb +10 -12
  12. data/lib/rboss/cli/invoker.rb +31 -18
  13. data/lib/rboss/cli/mappings.rb +11 -10
  14. data/lib/rboss/cli/mappings/resources/connector.yaml +2 -2
  15. data/lib/rboss/cli/mappings/resources/datasource.yaml +5 -5
  16. data/lib/rboss/cli/mappings/resources/deployment-scanner.yaml +3 -3
  17. data/lib/rboss/cli/mappings/resources/interface.yaml +2 -2
  18. data/lib/rboss/cli/mappings/resources/jdbc-driver.yaml +12 -0
  19. data/lib/rboss/cli/mappings/resources/jms-queue.yaml +44 -0
  20. data/lib/rboss/cli/mappings/resources/runtime.yaml +34 -0
  21. data/lib/rboss/cli/mappings/resources/server.yaml +8 -8
  22. data/lib/rboss/cli/resource.rb +60 -37
  23. data/lib/rboss/cli/result_parser.rb +29 -5
  24. data/lib/rboss/plaftorm.rb +2 -25
  25. data/lib/rboss/utils.rb +2 -8
  26. data/lib/rboss/version.rb +1 -1
  27. data/lib/rboss/view/colorizers.rb +4 -2
  28. data/lib/rboss/view/formatters.rb +37 -0
  29. data/lib/rboss/view/table_builder.rb +2 -2
  30. data/rboss-cli-bash-completion +82 -0
  31. data/rboss.gemspec +12 -12
  32. data/rboss.iml +6 -7
  33. data/rboss.ipr +2 -11
  34. metadata +23 -53
  35. data/bin/rboss-profile +0 -125
  36. data/bin/rboss-twiddle +0 -204
  37. data/lib/rboss/bin/command_actions.rb +0 -125
  38. data/lib/rboss/cli/mappings/resources/jdbc_driver.yaml +0 -12
  39. data/lib/rboss/component_processor.rb +0 -179
  40. data/lib/rboss/components/component.rb +0 -58
  41. data/lib/rboss/components/datasource.rb +0 -179
  42. data/lib/rboss/components/deploy_folder.rb +0 -104
  43. data/lib/rboss/components/hypersonic_replacer.rb +0 -58
  44. data/lib/rboss/components/jbossweb.rb +0 -119
  45. data/lib/rboss/components/jmx.rb +0 -88
  46. data/lib/rboss/components/mod_cluster.rb +0 -81
  47. data/lib/rboss/components/org/6.0/deploy_folder.rb +0 -33
  48. data/lib/rboss/components/org/jmx.rb +0 -59
  49. data/lib/rboss/components/profile_folder.rb +0 -44
  50. data/lib/rboss/components/resource.rb +0 -52
  51. data/lib/rboss/components/restore_slimming.rb +0 -46
  52. data/lib/rboss/components/run_conf.rb +0 -90
  53. data/lib/rboss/components/run_conf.yaml +0 -22
  54. data/lib/rboss/components/service_script.rb +0 -55
  55. data/lib/rboss/components/slimming.rb +0 -107
  56. data/lib/rboss/components/slimming.yaml +0 -110
  57. data/lib/rboss/components/soa-p/hypersonic_replacer.rb +0 -79
  58. data/lib/rboss/components/soa-p/jmx.rb +0 -47
  59. data/lib/rboss/components/xadatasource.rb +0 -67
  60. data/lib/rboss/file_processor.rb +0 -111
  61. data/lib/rboss/jboss_path.rb +0 -74
  62. data/lib/rboss/jboss_profile.rb +0 -350
  63. data/lib/rboss/resources/jboss_init_redhat.sh.erb +0 -140
  64. data/lib/rboss/resources/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml +0 -282
  65. data/lib/rboss/resources/mod_cluster.sar/mod_cluster-1.1.2.Final.jar +0 -0
  66. data/lib/rboss/resources/run.conf.bat.erb +0 -60
  67. data/lib/rboss/resources/run.conf.erb +0 -62
  68. data/lib/rboss/twiddle.rb +0 -25
  69. data/lib/rboss/twiddle/base_monitor.rb +0 -88
  70. data/lib/rboss/twiddle/mbean.rb +0 -148
  71. data/lib/rboss/twiddle/monitor.rb +0 -222
  72. data/lib/rboss/twiddle/twiddle.rb +0 -87
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5c865678a219fd236a68663a11b06292b39d1d30
4
- data.tar.gz: ea7e7538b6bcb61c42cee3edaf3618a85df8d9d8
3
+ metadata.gz: 1e20ec4987337d606798b75b915e2b222598d025
4
+ data.tar.gz: de04752a875590d1fa5c4819988bd6bed4b08bbf
5
5
  SHA512:
6
- metadata.gz: fe288a4166e76bf5c80b41ce303fde89966e8c36c5d8d486c97b416f4317b848c6cb7921ae9f1e40ca063ebe340e1431abd30e329985a421745a383105ce8b2c
7
- data.tar.gz: 91cf9958af7217a830017acaed421c4913d1f5872355b30380ff216144564210d6e194530a91198df042293c6305b1527f573c55c24281c54c8c80249e361c02
6
+ metadata.gz: 709cd9e696f2963a3e59798c22666d175c11f8fac7b429bd2ee87aa591f0ccad35e87beced870b82f0640818f05b273cede7a0a0a9c97b64382a9d3c06cee0c4
7
+ data.tar.gz: df7b4d13cf2787d7a01ed1258ee422739de9f1d6aa39ec76d25b742a0f59d18e04fdca9c636450a9c4dbdce91c7352e5af1c4f8d23eb826989f6c6fee36cab3b
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
4
+ </project>
5
+
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="IdProvider" IDEtalkID="1EEE3103C92A9F3F24A791D6B22E1653" />
4
+ <component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="RVM: ruby-2.1.2" project-jdk-type="RUBY_SDK" />
5
+ </project>
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/rboss.iml" filepath="$PROJECT_DIR$/.idea/rboss.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
9
+
@@ -0,0 +1,65 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="RUBY_MODULE" version="4">
3
+ <component name="FacetManager">
4
+ <facet type="gem" name="Ruby Gem">
5
+ <configuration>
6
+ <option name="GEM_APP_ROOT_PATH" value="$MODULE_DIR$" />
7
+ <option name="GEM_APP_TEST_PATH" value="" />
8
+ <option name="GEM_APP_LIB_PATH" value="$MODULE_DIR$/lib" />
9
+ </configuration>
10
+ </facet>
11
+ </component>
12
+ <component name="ModuleRunConfigurationManager">
13
+ <configuration default="false" name="Public Interface" type="RubyRunConfigurationType" factoryName="Ruby">
14
+ <module name="rboss" />
15
+ <RUBY_RUN_CONFIG NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
16
+ <RUBY_RUN_CONFIG NAME="WORK DIR" VALUE="$MODULE_DIR$/bin" />
17
+ <RUBY_RUN_CONFIG NAME="SHOULD_USE_SDK" VALUE="false" />
18
+ <RUBY_RUN_CONFIG NAME="ALTERN_SDK_NAME" VALUE="" />
19
+ <RUBY_RUN_CONFIG NAME="myPassParentEnvs" VALUE="true" />
20
+ <envs />
21
+ <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="true" />
22
+ <EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
23
+ <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
24
+ <COVERAGE_PATTERN ENABLED="true">
25
+ <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
26
+ </COVERAGE_PATTERN>
27
+ </EXTENSION>
28
+ <EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
29
+ <RUBY_RUN_CONFIG NAME="SCRIPT_PATH" VALUE="$MODULE_DIR$/bin/rboss-cli" />
30
+ <RUBY_RUN_CONFIG NAME="SCRIPT_ARGS" VALUE="--interface public" />
31
+ <RunnerSettings RunnerId="RubyRunner" />
32
+ <ConfigurationWrapper RunnerId="RubyRunner" />
33
+ <method />
34
+ </configuration>
35
+ <configuration default="false" name="IRB console: rboss" type="IrbRunConfigurationType" factoryName="IRB console" temporary="true">
36
+ <module name="rboss" />
37
+ <IRB_RUN_CONFIG NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
38
+ <IRB_RUN_CONFIG NAME="WORK DIR" VALUE="$MODULE_DIR$" />
39
+ <IRB_RUN_CONFIG NAME="SHOULD_USE_SDK" VALUE="false" />
40
+ <IRB_RUN_CONFIG NAME="ALTERN_SDK_NAME" VALUE="" />
41
+ <IRB_RUN_CONFIG NAME="myPassParentEnvs" VALUE="true" />
42
+ <envs />
43
+ <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
44
+ <EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
45
+ <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
46
+ <COVERAGE_PATTERN ENABLED="true">
47
+ <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
48
+ </COVERAGE_PATTERN>
49
+ </EXTENSION>
50
+ <EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
51
+ <IRB_RUN_CONFIG NAME="SCRIPT_PATH" VALUE="$USER_HOME$/.rvm/rubies/ruby-2.1.2/bin/irb" />
52
+ <IRB_RUN_CONFIG NAME="SCRIPT_ARGS" VALUE="--prompt simple" />
53
+ <IRB_RUN_CONFIG NAME="IS_RAILS_CONSOLE" VALUE="false" />
54
+ <RunnerSettings RunnerId="RubyRunner" />
55
+ <ConfigurationWrapper RunnerId="RubyRunner" />
56
+ <method />
57
+ </configuration>
58
+ </component>
59
+ <component name="NewModuleRootManager" inherit-compiler-output="false">
60
+ <content url="file://$MODULE_DIR$" />
61
+ <orderEntry type="inheritedJdk" />
62
+ <orderEntry type="sourceFolder" forTests="false" />
63
+ <orderEntry type="library" scope="PROVIDED" name="bundler (v1.7.2, RVM: ruby-2.1.2) [gem]" level="application" />
64
+ </component>
65
+ </module>
@@ -0,0 +1,5 @@
1
+ <component name="DependencyValidationManager">
2
+ <state>
3
+ <option name="SKIP_IMPORT_STATEMENTS" value="false" />
4
+ </state>
5
+ </component>
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
+ </component>
6
+ </project>
7
+
data/Gemfile CHANGED
@@ -1,5 +1,5 @@
1
- source "http://rubygems.org"
1
+ source 'http://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- gem 'yummi'
5
+ gem 'yummi', '~> 0.9.3'
data/README.md CHANGED
@@ -1,30 +1,21 @@
1
1
  rboss
2
2
  =============
3
3
 
4
- Use this tool to create profiles for JBoss Application Server and use twiddle to scan
5
- a running JBoss AS or execute scripts.
6
-
4
+ This tool helps you manage a JBoss application server (EAP or Wildfly) by encapsulating `jboss-cli` in a usefull and customizable command line tool.
7
5
 
8
6
  Installation
9
7
  -----------
10
8
 
11
9
  gem install rboss
12
10
 
13
- ### Direct Dependencies
14
-
15
- * yummi
16
-
17
11
  ### Configuration
18
12
 
19
- Set a RBOSS_CLI_HOME variable pointing to your JBoss AS home location that has jboss-cli
20
- for using rboss-cli, for using twiddle, set a RBOSS_TWIDDLE_HOME variable pointing to you JBoss AS
21
- that has twiddle.
13
+ Set a `RBOSS_CLI_HOME` variable pointing to your JBoss AS home location that has `jboss-cli` for using `rboss-cli`.
22
14
 
23
15
  Using rboss-cli
24
16
  -----------
25
17
 
26
- rboss-cli is a helper tool for jboss-cli, it maps resource paths and helps the operation
27
- invoke.
18
+ `rboss-cli` is a helper tool for `jboss-cli`, it maps resource paths and helps the operation invoke.
28
19
 
29
20
  ### Basics
30
21
 
@@ -40,22 +31,20 @@ You can scan resources, detail information and execute operations.
40
31
 
41
32
  ### Invoking Operations
42
33
 
43
- To see the operations for a resource, use the "--list-operations" or "-l" option:
34
+ To see the operations for a resource, use the `--list-operations` or `-l` option:
44
35
 
45
36
  rboss-cli --server --list-operations
46
37
 
47
- To detail an operation, use the "--detail-operation" or "-d" option:
38
+ To detail an operation, use the `--detail-operation` or `-d` option:
48
39
 
49
40
  rboss-cli --server --detail-operation shutdown
50
41
 
51
- This will print a table showing both request and response parameters. To invoke the
52
- operation, use the "--operation" or "-o" option:
42
+ This will print a table showing both request and response parameters. To invoke the operation, use the `--operation` or `-o` option:
53
43
 
54
44
  rboss-cli --server --operation shutdown
55
45
  rboss-cli --server -o shutdown
56
46
 
57
- Since this operation requires a parameter, rboss-cli will ask you to input them. If you
58
- want to pass the required parameters, use the "--arguments" or "-a" option:
47
+ Since this operation requires a parameter, rboss-cli will ask you to input them. If you want to pass the required parameters, use the `--arguments` or `-a` option:
59
48
 
60
49
  rboss-cli --server --operation shutdown --arguments restart=true
61
50
  rboss-cli --server -o shutdown -a restart=true
@@ -64,42 +53,41 @@ Multiple arguments are supported using commas:
64
53
 
65
54
  rboss-cli --some-resource -o operation -a arg1=value1,arg2=value
66
55
 
67
- If you want to skip optional arguments, use the "--skip-optional". rboss-cli will not ask
68
- you to input the arguments, leaving "--arguments" as the only way to set them.
56
+ If you want to skip optional arguments, use the `--skip-optional`. `rboss-cli` will not ask you to input optional arguments, leaving `--arguments` as the only way to set them.
69
57
 
70
- See rboss-cli --help for a complete list of commands.
58
+ See `rboss-cli --help` for a complete list of commands.
71
59
 
72
- ### Known Issues
60
+ ### Bash Completion
73
61
 
74
- The datasource mapping (--datasource) retrieves incorrect information if you call either
75
- detail operation or invoke operation for the operation add. This is caused because the
76
- command '/subsystem=datasources/data-source=:read-operation-description(name=add)' needs
77
- to be executed as
78
- '/subsystem=datasources/data-source=ANY_VALUE:read-operation-description(name=add)',
79
- leaving the '--datasource any' as a workaround.
62
+ You can also source the `rboss-cli-bash-completion` file to make use of the completion for the `rboss-cli`. The completion works for parameters, resource arguments and operations.
80
63
 
81
- rboss-cli --datasource --detail-operation add
82
- rboss-cli --datasource a --detail-operation add
64
+ $ rboss-cli --dat[TAB]
65
+ $ rboss-cli --datasource Exa[TAB]
66
+ $ rboss-cli --datasource ExampleDS
83
67
 
84
- ### Configuring CLI mappings
68
+ Keep in mind that if you need completion for a different server than `local` (the default server), you should start the command with `--connect` or `-c`:
85
69
 
86
- To create and override mappings, just put a yaml file in "~/.rboss/rboss-cli/resources". The filename will
87
- be used to identify the operation. Example: placing a file named datasource.yaml will override the
88
- --datasource option and a file named logger.yaml will create a new option (--logger).
70
+ $ rboss-cli --connect my[TAB]
71
+ $ rboss-cli --connect myserver
72
+ $ rboss-cli --connect myserver --dat[TAB]
73
+ $ rboss-cli --connect myserver --datasource Exa[TAB]
74
+ $ rboss-cli --connect myserver --datasource ExampleDS
89
75
 
90
- The yaml must contain the given definitions:
76
+ ### Configuring CLI mappings
77
+
78
+ To create and override mappings, just put a yaml file in `~/.rboss/rboss-cli/resources`. The filename will be used to identify the operation. Example: placing a file named datasource.yaml will override the `--datasource` option and a file named `logger.yaml` will create a new option (`--logger`). The yaml must contain the given definitions:
91
79
 
92
- * description: an explaining text to appear in command usage (--help)
93
- * path: the path to invoke the operations, may take a ${NAME} if the path contains a resource name
80
+ * description: an explaining text to appear in command usage (`--help`)
81
+ * path: the path to invoke the operations, may take a `${NAME}` if the path contains a resource name
94
82
  * scan (optional): a command to scan resources (by using this, the option may take an array of resource names)
95
- * print (optional): an array of table definitions to print with "read-resource" operation.
83
+ * print (optional): an array of table definitions to print with `read-resource` operation.
96
84
 
97
85
  Examples:
98
86
 
99
87
  ---
100
88
  description: Datasource Information
101
- path: /subsystem=datasources/data-source=${NAME}
102
- scan: ls /subsystem=datasources/data-source
89
+ path: ${DOMAIN_HOST}${DOMAIN_SERVER}/subsystem=datasources/data-source=${NAME}
90
+ scan: ls ${DOMAIN_HOST}${DOMAIN_SERVER}/subsystem=datasources/data-source
103
91
  print:
104
92
  - id: config
105
93
  title: Datasource Details
@@ -165,7 +153,7 @@ Examples:
165
153
 
166
154
  ---
167
155
  description: Detail Server Information
168
- path: /core-service=
156
+ path: ${DOMAIN_HOST}${DOMAIN_SERVER}/core-service=
169
157
  print:
170
158
  - id: platform
171
159
  title: Operating System Information
@@ -208,7 +196,7 @@ To configure a table to print, just use the following parameters:
208
196
  All mappings (formatter, colorizer and health checker) should be mapped using the following conventions:
209
197
 
210
198
  * the key should be the property name (replace '-' with '_')
211
- * the value should be the message to send to RBoss::Formatters, RBoss::HealthCheckers or RBoss::Colorizers
199
+ * the value should be the message to send to `RBoss::Formatters`, `RBoss::HealthCheckers` or `RBoss::Colorizers`
212
200
  * if the message takes parameters, they must be specified in a form of a hash after the message
213
201
 
214
202
  Examples:
@@ -239,7 +227,7 @@ Examples:
239
227
 
240
228
  ### Adding new components
241
229
 
242
- To add new Colorizers, Formatters or HealthCheckers, just put the code in the "~/.rboss/rboss.rb" file.
230
+ To add new `Colorizers`, `Formatters` or `HealthCheckers`, just put the code in the `~/.rboss/rboss.rb` file.
243
231
 
244
232
  Example:
245
233
 
@@ -258,357 +246,6 @@ From now you can use this colorizer
258
246
 
259
247
  The components included are defined in the following files:
260
248
 
261
- * /lib/rboss/view/colorizers.rb
262
- * /lib/rboss/view/formatters.rb
263
- * /lib/rboss/view/health_checkers.rb
264
-
265
- Using rboss-twiddle
266
- -----------
267
-
268
- ### Basics
269
-
270
- Simply do a "cd" to your JBoss Home and use it
271
-
272
- rboss-twiddle --help
273
-
274
- You can scan resources like: datasources, queues, connectors, webapps, ...
275
-
276
- rboss-twiddle --datasource --webapp
277
- rboss-twiddle --all
278
-
279
- If you don't need to scan for resources, you can specify them for monitoring:
280
-
281
- rboss-twiddle --webapp jmx-console,admin-console
282
-
283
- Combine with "watch" to get a simple and instantly monitoring:
284
-
285
- watch --interval=1 rboss-twiddle --webapp jmx-console,admin-console
286
-
287
- Retrieve property values with --get:
288
-
289
- rboss-twiddle --get webapp:jmx-console,maxSessions
290
- rboss-twiddle --get server-info,FreeMemory
291
-
292
- Set values with --set:
293
-
294
- rboss-twiddle --set connector:http-127.0.0.1-8080,maxThreads,350
295
-
296
- Execute commands with --invoke:
297
-
298
- rboss-twiddle --invoke server,shutdown
299
- rboss-twiddle --invoke web-deployment:jmx-console,stop
300
-
301
- Extending mbeans
302
-
303
- You can use a file in ~/.rboss/twiddle.rb for mapping new mbeans or overriding the defaults
304
-
305
- RBoss::Twiddle::Monitor.defaults[:http_request] = {
306
- :description => 'Request for http protocol',
307
- :pattern => 'jboss.web:type=GlobalRequestProcessor,name=http-127.0.0.1-8080',
308
- :properties => %W(requestCount errorCount maxTime)
309
- }
310
-
311
- And use it normally
312
-
313
- rboss-twiddle --http-request
314
-
315
- You can do every action using custom mbeans
316
-
317
- rboss-twiddle --invoke http-request,resetCounters
318
-
319
- Configurations can be saved using --save
320
-
321
- rboss-twiddle --save jon --port 2099
322
-
323
- And used with -c or --config
324
-
325
- rboss-twiddle -c jon --server-config
326
-
327
- ### Customizing MBeans
328
-
329
- Every time you run the rboss-twiddle command, this gem will load the ~/.rboss/rboss.rb file,
330
- which can be used to customize the mbeans.
331
-
332
- defaults = RBoss::Twiddle::Monitor.defaults
333
- defaults[:logger] = {
334
- :description => 'Logger Service',
335
- :pattern => 'jboss.system:service=Logging,type=Logger'
336
- }
337
-
338
- This will add a custom mbean whose identifier is 'logger'. From that, you can use therboss-
339
- twiddle command on it.
340
-
341
- rboss-twiddle --invoke logger debug,message
342
-
343
- If your mbean name depends on a resource name (like the connector mbean), you can use
344
- a '#{resource}' string to pass the resource in the command line.
345
-
346
- defaults[:mymbean] => {
347
- :description => 'My Custom MBean',
348
- :pattern => 'jboss.custom:type=CustomMBean,name=#{resource}'
349
- }
350
-
351
- Don't forget to use single quotes on that. The rboss-twiddle command will be:
352
-
353
- rboss-twiddle --get mymbean:Name,MBeanProperty
354
-
355
- If this mbean is scannable, you can use a :scan key:
356
-
357
- defaults[:mymbean] => {
358
- :description => 'My Custom MBean',
359
- :pattern => 'jboss.custom:type=CustomMBean,name=#{resource}',
360
- :scan => proc do
361
- # queries and pass each result do the block
362
- query "jboss.custom:type=CustomMBean,*" do |path|
363
- path.gsub "jboss.custom:type=CustomMBean,name=", ""
364
- end
365
- end
366
- }
367
-
368
- Now you can scan for resources of your custom MBean by using:
369
-
370
- rboss-twiddle --mymbean
371
-
372
- If your MBean has some properties that should appear in a table for instant monitoring,
373
- just add a :properties key:
374
-
375
- defaults[:mymbean] => {
376
- :description => 'My Custom MBean',
377
- :pattern => 'jboss.custom:type=CustomMBean,name=#{resource}',
378
- :properties => %W(activeCount currentFree maxAvailable),
379
- :header => ['Active Count', 'Current Free', 'Max Available'],
380
- :scan => proc do
381
- # queries and pass each result do the block
382
- query "jboss.custom:type=CustomMBean,*" do |path|
383
- path.gsub "jboss.custom:type=CustomMBean,name=", ""
384
- end
385
- end
386
- }
387
-
388
- If this MBean maps a component that can be monitored for health state, you can map the
389
- limits by using a :health key:
390
-
391
- defaults[:mymbean] => {
392
- :description => 'My Custom MBean',
393
- :pattern => 'jboss.custom:type=CustomMBean,name=#{resource}',
394
- :properties => %W(activeCount currentFree maxAvailable),
395
- :header => ['Active Count', 'Current Free', 'Max Available'],
396
- :health => {
397
- :active_count => {
398
- :percentage => { # uses a percentage based check
399
- :max => :max_available,
400
- :using => :active_count #or use :free if you have the number of free resources
401
- }
402
- }
403
- },
404
- :scan => proc do
405
- # queries and pass each result do the block
406
- query "jboss.custom:type=CustomMBean,*" do |path|
407
- path.gsub "jboss.custom:type=CustomMBean,name=", ""
408
- end
409
- end
410
- }
411
-
412
- Customizing health, formatters and colors are the same as customizing in rboss-cli. You can
413
- use the indexes of the values (in that case, 2 for :max and 0 for :using) or the header values
414
- in downcase and underscores.
415
-
416
- Using rboss-profile
417
- -----------
418
-
419
- ### Basics
420
-
421
- Simply do a "cd" to your JBoss Home and use it
422
-
423
- rboss-profile --help
424
-
425
- All configuration can be stored in a single yaml file containing an array of components
426
- and its configuration:
427
-
428
- - deploy_folder: deploy/datasources
429
- - deploy_folder: deploy/apps
430
- - jmx
431
- - run_conf:
432
- :heap_size: 1024m
433
- :perm_size: 512m
434
- :debug: :socket
435
-
436
- You can specify any command-line arguments directly in yaml file:
437
-
438
- - :params:
439
- :jboss_home: /home/user/jboss/org/jboss-5
440
- :type: org
441
- :version: 5.1
442
- :base_profile: all
443
- :profile: my_profile
444
-
445
- ### Configuring deploy folders
446
-
447
- Use "deploy_folder" component and the desired folder. If the folder starts with a "/" or
448
- doesn't start with "deploy", the entries in VFS will be added.
449
-
450
- # Will be in $JBOSS_HOME/server/$PROFILE/deploy/application
451
- - deploy_folder: deploy/applications
452
- # Will be in $JBOSS_HOME/server/$PROFILE/custom/application
453
- - deploy_folder: custom/applications
454
- - deploy_folder: /opt/deploy
455
-
456
- ### Configuring jmx
457
-
458
- Use "jmx" component:
459
-
460
- # user and password are "admin" by default
461
- - jmx
462
- - jmx:
463
- :user: admin
464
- :password: admin
465
-
466
- Basically, this will add an entry in the jmx-console-users.properties (depends on JBoss type).
467
- For JBoss org, this will enable security in jmx-console since the enterprise versions have
468
- jmx-console security by default.
469
-
470
- ### Configuring datasources
471
-
472
- Use a "datasource" component
473
-
474
- Configuration:
475
-
476
- :folder => a folder where this datasource will be saved (default: $JBOSS_HOME/server/$CONFIG/deploy)
477
- if a relative path is given, it will be appended to default value
478
- :encrypt => a flag to indicate if the password should be encrypted (default: false)
479
- :type => the type of the datasource
480
- :name => a name for saving the file (default: :type)
481
- :attributes => a Hash with the attributes that will be changed in template (the only required is :jndi_name)
482
-
483
- Any attribute that is not present in datasource xml will be created using this template: <key>value</key>.
484
-
485
- For converting the symbol attributes, the above rules are used taking by example a
486
- value ":database_url":
487
-
488
- 1. The value "database_url"
489
- 2. The value "database-url"
490
- 3. The value "DatabaseUrl"
491
- 4. The value "DATABASE_URL"
492
-
493
- The key for finding the correct datasource is the configuration attribute :type, which is
494
- used to search in $JBOSS_HOME/docs/examples/jca for the file.
495
-
496
- Any key that is not found in the datasource template will be added. If it is a Symbol,
497
- the underlines will be converted to hyphens.
498
-
499
- For saving the file, the configuration :name will be used in the form "${name}-ds.xml".
500
-
501
- Example:
502
-
503
- - datasource:
504
- :type: postgres
505
- :attributes:
506
- :user_name: postgres
507
- :password: postgres
508
- :connection_url: jdbc:postgresql://localhost:5432/sample_database
509
- :min_pool_size: 5
510
- :max_pool_size: 15
511
-
512
- ### Replacing hypersonic
513
-
514
- The same as Datasouce, but use the "default_ds" component instead.
515
-
516
- - default_ds:
517
- :type: postgres
518
- :attributes:
519
- :user_name: postgres
520
- :password: postgres
521
- :connection_url: jdbc:postgresql://localhost:5432/jboss_db
522
- :min_pool_size: 5
523
- :max_pool_size: 15
524
-
525
- This will change the DefaultDS mapping to the desired datasource. Since JBoss SOA-Platform
526
- already have a tool to do the work, it will be called with the correct mapped options
527
- (see the file $SOAP_HOME/tools/schema/build.properties for the supported options)
528
-
529
- - default_ds:
530
- source.dir: postgresql84
531
- db.name: jboss_soap_db
532
- db.hostname: localhost
533
- db.port: 5432
534
- db.username: postgres
535
- db.password: postgres
536
- db.minpoolsize: 5
537
- db.maxpoolsize: 15
538
-
539
- ### Installing mod_cluster
540
-
541
- Use a "mod_cluster" component
542
-
543
- Configuration:
544
-
545
- :path => where the mod_cluster.sar is located
546
- :folder => where the mod_cluster.sar should be installed (default: $JBOSS_HOME/server/$CONFIG/deploy)
547
-
548
- The additional configurations are the entries in the bean ModClusterConfig (mod_cluster-jboss-beans.xml)
549
- and can be in a String form (using the entry name) or in a Symbol form (using ruby nomenclature - :sticky_session)
550
-
551
- ### Configuring run.conf
552
-
553
- ### Slimming
554
-
555
- Use a "slimming" component.
556
-
557
- Configuration:
558
-
559
- Use an array with the services to remove, the current supported are:
560
-
561
- * Admin Console => :admin_console
562
- * Web Console => :web_console
563
- * Mail Service => :mail
564
- * BeanShell => :bean_shell
565
- * Hot Deploy => :hot_deploy
566
- * UDDI => :uddi
567
- * UUID Key Generator => :key_generator
568
- * Scheduling => :scheduling
569
- * JMX Console => :jmx_console
570
- * JBoss WS => :jboss_ws
571
- * JMX Remoting => :jmx_remoting
572
- * ROOT Page => :root_page
573
- * Management => :management
574
- * IIOP => :iiop
575
- * JBoss Web => :jboss_web
576
- * SNMP => :snmp
577
- * Profile Service => :profile
578
- * EJB3 => :ejb3
579
- * EJB2 => :ejb2
580
- * JMX Invoker => :jmx_invoker
581
- * HA HTTP Invoker => :ha_http_invoker
582
- * Legacy Invoker => :legacy_invoker
583
- * Transaction => :transaction
584
- * Remoting => :remoting
585
- * Properties Service => :properties
586
- * Database/Datasource => :database
587
- * JSR-88 => :jsr88
588
- * XNIO => :xnio
589
-
590
- Any slimmed service will be removed logically by using a ".rej" suffix in the files/directories.
591
-
592
- Tools
593
- -----------
594
-
595
- ### Command Line Slimming
596
-
597
- You can do a slimming using only the command line, just put your terminal in the profile dir
598
- and do the following:
599
-
600
- rboss-profile --this --slimming services-here
601
-
602
- This will slim the defined services. Use --verbose to see the changed files.
603
-
604
- To restore slimmed services, use --restore.
605
-
606
- rboss-profile --this --restore services-here
607
-
608
- ### Password Encryption
609
-
610
- You can use the SecureIdentityLoginModule to encrypt a password for use with a login module
611
- to secure a datasource password.
612
-
613
- rboss-profile --encrypt your-password-here
614
-
249
+ * `/lib/rboss/view/colorizers.rb`
250
+ * `/lib/rboss/view/formatters.rb`
251
+ * `/lib/rboss/view/health_checkers.rb`