All Apps and Add-ons

Monitoring of Java Virtual Machines (jmx) - pidFile

saas_sirsidynix
Explorer

I have setup the .xml file used by jmx.py to read the PID to examine from a file.

I then have a script that runs once an hour to update the PID in /var/tmp/APP1.pid. This is to ensure that stats are collected even if the app is restarted.

However, it doesn't appear that jmx.py is checking /var/tmp/APP1.pid each time it runs.

After starting splunk, JMX correctly monitors PID 781.

  • cat /var/tmp/APP1.pid

781

When the APP starts, the PID is updated as expected:

  • cat /var/tmp/APP1.pid

14289

But JMX logs this error in splunkd.log:

ERROR ExecProcessor - message from "python /opt/splunkforwarder/etc/apps/discovery-jmx/bin/jmx.py" host=, jmxServiceURL=, jmxport=0, jvmDescription=APP1-Jboss, processID=781,stanza=jmx://discovery,systemErrorMessage="No such process"

At this point I have to restart Splunk to get it to start monitoring correctly.

Have i set this up incorrectly ?

Thanks

Damien_Dallimor
Ultra Champion

Update : I have just added new code to the JMX App to allow for what you want.The latest version is 2.1 , you can now download it here.

Damien_Dallimor
Ultra Champion

It won't monitor any continual updates to a PID file , nor is this documented functionality. It will only monitor the current PID from the PID File when the Modular Input first executes.

0 Karma

saas_sirsidynix
Explorer

OK, I've misunderstood the paragraph below. I read this to mean that jmx.py would read the pid file each time it ran. Maybe worth qualifying this in the doc ?

Thanks

"For more dynamic flexibility,rather than specifying a static Process ID value in the config xml , you can also specfy the name of a PID file that contains the JVM's Process ID. .... Each time the mod input poller runs, it will dynamically inspect the value of the PID from this file. This way, you dont have to alter the config.xml each time you do a JVM restart."

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!

Observability Simplified: Combining User Experience, Application Performance & ...

Tech Talk Observability Simplified: Combining User Experience, Application Performance & Network ...

Event Series May & June: From Network Visibility to Service Intelligence

Unifying the Network: Moving from Alert Noise to Service Intelligence with Splunk ITSI In today’s hybrid ...

Global Splunk User Group Events: May + June 2026

Your Splunk Community Awaits: Discover Upcoming User Group Events Worldwide    Staying ahead in the fast-paced ...