jiaqi / jmxterm Goto Github PK
View Code? Open in Web Editor NEWInteractive command line JMX client
Home Page: http://docs.cyclopsgroup.org/jmxterm
License: Apache License 2.0
Interactive command line JMX client
Home Page: http://docs.cyclopsgroup.org/jmxterm
License: Apache License 2.0
Tried with Java9.0.4
Build time error:
[INFO] Running org.cyclopsgroup.jmxterm.pm.JConsoleClassLoaderFactoryTest
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.049 s <<< FAILURE! - in org.cyclopsgroup.jmxterm.pm.JConsoleClassLoaderFactoryTest
[ERROR] testLoad(org.cyclopsgroup.jmxterm.pm.JConsoleClassLoaderFactoryTest) Time elapsed: 0.012 s <<< ERROR!
java.lang.RuntimeException: Operation requires JDK instead of JRE
at org.cyclopsgroup.jmxterm.pm.JConsoleClassLoaderFactoryTest.testLoad(JConsoleClassLoaderFactoryTest.java:22)
Runtime error:
:~/Downloads$ java -jar jmxterm-1.0.0-uber.jar
java.lang.NullPointerException
at org.codehaus.classworlds.Launcher.getEnhancedMainMethod(Launcher.java:195)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:294)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.codehaus.classworlds.uberjar.boot.Bootstrapper.bootstrap(Bootstrapper.java:209)
at org.codehaus.classworlds.uberjar.boot.Bootstrapper.main(Bootstrapper.java:116)
It'd be nice to spin this up as a docker instance. It'd be compatible for people with java 9 + (partial workaround for #48) if they can build/run as a docker image. Publishing this officially to dockerhub would make this very accessible
Tried to connect to a local JVM with 1.0.1, openjdk-8-jdk.
Welcome to JMX terminal. Type "help" for available commands.
$>open 17057
#UndeclaredThrowableException:
$>
Hi,
Even when adding the following SSL properties, jmxterm over SSL+authentication failed (while it works in clear + authentication). Does jmxterm support SSL and could you provide an example ?
-Djavax.net.ssl.trustStore=/etc/cassandra/truststore.jks
-Djavax.net.ssl.trustStorePassword=changeit
-Dcom.sun.management.jmxremote.registry.ssl=true
-Dssl.enable=true
java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: non-JRMP server at remote endpoint]
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:369)
at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:270)
at org.cyclopsgroup.jmxterm.cc.SessionImpl.doConnect(SessionImpl.java:85)
at org.cyclopsgroup.jmxterm.cc.SessionImpl.connect(SessionImpl.java:49)
at org.cyclopsgroup.jmxterm.cc.CommandCenter.connect(CommandCenter.java:110)
at org.cyclopsgroup.jmxterm.boot.CliMain.execute(CliMain.java:139)
at org.cyclopsgroup.jmxterm.boot.CliMain.main(CliMain.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.classworlds.Launcher.launchStandard(Launcher.java:353)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:264)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.classworlds.uberjar.boot.Bootstrapper.bootstrap(Bootstrapper.java:209)
at org.codehaus.classworlds.uberjar.boot.Bootstrapper.main(Bootstrapper.java:116)
Caused by: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: non-JRMP server at remote endpoint]
at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:136)
at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:205)
at javax.naming.InitialContext.lookup(InitialContext.java:417)
at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1955)
at javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:1922)
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:287)
... 20 more
Caused by: java.rmi.ConnectIOException: non-JRMP server at remote endpoint
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:248)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:338)
at sun.rmi.registry.RegistryImpl_Stub.lookup(RegistryImpl_Stub.java:112)
at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:132)
... 25 more
Hi,
The project's wiki page points to this github repository for the source code (see http://wiki.cyclopsgroup.org/jmxterm/source.html).
However this github project does not have any releases. Without any releases it's not really possible (to easily) download the exact source code for a certain release. For example I need to download the source code for the 1.0 alpha 4 version (e.g. for legal check for a big company, which has a process for legal check, which requires the source code packages of open source components with their respective versions).
Apart from this, having releases of a software makes life easier anyway and this is how things normally work.
Please, please create a release at least for 1.0 alpha 4 version and for further releases!
It looks like you have the process for building the .deb
https://github.com/jiaqi/jmxterm/blob/master/pom.xml#L234
So all that is needed is a repo for hosting it ?
I created a pull request for this.
Hi, I have a JMX operation that takes a string that has spaces in it, if I try to, for example:
run runnableOperation "this is my argument"
I get:
Operation runnableOperation with 4 parameters doesn't exist in bean ....
Or, if my operation requires a - in the argument, the Commons-Cli parser fails:
Am I doing the right thing by putting my string arguments in " or is there another way? Is there a workaround?
Many thanks, otherwise JMXTerm is fantastic.
Dan.
Fetching an attribute that has a period in its name via jmxterm always returns null. I've verified via jconsole that the values exist for these attributes.
This change(8834e1e) added support of getting a sub attribute of a combo mbean but the auto-complete part of GetCommand isn't updated accordingly.
There's no point in providing ASC files if we cannot find your public key. Please rectify. Thank You.
We are trying to invoke a method on an MBean that have two methods defined
registerProcess(String, int)
registerProcess(String, String)
We want to invoke the second method but jmxterm always chooses the first method it sees having the correct name and number of arguments. It does not seem to take the actual method signature into consideration.
Any workaround to this?
This issue was observered with jmxterm-1.0-alpha-4-uber.jar
Hi there,
Im using jmxterm to monitor jmx mbeans of Solr.
When i set the domain like => "domain solr/song" then run beans command. It gives me all beans list.
Well. When i send request any attribute of any beans, i get it, bean name isn't valid.
How could it be ?
Example :
$>domain solr/song
$>beans
solr/song:id=debug,type=debug
solr/song:id=facet,type=facet
solr/song:id=get,type=get
solr/song:id=highlight,type=highlight
solr/song:id=mlt,type=mlt
$>get -b solr/song:id=mlt,type=mlt *
Switching in RHEL7 from :
1.8.0.171-8.b10.el7_5
to
11.0.1.13-3.el7_6
or 11.0.4.11-1.el7_7
.
The following command:
java -jar /opt/applications/monitoring/jmxterm-1.0.0-uber.jar -l ${KAFKA_HOST}:9999 -n < /opt/applications/monitoring/jmx-config
throws the following exception:
java.lang.NullPointerException
at org.codehaus.classworlds.Launcher.getEnhancedMainMethod(Launcher.java:195)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:294)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.codehaus.classworlds.uberjar.boot.Bootstrapper.bootstrap(Bootstrapper.java:209)
at org.codehaus.classworlds.uberjar.boot.Bootstrapper.main(Bootstrapper.java:116)
My gut feeling that it generally doesn't work with OpenJDK11 independently of the exact version
(edit: format exception)
java -Djavax.net.ssl.trustStore=/path/truststore.jks -Djavax.net.ssl.trustStorePassword=password -jar jmxterm-1.0.1-uber.jar -l service:jmx:rmi:///jndi/rmi://1.2.3.4:8099/jmxrmi -u foo -p foobar
Exception in thread "main" java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: non-JRMP server at remote endpoint]
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:369)
at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:270)
at org.cyclopsgroup.jmxterm.cc.SessionImpl.doConnect(SessionImpl.java:64)
at org.cyclopsgroup.jmxterm.cc.SessionImpl.connect(SessionImpl.java:39)
at org.cyclopsgroup.jmxterm.cc.CommandCenter.connect(CommandCenter.java:103)
at org.cyclopsgroup.jmxterm.boot.CliMain.execute(CliMain.java:126)
at org.cyclopsgroup.jmxterm.boot.CliMain.main(CliMain.java:41)
Caused by: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: non-JRMP server at remote endpoint]
at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:136)
at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:205)
at javax.naming.InitialContext.lookup(InitialContext.java:417)
at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1955)
at javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:1922)
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:287)
... 6 more
Caused by: java.rmi.ConnectIOException: non-JRMP server at remote endpoint
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:248)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:338)
at sun.rmi.registry.RegistryImpl_Stub.lookup(RegistryImpl_Stub.java:112)
at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:132)
... 11 more
With jconsole it works.
From an earlier issue, this was fixed in 1.0.1 ?
example:
error:
$>bean -d java.lang java.lang:name=Perm Gen
#IllegalArgumentException: Bean name java.lang:name=Perm isn't valid
$>bean java.lang:name=Perm Gen,type=MemoryPool
#IllegalArgumentException: Please specify domain using either -d option or domain command
normal:
$>bean java.lang:name=CodeCacheManager,type=MemoryManager
#bean is set to java.lang:name=CodeCacheManager,type=MemoryManager
From shell script I am invoking jmxterm command like below:
java -cp $component_home/$component_name-$buildVersion.jar org.cyclopsgroup.jmxterm.boot.CliMain --url "$jmxURL" -n -input $tmpfile
But it generates set of debug logs which I don't want to give to end user. Is there any way to switch off all log level except ERROR?
Welcome to JMX terminal. Type "help" for available commands.
#domain is set to com.anz.markets.efx.client.stp
#bean is set to com.anz.markets.efx.client.stp:name=ClientStpGridPublisherJMXEndpoint
#calling operation reprocessFailedEvents of mbean com.anz.markets.efx.client.stp:name=ClientStpGridPublisherJMXEndpoint
#operation returns:
15:12:08.453 [main] DEBUG org.apache.commons.beanutils.converters.BooleanConverter - Setting default value: false
15:12:08.458 [main] DEBUG org.apache.commons.beanutils.converters.BooleanConverter - Converting 'Boolean' value 'false' to type 'Boolean'
15:12:08.458 [main] DEBUG org.apache.commons.beanutils.converters.BooleanConverter - No conversion required, value is already a Boolean
Out of the box checkout, the rpm:rpm
plugin doesn't work on:
Maven: 3.5.4
Java: 1.8.0_172
The parent pom specifies a maven-site-plugin
version of 3.4, however I run into problems under the above config that seems to suggest the older version of the site plugin no longer functional in modern JVMs:
I tried hacking a copy of the parent plugin to set the site plugin to 3.7.1 but running into further incompatibilities:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.7.1:site (default-site) on project jmxterm: SiteToolException: Error parsing site descriptor: TEXT must be immediately followed by END_TAG and not START_TAG (position: START_TAG seen ..."\n src="http://www.google-analytics.com/urchin.js">... @16:65) -> [Help 1]
Looks like a URL somewhere in one of the POM descriptors is not returning something expected ?
This is related to #4
We have bean name holding a space in it. It seems not possible to fetch them. It would be nice if these could be protected by double-quotes for instance
Out of the box checkout does fail immediately - probably missing dependencies, that mvn can not resolve...
$ mvn install
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.cyclopsgroup:jmxterm:1.0.0-SNAPSHOT (jmxterm\pom.xml) has 1 error
[ERROR] Non-resolvable parent POM: Could not find artifact org.cyclopsgroup:cyclopsgroup-java-parent:pom:1.0.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 6, column 13 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
So where can I get this parent-dependency?
I can't be certain this is still true because I'm having trouble actually building the RPM, but I've hit this same problem myself a few times I think I'm probably close to right here.
$ rpm -ql jmxterm | grep bin
/usr/bin
/usr/bin/jmxterm
(this is on an older version of the JMXTERM package I created ages ago)
The RPM is declaring it owns /usr/bin
, which I think you'll agree is overreaching a bit.
I think you will need to modify the pom so that the <directoryIncluded>false</directoryIncluded>
for the jmxterm.sh
section of the maven-rpm-plugin configuration..
The build fails because it depends on jcli:1.0-SNAPSHOT, however that artifact is not available in any of the public repositories.
The code does not compile using the publicly available jcli:1.0-alpha-4 though.
I also tried to check out the jcli sources from https://cyclops-group.svn.sourceforge.net/svnroot/cyclops-group/jcli/trunk/ but jmxterm does not build against that version either.
it would be great if there were a new verbosity level, something like "ERROR_ONLY" which would print a brief error message for any error, but act like SILENT for any non-error messages.
First thank you for this great tool, it helps a lot when you try to work from cli/ssh.
I was trying to get the list of jdbc configured datasources from a jboss as server and the jmx name should looks like this โjboss.as:subsystem=datasources,data-source=โ . Trying to use this in jmxterm returns:
$>info -b jboss.as:subsystem=datasources,data-source=
#IllegalArgumentException: Bean name jboss.as:subsystem=datasources,data-source=* isn't valid
$>bean jboss.as:subsystem=datasources,data-source=*
#IllegalArgumentException: Bean name jboss.as:subsystem=datasources,data-source=* isn't valid
but I am able to get information if I select:
$>bean jboss.as:subsystem=datasources
#bean is set to jboss.as:subsystem=datasources
$>bean jboss.as:subsystem=datasources,data-source=ExampleDS,statistics=pool
#bean is set to jboss.as:subsystem=datasources,data-source=ExampleDS,statistics=pool
For mbean model and supported childrens please have a look on:
https://access.redhat.com/webassets/avalon/d/red_hat_jboss_enterprise_application_platform/7.3/mgmt_model/subsystem/datasources/index.html
There is another way to query for the list of childrens or how can I get the list of mbean childrens using jmxterm ?
Thank you in advance for the time and effort you put in this.
open service:jmx:remote+http://127.0.0.1:9990
gives:
#RuntimeIOException: Runtime IO exception: Unsupported protocol: remote+http
same with
open service:jmx:http-remoting-jmx://127.0.0.1:9990
which gives:
#RuntimeIOException: Runtime IO exception: Unsupported protocol: http-remoting-jmx
added jboss-client.jar to the classpath but no help. Without this, jmxterm cannot manage wildfly java environment.
In our app, we have domains with "#" in between, eg: aaa#bbb#ccc#
using jconsole eg, we could select the domain
but when try to set the domain in the jmxterm, it got truncated (left with aaa), and hence the domain cannot be set.
but the "domains" command is able to list it.
in src/main/java/org/cyclopsgroup/jmxterm/cc/CommandCenter.java , the doExecute(String command) method truncate the # , why?
// Truncate command if there's # character
int commandEnds = command.indexOf( '#' );
if ( commandEnds != -1 )
{
command = command.substring( 0, commandEnds );
}
Hi.
I am getting following warnings while connecting to the jxm console:
$ java -jar /vendor/jmxterm/jmxterm-1.0.2-uber.jar -l 119511
Delete /u01/app/home/asmsadm/.jmxterm_history if you encounter error right after launching me.WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.cyclopsgroup.jmxterm.utils.WeakCastUtils$2 (file:/vendor/jmxterm/jmxterm-1.0.2-uber.jar) to method sun.tools.jconsole.LocalVirtualMachine.getAllVirtualMachines()
WARNING: Please consider reporting this to the maintainers of org.cyclopsgroup.jmxterm.utils.WeakCastUtils$2
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Welcome to JMX terminal. Type "help" for available commands.
$>Fri Sep 25 15:18:45 EDT 2020: Connected nj01smgapp5061.smg.iconectiv.com
/
#IllegalArgumentException: Command / isn't valid, run help to see available commands
$>
$>
Version 1.0.1 jar file contains package 'org.apache.commons.collections.*', which was not used anymore. Please remove it in future release.
JmxTerm ignores \
symbols in method params even if it's escaped.
Please add metadata to the pom for this project. We are using your awesome component in our project and would like to automate license attribution, and some projects fail to include which makes things harder.
See: https://maven.apache.org/pom.html#Licenses
Thanks for jmxterm!
I'm trying to run jmxterm on a docker image that has a headless JVM installed. I get the following error:
root@51a832163f66:/var/lib/jetty# java -jar /jmxterm-1.0.0-uber.jar
Welcome to JMX terminal. Type "help" for available commands.
$>open 1
#UnsupportedOperationException: /usr/lib/jvm/java-8-openjdk-amd64/lib/jconsole.jar file is not found
Is there any way to run jmxterm on a headless JVM?
Rebuilt 56880c0 from clean (fresh clone, deleted ~/.m2)
Now tab completion fails with this:
$ java -jar ~/jmxterm/target/jmxterm-1.0-SNAPSHOT-uber.jar -l localhost:50111
Welcome to JMX terminal. Type "help" for available commands.
$>bean <TAB>
---------------------------------------------------
constituent[0]: jar:file:/home/oliver/jmxterm/target/jmxterm-1.0-SNAPSHOT-uber.jar!/WORLDS-INF/lib/jmxterm.jar
constituent[1]: jar:file:/home/oliver/jmxterm/target/jmxterm-1.0-SNAPSHOT-uber.jar!/WORLDS-INF/lib/commons-beanutils.jar
constituent[2]: jar:file:/home/oliver/jmxterm/target/jmxterm-1.0-SNAPSHOT-uber.jar!/WORLDS-INF/lib/commons-collections.jar
constituent[3]: jar:file:/home/oliver/jmxterm/target/jmxterm-1.0-SNAPSHOT-uber.jar!/WORLDS-INF/lib/commons-lang.jar
constituent[4]: jar:file:/home/oliver/jmxterm/target/jmxterm-1.0-SNAPSHOT-uber.jar!/WORLDS-INF/lib/commons-logging.jar
constituent[5]: jar:file:/home/oliver/jmxterm/target/jmxterm-1.0-SNAPSHOT-uber.jar!/WORLDS-INF/lib/commons-io.jar
constituent[6]: jar:file:/home/oliver/jmxterm/target/jmxterm-1.0-SNAPSHOT-uber.jar!/WORLDS-INF/lib/caff.jar
constituent[7]: jar:file:/home/oliver/jmxterm/target/jmxterm-1.0-SNAPSHOT-uber.jar!/WORLDS-INF/lib/jcli.jar
constituent[8]: jar:file:/home/oliver/jmxterm/target/jmxterm-1.0-SNAPSHOT-uber.jar!/WORLDS-INF/lib/jline.jar
---------------------------------------------------
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.classworlds.uberjar.boot.Bootstrapper.bootstrap(Bootstrapper.java:209)
at org.codehaus.classworlds.uberjar.boot.Bootstrapper.main(Bootstrapper.java:116)
Caused by: java.lang.NoClassDefFoundError: jline/Completor
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:792)
at java.lang.ClassLoader.defineClass(ClassLoader.java:635)
at org.codehaus.classworlds.UberJarRealmClassLoader.loadClassDirect(UberJarRealmClassLoader.java:199)
at org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:255)
at org.codehaus.classworlds.RealmClassLoader.loadClass(RealmClassLoader.java:214)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.cyclopsgroup.jmxterm.cc.ConsoleCompletor.complete(ConsoleCompletor.java:71)
at jline.console.ConsoleReader.complete(ConsoleReader.java:3077)
at jline.console.ConsoleReader.readLine(ConsoleReader.java:2501)
at jline.console.ConsoleReader.readLine(ConsoleReader.java:2162)
at org.cyclopsgroup.jmxterm.io.JlineCommandInput.readLine(JlineCommandInput.java:48)
at org.cyclopsgroup.jmxterm.boot.CliMain.execute(CliMain.java:173)
at org.cyclopsgroup.jmxterm.boot.CliMain.main(CliMain.java:50)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.classworlds.Launcher.launchStandard(Launcher.java:353)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:264)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
... 6 more
The failing line is attempting to construct a CliCompletor instance (from jcli).
jline.Completor does not exist in the version of jline packaged with jmxterm.
So this looks like version skew in the version of jline expected by jmxterm and jcli.
I seem to get rather poor performance from jmxterm compared to cmdline-jmxclient. Are there any flags to the build or command to speed this along?
[08:21:06][malexander@aztlan jmxterm-master]$ time echo get -s -b java.lang:type=Runtime Name | java -jar target/jmxterm-1.0-SNAPSHOT-uber.jar -l renraku:4242 -u qanmsuser -p ******
Welcome to JMX terminal. Type "help" for available commands.
$>get -s -b java.lang:type=Runtime Name
#mbean = java.lang:type=Runtime:
20574@renraku
$>
real 0m4.082s
user 0m3.634s
sys 0m0.128s
[08:21:14][malexander@aztlan jmxterm-master]$ time java -jar ~/bin/cmdline-jmxclient-0.10.3.jar qanmsuser:****** renraku:4242 java.lang:type=Runtime Name
06/14/2013 08:21:21 -0400 org.archive.jmx.Client Name: 20574@renraku
real 0m0.514s
user 0m0.188s
sys 0m0.044s
I tried to build an RPM from master
today, but when I run jmxterm
I get the classic slf4j
error/warning:
https://www.slf4j.org/codes.html#StaticLoggerBinder
By adding in a slf4j-simple
into the dependency set these messages go away. I'm not sure if this is the best way to do it, and what affect it would have on jmxterm
logging though.
I'm very familiar with Maven, and I've checked out the latest master and tried to build (so I could generate an RPM) but I'm getting this failure:
[ jmxterm ](master)$ mvn package
[INFO] Scanning for projects...
[WARNING] The POM for org.cyclopsgroup:kaufman-beans:jar:1.0.0-SNAPSHOT is missing, no dependency information available
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.cyclopsgroup:jmxterm:1.0.0-SNAPSHOT (/workspace_intellij/jmxterm/pom.xml) has 1 error
[ERROR] Unresolveable build extension: Plugin org.cyclopsgroup:awss3-maven-wagon:1.4.0 or one of its dependencies could not be resolved: Failure to find org.cyclopsgroup:kaufman-beans:jar:1.0.0-SNAPSHOT in https://repo.aconex.com/content/groups/public-snapshots was cached in the local repository, resolution will not be reattempted until the update interval of nexus-public-snapshots has elapsed or updates are forced -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
I can't find exactly where the awss3-maven-wagon dependency is coming in from because I can't build it (a requirement for mvn dependency:tree
) but the underlying kaufman-beans
dependency is not in the Maven Central repo I can see (certainly not through oss.sonatype.org
I'm searching.)
I am looking for a new formatter which can display both the mbean + attribute value in a single line, so that it will be easy for to integrate the jmxterm in a background process to auto pull the jvm metrics on a periodic time.
https://docs.cyclopsgroup.org/jmxterm links to v1.0.0, which is not the latest.
$ java -version
openjdk version "11.0.5" 2019-10-15 LTS
OpenJDK Runtime Environment Corretto-11.0.5.10.1 (build 11.0.5+10-LTS)
OpenJDK 64-Bit Server VM Corretto-11.0.5.10.1 (build 11.0.5+10-LTS, mixed mode)
$ java -jar jmxterm-1.0.0-uber.jar
java.lang.NullPointerException
at org.codehaus.classworlds.Launcher.getEnhancedMainMethod(Launcher.java:195)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:294)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.codehaus.classworlds.uberjar.boot.Bootstrapper.bootstrap(Bootstrapper.java:209)
at org.codehaus.classworlds.uberjar.boot.Bootstrapper.main(Bootstrapper.java:116)
I try to run following commnad:
beans -d java.lang:name=Code Cache,type=MemoryPool
Then I get:
#IllegalArgumentException: Domain java.lang:name=Code doesn't exist, check your spelling
It looks like this command does not handle well with names having ' ' (in my case 'Code Cache ')
Thanks for this great tool, I use it a lot. But in one of my environments, I am unable to open a connection to a running Tomcat (all components do work on other machines with JMXTerm uber 1.0.2). Please refer this attempt:
after both open commands in my screenshot I've waited several minutes without it getting back to prompt. I then ctrl+c out of it. I dont understand, what I am missing here. There is no feedback (also with verbose option on). I'd expect an error, or a timeout oslt.
I'd be happy if you could advise!
I get the following error while launching with the following arguments:
java -jar jmxterm-1.0-alpha-4-uber.jar -l localhost:9010 -v
java.lang.IllegalArgumentException: No enum constant org.cyclopsgroup.jmxterm.io.VerboseLevel.
at java.lang.Enum.valueOf(Enum.java:238)
at org.cyclopsgroup.jmxterm.io.VerboseLevel.valueOf(VerboseLevel.java:12)
at org.cyclopsgroup.jmxterm.boot.CliMain.execute(CliMain.java:73)
at org.cyclopsgroup.jmxterm.boot.CliMain.main(CliMain.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.classworlds.Launcher.launchStandard(Launcher.java:353)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:264)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.classworlds.uberjar.boot.Bootstrapper.bootstrap(Bootstrapper.java:209)
at org.codehaus.classworlds.uberjar.boot.Bootstrapper.main(Bootstrapper.java:116)
Hi,
I'm trying to only get the value of java.lang:type=Memory HeapMemoryUsage.used.
The following does not work:
echo 'get used -s -b java.lang:type=Memory HeapMemoryUsage' | java -jar /tmp/jmxterm-1.0-alpha-4-uber.jar -l localhost:10006 -v silent -n
The result is
{
committed = 663617536;
init = 62761024;
max = 1908932608;
used = 424752800;
}
What I expected is
424752800
I'm not a java programmer, but a sysadmin trying to get these values into Zabbix.
Can you give me a clue?
Thanks,
Sven
I'm using jmxterm
to check if my services are running using something like this:
echo "get -s -b kafka.server:type=app-info version" | java -jar /usr/bin/jmxterm-1.0.0-uber.jar -l 127.0.0.1:10000 -n -e
As side effect, I'm seeing several (more than 20) threads JMX server connection timeout XXX
on my service.
Seems jmxterm is not disconnecting.
I see it does close()
the session, but, doesn't disconnected()
the fore mentioned session.
I will be submitting a patch shortly
Pls suggest
$>beans
#domain = java.nio:
java.nio:name=direct,type=BufferPool
java.nio:name=mapped,type=BufferPool
$>bean java.nio:type=BufferPool
#IllegalArgumentException: Bean name java.nio:type=BufferPool isn't valid
Hi there ๐, we detect that the latest version uses a dependency with security issues:
commons-beanutils
1.9.3
I've seen that was updated in commit 7cb8f02 but no release was triggered.
Do you have a release scheduled soon?
I'm trying to open a connection to a local java process using the open PID
command.
Whe doing so I have the follwoin g exception (in verbose mode):
Welcome to JMX terminal. Type "help" for available commands.
$>open 1933
java.lang.UnsupportedOperationException: Operation requires JDK instead of JRE
at org.cyclopsgroup.jmxterm.pm.UnsupportedJavaProcessManager.get(UnsupportedJavaProcessManager.java:54)
at org.cyclopsgroup.jmxterm.SyntaxUtils.getUrl(SyntaxUtils.java:59)
at org.cyclopsgroup.jmxterm.cmd.OpenCommand.execute(OpenCommand.java:73)
at org.cyclopsgroup.jmxterm.cc.CommandCenter.doExecute(CommandCenter.java:188)
at org.cyclopsgroup.jmxterm.cc.CommandCenter.doExecute(CommandCenter.java:158)
at org.cyclopsgroup.jmxterm.cc.CommandCenter.execute(CommandCenter.java:206)
at org.cyclopsgroup.jmxterm.boot.CliMain.execute(CliMain.java:176)
at org.cyclopsgroup.jmxterm.boot.CliMain.main(CliMain.java:50)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.classworlds.Launcher.launchStandard(Launcher.java:353)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:264)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.classworlds.uberjar.boot.Bootstrapper.bootstrap(Bootstrapper.java:209)
at org.codehaus.classworlds.uberjar.boot.Bootstrapper.main(Bootstrapper.java:116)
Caused by: java.lang.RuntimeException: Operation requires JDK instead of JRE
at org.cyclopsgroup.jmxterm.pm.JConsoleClassLoaderFactory.getClassLoader(JConsoleClassLoaderFactory.java:42)
at org.cyclopsgroup.jmxterm.cc.JPMFactory.<init>(JPMFactory.java:34)
at org.cyclopsgroup.jmxterm.cc.CommandCenter.<init>(CommandCenter.java:87)
at org.cyclopsgroup.jmxterm.cc.CommandCenter.<init>(CommandCenter.java:71)
at org.cyclopsgroup.jmxterm.boot.CliMain.execute(CliMain.java:136)
... 15 more
The java environment is indeed a JRE and not a JDK however, checking the code the strack tracepoints to I don't understand why I'm getting this error.
JConsoleClassLoaderFactory.java tests for java.io.File.isFile('lib/tools.jar') and should only throw this RuntimeException in case it this file is not a file.
I have started jmxterm setting the JAVA_HOME env to the directory containing lib/ and even tried starting it with java installation being the PWD as well...
Why am I getting this exception and is the JDK really needed in order to open a local process?
I'm troubleshooting some Cassandra issues and I've narrowed it down to some oddness around jmx being accessed externally (externally from the server). Using jmxterm, I can connect locally on a Cassandra host, but cannot fully connect remotely to the other nodes in the cluster. Can you shed some light on what this connection error would mean? My best guess is the random ephemeral port the connection switches to after the initial connection is made is failing, but I can't see how. See log below - first connection is the local host, second connection is the host right next to it.
$ java -jar jmxterm-1.0.1-uber.jar -v verbose Welcome to JMX terminal. Type "help" for available commands. $>open 10.148.20.31:7199 #Connection to 10.148.20.31:7199 is opened $>close #disconnected $>open 10.148.20.32:7199 org.cyclopsgroup.jmxterm.io.RuntimeIOException: Runtime IO exception: no such object in table at org.cyclopsgroup.jmxterm.cc.CommandCenter.doExecute(CommandCenter.java:144) at org.cyclopsgroup.jmxterm.cc.CommandCenter.execute(CommandCenter.java:184) at org.cyclopsgroup.jmxterm.boot.CliMain.execute(CliMain.java:141) at org.cyclopsgroup.jmxterm.boot.CliMain.main(CliMain.java:41) Caused by: java.rmi.NoSuchObjectException: no such object in table at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:303) at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:279) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:164) at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:235) at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:180) at com.sun.proxy.$Proxy8.newClient(Unknown Source) at javax.management.remote.rmi.RMIConnector.getConnection(RMIConnector.java:2430) at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:308) at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:270) at org.cyclopsgroup.jmxterm.cc.SessionImpl.doConnect(SessionImpl.java:64) at org.cyclopsgroup.jmxterm.cc.SessionImpl.connect(SessionImpl.java:39) at org.cyclopsgroup.jmxterm.cmd.OpenCommand.execute(OpenCommand.java:60) at org.cyclopsgroup.jmxterm.cc.CommandCenter.doExecute(CommandCenter.java:169) at org.cyclopsgroup.jmxterm.cc.CommandCenter.doExecute(CommandCenter.java:142) ... 3 more $>
As already mentioned by others, looks like not working with headless jre, is it known and expected? Or it's going and is possible to be fixed?
98s Warning Unhealthy pod/xxxxxx-7d5588cf66-ss9xp Liveness probe failed: Exception in thread "main" j
ava.lang.UnsupportedOperationException: sun.tools.jconsole.LocalVirtualMachine, operation on this JDK(11.0.9.1+1-LTS) is
n't fully supported
at org.cyclopsgroup.jmxterm.pm.UnsupportedJavaProcessManager.get(UnsupportedJavaProcessManager.java:40)
at org.cyclopsgroup.jmxterm.SyntaxUtils.getUrl(SyntaxUtils.java:41)
at org.cyclopsgroup.jmxterm.boot.CliMain.execute(CliMain.java:135)
at org.cyclopsgroup.jmxterm.boot.CliMain.main(CliMain.java:41)
Caused by: java.lang.ClassNotFoundException: sun.tools.jconsole.LocalVirtualMachine
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at org.cyclopsgroup.jmxterm.jdk6.Jdk6JavaProcessManager.<init>(Jdk6JavaProcessManager.java:22)
at org.cyclopsgroup.jmxterm.cc.JPMFactory.<init>(JPMFactory.java:33)
at org.cyclopsgroup.jmxterm.cc.CommandCenter.<init>(CommandCenter.java:75)
at org.cyclopsgroup.jmxterm.cc.CommandCenter.<init>(CommandCenter.java:60)
at org.cyclopsgroup.jmxterm.boot.CliMain.execute(CliMain.java:113)
... 1 more
during the output phase of a command (say "get"), each and every value gets written out to stdout/file immediately - there is no caching/flushing happening out of the box.
This results in lots of individual write system-calls.
Example system calls for get -i -b "java.lang:type=Memory" * :
write(1, " ", 2) = 2
write(1, "init", 4) = 4
write(1, " = ", 3) = 3
write(1, "24313856", 8) = 8
write(1, ";", 1) = 1
write(1, " (init)", 7) = 7
write(1, "\n", 1) = 1
write(1, " ", 2) = 2
write(1, "max", 3) = 3
write(1, " = ", 3) = 3
write(1, "138412032", 9) = 9
write(1, ";", 1) = 1
write(1, " (max)", 6) = 6
write(1, "\n", 1) = 1
This is bad from a performance perspective and also bad for efficient output parsing...
Some caching/flushing would help reduce the overhead and help with output parsing.
I'm not sure if this is a regression from: https://bugs.launchpad.net/jmxterm/+bug/319064
But I'm trying to pass in an empty string and it keeps getting converted to null:
$>run forceKeyspaceCleanup keyspace1 ""
#calling operation forceKeyspaceCleanup of mbean org.apache.cassandra.db:type=StorageService with params [keyspace1, null]
javax.management.RuntimeMBeanException: java.lang.NullPointerException
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.rethrow(DefaultMBeanServerInterceptor.java:839)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.rethrowMaybeMBeanException(DefaultMBeanServerInterceptor.java:852)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:821)
I also tried with double quotes around keyspace1 and it had the same output.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.