Splunk Enterprise

Why can't I run the poll_jmx.sh

amadri0238c
New Member

[~]$ sudo /opt/splunk/etc/apps/SPLUNK4JMX/bin/poll_jmx.sh
SPLUNK4JMX_HOME=/etc/apps/SPLUNK4JMX
MAIN_CLASS=com.dtdsoftware.splunk.JMXMBeanPoller
LIB_DIR=/etc/apps/SPLUNK4JMX/bin/lib
POLLER_JARS=/etc/apps/SPLUNK4JMX/bin/lib/:/etc/apps/SPLUNK4JMX/bin/lib/ext/
JVM_MEMORY=-Xms64m -Xmx64m
JAVA_OPTS=-Xms64m -Xmx64m
CONFIG_XML=/etc/apps/SPLUNK4JMX/bin/config/
Exception in thread "main" java.lang.NoClassDefFoundError: com/dtdsoftware/splunk/JMXMBeanPoller
Caused by: java.lang.ClassNotFoundException: com.dtdsoftware.splunk.JMXMBeanPoller
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: com.dtdsoftware.splunk.JMXMBeanPoller. Program will exit.

Tags (1)
0 Karma

ziegfried
Influencer

That's probably because the SPLUNK_HOME environment variable isn't set. Try the following command instead:

sudo /opt/splunk/bin/splunk cmd /opt/splunk/etc/apps/SPLUNK4JMX/bin/poll_jmx.sh

Damien_Dallimor
Ultra Champion

Yes that is most definately the problem.
Also, read the docs and ensure you've followed the setup steps.

0 Karma
Get Updates on the Splunk Community!

Ready, Set, SOAR: How Utility Apps Can Up Level Your Playbooks!

 WATCH NOW Powering your capabilities has never been so easy with ready-made Splunk® SOAR Utility Apps. Parse ...

DevSecOps: Why You Should Care and How To Get Started

 WATCH NOW In this Tech Talk we will talk about what people mean by DevSecOps and deep dive into the different ...

Introducing Ingest Actions: Filter, Mask, Route, Repeat

WATCH NOW Ingest Actions (IA) is the best new way to easily filter, mask and route your data in Splunk® ...