Advertise with us

Search Mastertheboss

Our eBooks

Monitor JBoss AS with Jolokia

j4psh vs JBoss CLI

Jolokia includes j4psh which is a JMX shell which is using standard MBean names, provides syntax highlighting together with code completion and even wildcard patterns. In j4psh you will be using similar command as JBoss AS 7 CLI.

Here's a partial list of the most useful j4psh commands:

  • connect, to connect to an Java EE server with the jolokia.war deployed or using the Java agent
  • pwd, to find out the current MBean name or domain
  • cd, to navigate to an MBean or domain
  • ls, to list MBean details (works with * and can be restricted as “ls -a” for attributes and “ls -o” for operations).
  • cat, to display attribute values

Here's a snapshot of the j4psh shell:

jolokia tutorial jboss
Although the two products are not aiming at the same target (the CLI is the official AS7 administration and configuration tool, while the Jolokia shell is designed to interact with the AS Mbeans) we can try a comparison of them:

Functionality JBoss CLI j4psh
Installation Built-in in JBoss AS 7 Need installing jmx4perl
Availability Specific of JBoss AS 7 Multivendors (Most other application servers, Mule agent, JVM agent OSGi agent)
Syntax Proprietary shell-like syntax Standard MBean name
Autocompletion yes yes
Syntax highlighting no yes
Commands history yes yes
Take system snapshot yes no
Return format Text, XML JSON
Accessible Data All application server subsystems All accessible MBeans
Authentication Role based authentication. (SSL, HTTP-Authentication) and support for custom policies.
Firewall friendly Requires opening port on the firewall Communication is over HTTP, proxying through firewalls becomes mostly a none-issue
Bulk requests The batch mode allows one to group commands and operations and execute them together as an atomic unit. Can process many JMX requests with a single roundtrip.
Multiplatform No Available also to Javascript and Perl clients
Non interactive mode Possible to send multiple requests using non-interactive mode No
GUI mode Available GUI interface No
Resource shortcuts Available shortcuts for creation of most common resources (JMS destinations/ Datasources) No
Server and Domain management yes No

So, as you can see, although j4psh and the AS 7 CLI bear some similarities, the AS 7 CLI is the defacto administration and management tool. On the other hand j4psh and Jolokia is a very cool addition for interacting with the server MBeans thanks to its multiplatform and multivendor availability.


© 2021 All Rights Reserved.

Please publish modules in offcanvas position.