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. Java SubAgent and OPC UA

Java SubAgent and OPC UA

Scheduled Pinned Locked Moved Support
8 Posts 2 Posters 44.6k 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.
  • SashS
    SashS
    Sash
    wrote on last edited by
    #1

    Could someone explainme how to use Java Subagent to get Informations from OPC UA please?
    I have configured my nxagentd.conf on the NetXMS Server, and Oracle Java 1.8 is installed.:

    #
    # NetXMS agent configuration file
    # Created by agent installer at ********
    #

    MasterServers = *******
    ConfigIncludeDir = C:\NetXMS\etc\nxagentd.conf.d
    LogFile = C:\NetXMS\log\nxagentd.log
    FileStore = C:\NetXMS\var
    SubAgent = portcheck.nsm
    SubAgent = ssh.nsm
    SubAgent = winperf.nsm
    SubAgent = wmi.nsm
    SubAgent = java.nsm

    [JAVA]
    Plugin = opcua.jar

    Seems that the Java Subagent is not loaded...

    1 Reply Last reply
    0
    • A
      A
      Alex Kirhenshtein
      wrote on last edited by
      #2

      Check agent's log on debug level 1 or higher, there should be lines like

      2022.09.19 15:47:54.074 *D* [                  ] Initializing Java subagent
      2022.09.19 15:47:54.074 *D* [                  ] JAVA: Default JVM: /Users/alk/.asdf/installs/java/zulu-17.32.13/zulu-17.jdk/Contents/Home/lib//server/libjvm.dylib
      2022.09.19 15:47:54.074 *D* [                  ] JAVA: using JVM /Users/alk/.asdf/installs/java/zulu-17.32.13/zulu-17.jdk/Contents/Home/lib//server/libjvm.dylib
      2022.09.19 15:47:54.095 *D* [                  ] Java SubAgent created
      

      If JVM is not found, you can set it with parameter "JVM=..." in "JAVA" section.

      1 Reply Last reply
      0
      • A
        A
        Alex Kirhenshtein
        wrote on last edited by
        #3

        Also I found an issue with plugin packaging, so bundled jar might not work.
        Replace $NETXMS_HOME/lib/netxms/java/opcua.jar with this version: https://cloud.radensolutions.com/s/WazFQAC3KrnJpTM.

        1 Reply Last reply
        0
        • SashS
          SashS
          Sash
          wrote on last edited by
          #4

          Thanks a lot Alex!
          The Agent is loaded now.
          Could you please explain me, where I have to define the OPC UA Servers, and how I could connect to them and get data?

          Here is my Log:
          2022.09.20 09:27:31.565 *D* [                  ] Initializing Java subagent
          2022.09.20 09:27:31.565 *D* [                  ] JAVA: Default JVM: C:\Program Files\Eclipse Adoptium\jdk-17.0.4.101-hotspot\\bin\server\jvm.dll
          2022.09.20 09:27:31.565 *D* [                  ] JAVA: using JVM C:\Program Files\Eclipse Adoptium\jdk-17.0.4.101-hotspot\\bin\server\jvm.dll
          2022.09.20 09:27:32.035 *D* [java.runtime      ] JavaBridge: Java VM created
          2022.09.20 09:27:32.136 *D* [                  ] Java SubAgent created
          2022.09.20 09:27:32.136 *D* [                  ] SubAgent.loadPlugin(opcua.jar)
          2022.09.20 09:27:32.151 *D* [                  ] Loading plugin file "C:\NetXMS\lib\java\opcua.jar"
          2022.09.20 09:27:32.220 *D* [                  ] Java plugin OPCUA (com.radensolutions.netxms.agent.opcua.OpcUaPlugin) loaded
          2022.09.20 09:27:32.220 *D* [                  ] JAVA: subagent initialization started
          2022.09.20 09:27:32.220 *D* [                  ] JAVA: exception in plugin OPCUA initialization handler: org.netxms.agent.PluginInitException: OPCUA servers not defined
          2022.09.20 09:27:32.220 *D* [                  ] JAVA: subagent initialization completed
          2022.09.20 09:27:32.220 *I* [subagents          ] Subagent "JAVA" (java.nsm) loaded successfully (version 4.1.420)

          1 Reply Last reply
          0
          • A
            A
            Alex Kirhenshtein
            wrote on last edited by
            #5

            You need to define section "OPCUA" and add one or more "Server" parameters. Format for server record is "name:[login[/password]@]url" (parts in square brackets are optional)
            You can also change timeout from defaul 5 seconds (parameter "Timeout", in ms).

            Example:

            [OPCUA]
            Timeout=5000 # timeout for network operations
            Server=s1:opc.tcp://milo.digitalpetri.com:62541/milo # anonymous connection
            Server=s2:[email protected]://milo.digitalpetri.com:62541/milo # login "user1", empty password
            Server=s3:user1/[email protected]://milo.digitalpetri.com:62541/milo # login "user1", password "password"
            

            Once configured, you can collect metric OPCUA.NodeValue(server name, node id), where "server name" is s1, s2, etc. (values from configuration).

            Example:

            ❯ nxget 127.0.0.1 'OPCUA.NodeValue(s1,ns=0;i=2257)'
            Variant{value=DateTime{utcTime=133058236247170000, javaDate=Wed Aug 24 17:07:04 EEST 2022}}
            
            1 Reply Last reply
            0
            • A
              A
              Alex Kirhenshtein
              wrote on last edited by
              #6

              I just realised that we do not support Variant in the responce - we'll add support in future releases

              1 Reply Last reply
              0
              • A
                A
                Alex Kirhenshtein
                wrote on last edited by
                #7

                Fixed in ee84926388, will be included in upcoming 4.2 release

                1 Reply Last reply
                0
                • SashS
                  SashS
                  Sash
                  wrote on last edited by
                  #8

                  Thanks Alex.

                  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