dans monitoring

How to easily monitor JMX metrics with Nagios

Monitoring JMX metrics with Nagios can be a painful task. Why ? Because for each jmx metric (like the heap memory used, non heap memory used, thread count […]), you have to create a service attached to service group (it depends actually on your modeling). Usually, if you want to do it well, you’ll have to create at least 6 services to monitor your JVM.

Here is an example of metrics you can monitor :

jmx metrics

I have developed a year ago a wizard which allows you to do it in 3 minutes (really !), let’s see how it works.

Install jmx-wizard-nagios wizard

Last year, I developed jmx-wizard-nagios wizard. You just have to install it :

  • Download .zip archive
  • Upload it online on « Admin => Config wizard » page

It’s done. If you’ve got an issue, feel free to contact me or open an issue on GitHub repository.

Monitor JMX metrics

  • Go to « Configure => Configuration Wizards => JMX Metrics« 

configure wizard

jmx metrics

  • Fill JMX Configuration settings

jmx configuration

  • Select JMX metrics you want to monitor and Define (optional) critical level (it will generate an alert)

select jmx metrics

Note: usually, if HeapMemoryUsed is superior to 95% HeapMemoryMax, your Java app will crash => you have to restart it.

  • Define how you want to monitor these metrics

how the host and services must be monitored

  • Define contact group (best practice !), host and host group, as usual.
  • Finish

Nagios will create as many services as jmx metrics you defined.

Exploit JMX metrics

Monitoring for monitoring is useless. If you have metrics, watch them ! You must know your app, it’s behavior to define warning and critical alert as reliable as possible.

Here are some charts we can get :

heap memory used

thread count


I really hope this wizard will make your life easier. This wizard can be improved, let me know if you want to contribute.

Ecrire un Commentaire