Installing and Setting up a new Plugin

I am trying to incorporate a new check_jmx command I have pulled down from here: it contains

  1. check_jmx
    • The Check command
  2. check_jmx.jar
    • Library
  3. jmx.cfg
    • Command config file?

My /etc/icinga2/constants.conf informs me that the PluginDir = “/usr/lib/nagios/plugins” so I have installed 1. & 2. from above in this directory. I also ran the command and received data from the server I queried so it’s working fine from the command line.

I could not find any documentation that informs me where to put the jmx.cfg file that has these contents:

# 'check_jmx' command definition
define command {
  command_name    check_jmx
  command_line    /usr/lib/nagios/plugins/check_jmx -U 
  service:jmx:rmi:///jndi/rmi://'$HOSTADDRESS$':'$ARG1$'/jmxrmi $ARG2$

But a bit of searching with find came up with this location /etc/nagios-plugins/config where I can see ssh.cfg, snmp.cfg and lots of others. So I have placed the jmx.cfg file here.

I have now restarted my icinga2 server and logged in to the web UI, navigated to Director and followed this advice

Icinga Director Integration

Navigate into Commands > External Commands and search for mysql_health . Select mysql_health and navigate into the Fields tab.

I searched for check_jmx but unfortunately the command is not found when searching in.

  • Commands
  • External Commands
  • Command Templates.

Back to the docs, I read this section

But it did not help, it’s not very clear to a none seasoned icinga user/admin what is to be done next. I checked this file.

  • /etc/icinga2/conf.d/commands.conf
    as suggested, but I could not understand why all the other check_commands were not listed there. How is check_ssh and the other check_* magically found in Director?

I hope someone can provide some clarity on what is to be done next so I can set this command as a service within Director.

Icinga is really great but the documentation is somewhat complex, its not really step by step but instead ‘click this link’ to find out more. I ended up with 10 open tabs and a very confused mind.

I would be more than happy to contribute a simple ‘How to integrate a new plugin, step by step’ document once I have solved this and can repeat it.

Thank you in advance for any assistance.


you’re looking for this introduction:


Thank you Michael, rather a terse response methinks :frowning: along the lines of RTFM.

I could not find any step by step instructions in the document you suggest. This link points not to an introduction, but rather, to a technical manual which I have been trying to make sense of in the context of the plugin I am trying to install. With 11 links to further information in the first paragraph it becomes overwhelming and difficult to read.



when I am sharing documentation links, they are meant helpful and not in any way of harsh RTFM or something like that. Sorry if that came out this way.

I rewrote that chapter a while ago, and I think it helps to get started with plugin integrations. Since you mentioned that you would want to contribute such, I thought I’d mention it to avoid you doing double work then.

Coming back to the original question, the command definition you’re showing is from Icinga 1.x and not compatible with Icinga 2.

IIRC the Icinga Template Library already provides a CheckCommand definition for the JMX check plugin, called jmx4perl. This is available inside the Director with fetching it from Icinga 2’s REST API as external command. With putting the plugin into the PluginDir directory, this should then work OOTB.



Good morning Michael,

thank you for your prompt reply,

I have been successful in finally deploying the check_jmx command and I am getting information back into icinga now. The jmx4perl sounds interesting especially as it is icinga 2 so I will be looking into it as well.