We have a Tomcat agent within a Tomcat instance that hosts an application. We have seen when the application starts to have a large number of open file handles, the application operational performance begins to suffer.
The Tomcat process owned by the Tomcat administrator account (non-root) is the process that owns the file handles.
Is there a way to build a custom extension to the Tomcat agent that will run a system command (lsof - p <tomcat pid>|wc -l) and publish the number of file handles?
We do have an epagent, but the agent admin account (non-root) can not access the tomcat process open file count. The tomcat agent, since it is within the tomcat JVM, the extension would run within the tomcat process and hopefully should be able to run the lsof command.
If it is possible, is there any documentation, examples or guidance on how to build the custom extension?