I need to write a java monitor, to run as a linux service, to monitor the status of http-listeners in Glassfish 4 (really old version). My idea is to be able to find this information via JMX. By connecting my jar via JMX. But, even connecting vi JConsole, I can't figure out which MBeans I should monitor. I need to understand if there are any listeners that remain "stuck" or rather not freed, remaining in a stuck and unreturned state, like in a kind of "limbo."
Can you help me identify which MBeans resource in Glassfish 4 is dipsonable to perform this kind of monitoring? Obviously all http-listeners present must be scanned.
Thanks to all of you.
You should enable the "Monitoring service" in GlassFish and set level of the "HTTP Service" module to HIGH.
Then you can access monitoring data for network listeners via:
The monitoring bean provides several metrics. To detect that a thread pool is stuck (meaning all threads are stuck and no tasks are getting finished), you can watch the
currentthreadsbusyandtotalexecutedtasksproperties. If, for a longer time,currentthreadsbusyis higher than 1 andtotalexecutedtasksdoesn't increase, it means that some threads are stuck, working on tasks, but no task gets completed.Disclaimer: My company, OmniFish, provides commercial support for GlassFish by core GlassFish project developers. Let us know at https://omnifish.ee/contact-us/ if you need some more assistance.