Monitoring JMXperl4 in NagiosXI

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
FrancisNagios
Posts: 58
Joined: Tue Apr 09, 2019 6:54 am

Monitoring JMXperl4 in NagiosXI

Post by FrancisNagios »

Hi,

Has anyone had any success in monitoring the plugin check_jmx4perl?
We have this error: (No output on stdout) stderr: execvp(/usr/local/bin/check_jmx4perl, ...) failed. errno is 2: No such file or directory

It used to work on nagiosXI 5.4.13 Centos6.9 but we migrated it to NagiosXI 5.4.13 RedHat 7.6 and stopped working

I show the definition of the Migrated commands de NagiosXiCentos:
JMXPERL4.PNG
On our NagiosXiRh server:

Code: Select all

[administrador@nagiosxi-rh bin]$ pwd
/usr/local/bin
[administrador@nagiosxi-rh bin]$ ls
dbilogstrip  dbiprof  dbiproxy    winexe  wmic

Code: Select all

[administrador@nagiosxi-rh jmx4perl]$ pwd
/usr/local/nagios/etc/jmx4perl
[administrador@nagiosxi-rh jmx4perl]$ ls
common.cfg  glassfish.cfg  jboss7.cfg  jboss.cfg  jbossEAP.cfg  jetty.cfg  memory.cfg  metrics.cfg  threads.cfg  tomcat7.cfg  tomcat.cfg  weblogic.cfg
Thanks for the support
Thanks and regards
You do not have the required permissions to view the files attached to this post.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Monitoring JMXperl4 in NagiosXI

Post by cdienger »

check_jmx4perl doesn't appear to be in /usr/local/bin/. Try looking for it in /usr/local/nagios/libexec/ and copy it over or modify the command definition so that it points to the proper location.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
FrancisNagios
Posts: 58
Joined: Tue Apr 09, 2019 6:54 am

Re: Monitoring JMXperl4 in NagiosXI

Post by FrancisNagios »

Hi,

Still changing the PATH from /usr/local/bin to /usr/local/nagios/libexec still giving the same error because you can not find the check_jmx4perl on any of the two routes

It seems that it is not installed when making the migration from Centos to RedHar and we need a support to finish configuring
If we have the JAVA installed:
JAVA.txt

Thanks and regards
You do not have the required permissions to view the files attached to this post.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Monitoring JMXperl4 in NagiosXI

Post by cdienger »

The code can be downloaded from https://metacpan.org/release/jmx4perl. The download contains a README with installation instructions:
INSTALLATION

The Perl part installs as any other module via Module::Build, which
you need to have installed. Using

perl Build.PL
./Build installdeps # If there are dependencies missing and you
# have Module::Build >= 0.36 installed.
./Build
./Build test
./Build install

will install the modules. It is highly recommended to install the
recommended dependent modules, too to get the full jmx4perl
power. The set of 'required' modules is kept small and guarantees
only that 'jmx4perl' and the modules around JMX::Jmx4Perl are
working properly. The other tools (check_jmx4perl, j4psh and
jolokia) require the recommended modules for proper working. Look
into Build.PL for which tool requires which module.

In order to download the Jolokia WAR agent into the local directory
as jolokia.war, use the following command

jolokia

This agent "jolokia.war" needs to be deployed on the JEE Server to
monitor. Please consult http://www.jolokia.org/agent.html for more
information how to install the agent. E.g. for Tomcat this war file
needs to be copied into the webapps directory.

To test it, you can use 'jmx4perl' with the URL of the deployed
agent:

jmx4perl http://<jeeserver>:<port>/jolokia

Consult 'man jmx4perl' for more information about this command
utility.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
FrancisNagios
Posts: 58
Joined: Tue Apr 09, 2019 6:54 am

Re: Monitoring JMXperl4 in NagiosXI

Post by FrancisNagios »

Hi cdienger,

Sorry for my ignorance in this plugin
If I made the commands of your previous comment would it be installed?
If possible you can tell me the commands step by step.

Thanks and regards
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Monitoring JMXperl4 in NagiosXI

Post by cdienger »

The page also has these commands to make the install easier:

Code: Select all

perl -MCPAN -e shell
install JMX::Jmx4Perl::Agent::Jolokia::Verifier::PGPKey
Select 'y' as it prompts you and it should install the plugin.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
FrancisNagios
Posts: 58
Joined: Tue Apr 09, 2019 6:54 am

Re: Monitoring JMXperl4 in NagiosXI

Post by FrancisNagios »

Hi cdienger,

We have checked that the plugin check_jmx if it works.
Can such monitoring be adpatated?
We have monitored the following in the other nagios:

Code: Select all

./check_jmx -U service:jmx:rmi:///jndi/rmi://expinterjb64hc1.perimetral.dom:8100/jmxrmi -O java.lang:type=Memory -A HeapMemoryUsage -K used -I HeapMemoryUsage -J used -vvvv -w 4248302272 -c 5498760192
JMX_1.PNG
I attach the memory.cfg file that uses the check_jmx4perl to see how to adapt it to the check_jmx and if necessary.
JMX2.txt

Thanks and regards
You do not have the required permissions to view the files attached to this post.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Monitoring JMXperl4 in NagiosXI

Post by cdienger »

This plugin is worth checking out. Here is the help section that tells you how to monitor with it:
Usage: check_jmx -U url -O object_name -A attribute [-K compound_key] [-I attribute_info] [-J attribute_info_key] -w warn_limit -c crit_limit [-v[vvv]] [-help]

, where options are:

-help
Prints this page

-U
JMX URL, for example: "service:jmx:rmi:///jndi/rmi://localhost:1616/jmxrmi"

-O
Object name to be checked, for example, "java.lang:type=Memory"

-A
Attribute of the object to be checked, for example, "NonHeapMemoryUsage"

-K
Attribute key for -A attribute compound data, for example, "used" (optional)

-I
Attribute of the object containing information for text output (optional)

-J
Attribute key for -I attribute compound data, for example, "used" (optional)

-v[vvv]
verbatim level controlled as a number of v (optional)

-w
warning integer value

-c
critical integer value

Note that if warning level > critical, system checks object attribute value to be LESS THAN OR EQUAL warning, critical
If warning level < critical, system checks object attribute value to be MORE THAN OR EQUAL warning, critical
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
FrancisNagios
Posts: 58
Joined: Tue Apr 09, 2019 6:54 am

Re: Monitoring JMXperl4 in NagiosXI

Post by FrancisNagios »

Hi,

There are errors when installing.
They are prerequisite errors
Could you help us?
I attached the installation attempt.
JMX.txt
Thanks and regards
You do not have the required permissions to view the files attached to this post.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Monitoring JMXperl4 in NagiosXI

Post by cdienger »

The command to install dependencies is:

Code: Select all

./Build installdeps
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked