Search code examples
javajmx

List of JMX objects and attributes?


I am trying to implement a nagios plugin, and doing so requires that I know specifically what object and attribute I want to monitor. The thing is, I haven't been able to find a listing anywhere of the standard system jmx objects and attributes. Can anyone point me in the right direction? I need to monitor things like memory pools, heap size, etc.


Solution

  • You can always use mBeanServer.queryNames(null, null); for getting to all MBeans registered at a certain MBeanServer (where mBeanServer is the MBeanServerConnection which you obtained either locally or remotely).

    However, before implementing your own Nagios Plugins, why not using an already exisiting one ? E.g. jmx4perl's check_jmx4perl which comes with tools for exploring the JMX namespace (like jmx4perl <url> list for listing all JMX MBeans with their attributes and operations or j4psh a readline based JMX shell with context sensitive command line completion).