I am trying to incorporate a new check_jmx command I have pulled down from here: https://snippets.syabru.ch/nagios-jmx-plugin/download/nagios-jmx-plugin.zip it contains
- check_jmx
- The Check command
- check_jmx.jar
- Library
- 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.