All Apps and Add-ons

Monitoring of Java Virtual Machines with JMX: How to resolve error "Unable to initialize modular input "jmx" defined inside the app"?

deepak02
Path Finder

Hi,

I am trying to install Monitoring of Java Virtual Machines with JMX (SPLUNK4JMX or Splunk for JMX) on a non clustered, single Linux machine.

Steps completed:
Modified inputs.conf

[jmx]
config_file = config.xml
polling_frequency = 60
sourcetype = jmx
index = jmx
disabled = 0

Modified config.xml
Line 63 changed to: <jmxserver host="localhost" jvmDescription="cassandra" jmxport="12345">
Line 67 changed to: <mbean domain="*" properties="*" dumpAllAttributes="true" />

The rest of the file config.xml remained the same at /opt/splunkforwarder/etc/apps/SPLUNK4JMX/bin/config/config.xml. No username, password was added.

OBSERVATIONS:

Error I get in splunkd.log

ERROR ModularInputs - Unable to initialize modular input "jmx"  defined inside the app "SPLUNK4JMX": Introspecting scheme=jmx: script running failed (exited with code 1)
  • No jmx.log file created under /opt/splunkforwarder/var/log/splunk/

  • echo $JAVA_HOME
    /usr/lib/jvm/jre-1.7.0-openjdk.x86_64

Please help me resolve this issue.

Thanks,
Deepak

mmeehanacademy
Explorer

Have you installed this on a Splunk UF? Based on the path you provided: "/opt/splunkforwarder/etc/apps/SPLUNK4JMX/bin/config/config.xml"

It looks like this is one some type of Splunk forwarder. The SPLUNK4JMX app requires python to run and I do not believe the forwarders come with python. You must use a heavy forwarder since that comes with Python.

Thanks

0 Karma

deepak02
Path Finder

Thankyou. It is installed on the universal forwarder, but I have installed python as well.

Is there any other constraint to install Splunk only on Heavy forwarders, or will SPLUNK4JMX work on Universal Forwarder + python?

0 Karma

mmeehanacademy
Explorer

Try setting the variables PYTHONPATH and PYTHONHOME. The UF by default will look for the Python install that generally comes bundled with splunk, but since that is not there it will fail. If you set these two variables then it should be able to invoke the script.

Thanks

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...