Subagent:Java

Revision as of 22:21, 28 May 2015 by Tomas Kirnak (talk | contribs) (Created page with "The Java SubAgent needs to be compiled with the agent, using specific ./configure parameters.<br> Installed Java JDK is required.<br> <br> Example: <pre> ./configure --prefix=...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The Java SubAgent needs to be compiled with the agent, using specific ./configure parameters.
Installed Java JDK is required.

Example:

./configure --prefix=/usr --with-agent --with-jdk=/usr/lib/jvm/java-7-openjdk-amd64
make
make install

You can check if the java SubAgent was installed using:

ls -l /usr/lib/netxms/ | grep java

You will need to properly setup the agent config file:
vim /etc/nxagentd.conf

At the end of the agent config file you need to add:

[JAVA]
jvm = /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so
ClassPath = ..path/netxms-agent-2.0-M5.jar

jvm parameter needs to point to libjvm.so, the location may be different on your system.
You can add multiple ClassPath parameters, including multiple .jar's

ClassPath = ..path/netxms-agent-2.0-M5.jar:/path/to/jar/app.jar:/path/another.jar

You can then specify multiple Plugin parameters which expose your Java classes to the NetXMS agent using:

Plugin = com.company.class
Plugin = com.project.class2