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
Get Updates on the Splunk Community!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...