JVM Monitoring
-
Hi,
this (and other) metrics requires JMX server name as an argument. You define JMX servers in agent configuration file (see https://www.netxms.org/documentation/adminguide/jvm-monitoring.html#configuration) Unfortunately, there is no agent list to return all configured JMX servers on that particular agent (we can add one in next release). So for now you cannot use instance discovery if you have multiple JMX servers monitored by one agent.
Best regards,
Victor -
-
Hi,
So, in agent configuration file, under [JMX] if I define Server=servername:login/password@url, then Parameter becomes JMX.Memory.Heap.Current(servername), right? And if I'm connecting to local Wildfly JMX then I should write Server=servername:wildfly/wildfly@localhost:9990. Is this OK? I'm confused about how to mention the port number.
I have tried all 3 formats, none working.- name:url
- name:login@url
- name:login/password@url
Though I'm able to connect to local Wildfly through JConsole/VisualVM.
Please guide.
Regards,
Deep
-
-
I've use this stackoverflow post: https://stackoverflow.com/questions/5552960/how-to-connect-to-a-java-program-on-localhost-jvm-using-jmx
For test I just use NetXMS management client:
java -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port=1234 -Dcom.sun.management.jmxremote.ssl=false -jar ~/Downloads/nxmc-4.4.4-standalone.jarAgent config has this:
Server=s:service:jmx:rmi:///jndi/rmi://127.0.0.1:1234/jmxrmiOn debug level 6 agent produces the following output in it's log:
2023.12.08 13:09:14.786 *D* [comm.cs.68 ] Requesting metric "JMX.VM.Version(s)" 2023.12.08 13:09:14.917 *D* [ ] JMX: connected to service:jmx:rmi:///jndi/rmi://127.0.0.1:1234/jmxrmi 2023.12.08 13:09:14.919 *D* [ ] JMX: reading object java.lang:type=Runtime attribute VmVersionI have no clue what all these things in the url mean, but hope that helps
Also, here's Oracle docs on the URL: https://docs.oracle.com/javase/8/docs/api/javax/management/remote/JMXServiceURL.html
-
I'm using Server = name:service:jmx:remote+http://localhost:9990 as applicable for JBoss EAP 7.1/Wildfly 11
This is throwing, Exception in parameter handler: java.net.MalformedURLException: Unsupported protocol: remote+http
I'm supposed to include jboss-client.jar in the application(netxms agent) classpath. Is it possible in NetXMS agent to include an external jar?
-
Java subagent has a few configuration parameters that can be provided in [JAVA] section of agent configuration file. See the code for list of params:
https://github.com/netxms/netxms/blob/master/src/agent/subagents/java/main.cpp#L131As I understand, you can use "ClassPath" parameter to add your .jar file.
-
-
I have found the problem with classpath setting in JMX plugin. Try to replace jmx.jar on your system with this version: https://cloud.radensolutions.com/s/WDCCtmPKHXGZwyo.
If you installed agent on Linux from packages it will be inside /usr/lib/netxms/java.Best regards,
Victor -
Hi Victor,
The agent is installed on a Windows machine, so I replaced the jmx.jar at \lib\java and now I'm getting the below given error:
2023.12.20 11:01:42.028 *D* [comm.cs.1 ] Requesting metric "JMX.Memory.Heap.Current(name)" 2023.12.20 11:01:42.439 *D* [ ] JMX: cannot setup connection to service:jmx:remote+http://localhost:9990 2023.12.20 11:01:42.440 *D* [ ] JMX: java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:936) 2023.12.20 11:01:42.440 *D* [ ] JMX: org.wildfly.common.context.ContextManager.getPrivileged(ContextManager.java:271) 2023.12.20 11:01:42.440 *D* [ ] JMX: org.wildfly.common.context.ContextManager.get(ContextManager.java:242) 2023.12.20 11:01:42.440 *D* [ ] JMX: org.jboss.remoting3.EndpointImpl.construct(EndpointImpl.java:231) 2023.12.20 11:01:42.440 *D* [ ] JMX: org.jboss.remoting3.EndpointBuilder.lambda$build$0(EndpointBuilder.java:128) 2023.12.20 11:01:42.440 *D* [ ] JMX: java.security.AccessController.doPrivileged(Native Method) 2023.12.20 11:01:42.440 *D* [ ] JMX: org.jboss.remoting3.EndpointBuilder.build(EndpointBuilder.java:128) 2023.12.20 11:01:42.440 *D* [ ] JMX: org.jboss.remotingjmx.RemotingConnector.internalRemotingConnect(RemotingConnector.java:204) 2023.12.20 11:01:42.440 *D* [ ] JMX: org.jboss.remotingjmx.RemotingConnector.internalConnect(RemotingConnector.java:156) 2023.12.20 11:01:42.440 *D* [ ] JMX: org.jboss.remotingjmx.RemotingConnector.connect(RemotingConnector.java:103) 2023.12.20 11:01:42.440 *D* [ ] JMX: javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:270) 2023.12.20 11:01:42.440 *D* [ ] JMX: org.netxms.agent.jmx.Server.connect(Server.java:95) 2023.12.20 11:01:42.440 *D* [ ] JMX: org.netxms.agent.jmx.Server.getAttributeValue(Server.java:234) 2023.12.20 11:01:42.440 *D* [ ] JMX: org.netxms.agent.jmx.JmxPlugin$JmxObjectParameterAdapter.getValue(JmxPlugin.java:278) 2023.12.20 11:01:42.440 *D* [ ] JMX: org.netxms.agent.SubAgent.parameterHandler(SubAgent.java:395) 2023.12.20 11:01:42.441 *D* [ ] JAVA: Exception in parameter handler: java.lang.NullPointerException: null 2023.12.20 11:01:42.441 *D* [ ] JAVA: java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:936) 2023.12.20 11:01:42.441 *D* [ ] JAVA: org.wildfly.common.context.ContextManager.getPrivileged(ContextManager.java:271) 2023.12.20 11:01:42.441 *D* [ ] JAVA: org.wildfly.common.context.ContextManager.get(ContextManager.java:242) 2023.12.20 11:01:42.441 *D* [ ] JAVA: org.jboss.remoting3.EndpointImpl.construct(EndpointImpl.java:231) 2023.12.20 11:01:42.441 *D* [ ] JAVA: org.jboss.remoting3.EndpointBuilder.lambda$build$0(EndpointBuilder.java:128) 2023.12.20 11:01:42.441 *D* [ ] JAVA: java.security.AccessController.doPrivileged(Native Method) 2023.12.20 11:01:42.441 *D* [ ] JAVA: org.jboss.remoting3.EndpointBuilder.build(EndpointBuilder.java:128) 2023.12.20 11:01:42.441 *D* [ ] JAVA: org.jboss.remotingjmx.RemotingConnector.internalRemotingConnect(RemotingConnector.java:204) 2023.12.20 11:01:42.441 *D* [ ] JAVA: org.jboss.remotingjmx.RemotingConnector.internalConnect(RemotingConnector.java:156) 2023.12.20 11:01:42.441 *D* [ ] JAVA: org.jboss.remotingjmx.RemotingConnector.connect(RemotingConnector.java:103) 2023.12.20 11:01:42.441 *D* [ ] JAVA: javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:270) 2023.12.20 11:01:42.441 *D* [ ] JAVA: org.netxms.agent.jmx.Server.connect(Server.java:95) 2023.12.20 11:01:42.441 *D* [ ] JAVA: org.netxms.agent.jmx.Server.getAttributeValue(Server.java:234) 2023.12.20 11:01:42.441 *D* [ ] JAVA: org.netxms.agent.jmx.JmxPlugin$JmxObjectParameterAdapter.getValue(JmxPlugin.java:278) 2023.12.20 11:01:42.441 *D* [ ] JAVA: org.netxms.agent.SubAgent.parameterHandler(SubAgent.java:395) 2023.12.20 11:01:42.442 *D* [ ] JAVA: SubAgent::parameterHandler("JMX.Memory.Heap.Current(name)", "JMX/JMX.Memory.Heap.Current(*)"): exception in Java codeAgent config file is as below:
MasterServers = 10.14.50.82 ConfigIncludeDir = C:\NetXMS\etc\nxagentd.conf.d LogFile = C:\NetXMS\log\nxagentd.log FileStore = C:\NetXMS\var SubAgent = winperf.nsm SubAgent = java.nsm DebugLevel = 6 [JAVA] Jvm = C:\Program Files\Java\jdk1.8.0_202\jre\bin\server\jvm.dll Classpath = C:\NetXMS\lib\java\tools.jar;C:\NetXMS\lib\java\jboss-client.jar;C:\NetXMS\lib\java\jboss-cli-client.jar; Plugin = jmx.jar [JMX] Server = name:service:jmx:remote+http://localhost:9990 -
Some info over the Internet suggests that jboss-cli-client.jar is better then then jboss-client.jar, so you may try removing C:\NetXMS\lib\java\jboss-client.jar; part from your classpath
-
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login