Note: in Talend Open Studio for ESB or Talend ESB
installations, the configuration files are in <TalendRuntimePath>/add-ons/adapters/nagios
.
Note that there is an overview of this process in Preparing the configuration files for running with Nagios
Create a local directory for the configuration files if it does not exist, for example:
/usr/local/nagios/etc/objects/
or/etc/nagios3/etc/objects/
, depending on where your installation expects them.Define jolokia_host (the host where the examples are running) in
/etc/hosts
- this name is used in subsequent files, rather than hard-coding in the ip address. For example, add the line (depending on the IP address):192.168.1.101 jolokia_host
Copy the template and sample configuration files into Nagios
etc/objects
subdirectory. Not all of these are needed for this example, but we will only reference the ones we need in the configuration files. For example:cp -f <TalendRuntimePath>/add-ons/adapters/nagios/template/*.cfg /usr/local/nagios/etc/objects/
cp -f <TalendRuntimePath>/add-ons/adapters/nagios/sample/*.cfg /usr/local/nagios/etc/objects/
This target directory may be elsewhere in your installation, for example:
/etc/nagios3/etc/objects/
.Add the template configuration file to the existing
nagios.cfg
, here are some examples, which depend on where your installation puts config files:In
/usr/local/nagios/etc/nagios.cfg
add:cfg_file=/usr/local/nagios/etc/objects/jmx_commands.cfg cfg_file=/usr/local/nagios/etc/objects/camel_host.cfg
Or in
/etc/nagios3/nagios.cfg
add:cfg_file=/etc/nagios3/etc/objects/jmx_commands.cfg cfg_file=/etc/nagios3/etc/objects/camel_host.cfg
Define macros which will be used by
jmx_commands.cfg
inresource.cfg
, here are some examples, which depend on where your installation puts config files:In
/usr/local/nagios/etc/resource.cfg
add these lines:# set the path which jmx4perl plugin installed $USER5$=/usr/local/src/jmx4perl/scripts # set the path to where to find configuration files $USER6$=/usr/local/nagios/etc/objects
Or in
/etc/nagios3/resource.cfg
add these lines:# set the path which jmx4perl plugin installed $USER5$=/usr/local/src/jmx4perl/scripts # set the path to where to find configuration files $USER6$=/etc/nagios3/etc/objects
Then, restart Nagios for the changes to take effect.
# service nagios restart
Note: the name of this service may vary, depending on which package you used to install Nagios, so it may be called, for example,
nagios3
, instead ofnagios
.