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.
When the APP starts, the PID is updated as expected:
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 ?
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.
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 ?
"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."