Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Support
  3. JVM Monitoring

JVM Monitoring

Scheduled Pinned Locked Moved Support
11 Posts 3 Posters 13.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D
    D
    deepb
    wrote on last edited by
    #1

    Hi,

    I'm new to NetXMS and want to monitor JVM as given in JVM monitoring — NetXMS Administrator Guide (4.4.3).
     
    I have created new DCI parameter as below:

    Parameter : JMX.Memory.Heap.Current({instance})
    Instance Discovery Method : Agent List

    What should be the List name? Is any filtering script required?  Please help!

    1 Reply Last reply
    0
    • V
      V
      Victor Kirhenshtein
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • D
        D
        deepb
        wrote on last edited by
        #3
        • 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.

          1. name:url
          2. name:login@url
          3. name:login/password@url

          Though I'm able to connect to local Wildfly through JConsole/VisualVM.

          Please guide.

          Regards,
          Deep

        1 Reply Last reply
        0
        • F
          F
          Filipp Sudanov
          wrote on last edited by
          #4

          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.jar
          

          Agent config has this:

          Server=s:service:jmx:rmi:///jndi/rmi://127.0.0.1:1234/jmxrmi
          

          On 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 VmVersion
          

          I 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

          1 Reply Last reply
          0
          • D
            D
            deepb
            wrote on last edited by
            #5

            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?

            1 Reply Last reply
            0
            • F
              F
              Filipp Sudanov
              wrote on last edited by
              #6

              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#L131

              As I understand, you can use "ClassPath" parameter to add your .jar file.

              1 Reply Last reply
              0
              • D
                D
                deepb
                wrote on last edited by
                #7

                Added jboss-client.jar using Classpath but that didn't solve the problem. Still getting  java.net.MalformedURLException: Unsupported protocol: remote+http

                1 Reply Last reply
                0
                • V
                  V
                  Victor Kirhenshtein
                  wrote on last edited by
                  #8

                  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

                  1 Reply Last reply
                  0
                  • D
                    D
                    deepb
                    wrote on last edited by
                    #9

                    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 code
                    

                    Agent 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
                    
                    1 Reply Last reply
                    0
                    • F
                      F
                      Filipp Sudanov
                      wrote on last edited by
                      #10

                      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

                      1 Reply Last reply
                      0
                      • D
                        D
                        deepb
                        wrote on last edited by
                        #11

                        It didn't make any difference. Same error.

                        1 Reply Last reply
                        0

                        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
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        Powered by NodeBB Contributors
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups