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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...