How to monitor Jboss application

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
lafargeuser
Posts: 341
Joined: Thu Sep 27, 2012 12:23 am

Re: How to monitor Jboss application

Post by lafargeuser »

Generally what should we put as in argument in command & service
pls. give example

you can consider this command & share command & service argument

./check_mbean_collector -H jbosseserver -p port -m java.lang:type=Memory -a NonHeapMemoryUsage -w 10 -c 30
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: How to monitor Jboss application

Post by hsmith »

There are a number of ways that you can do this:

For Example...

./check_mbean_collector -H jbosseserver -p port -m java.lang:type=Memory -a NonHeapMemoryUsage -w 10 -c 30


Command:

Code: Select all

define command {
       command_name                             check_mbeam
       command_line                             $USER1$/check_mbeam_collector -H $HOSTADDRESS$ -p $ARG1$ -m '$ARG2$' $ARG3$ $ARG4$ $ARG5$
}
Service Check Command:

Code: Select all

 check_command                   check_mbeam!port! java.lang:type=Memory!NonHeapMemoryUsage!10!30

This is kind of messy, but I'll walk through my thought process here, since I don't have anything jboss spun up to test against right now. This should give you a better idea of how to write service checks and commands in the future as well.

The command you provided me with is this: ./check_mbean_collector -H jbosseserver -p port -m java.lang:type=Memory -a NonHeapMemoryUsage -w 10 -c 30

The command_line I provided you with is this: $USER1$/check_mbeam_collector -H $HOSTADDRESS$ $ARG1$ $ARG2$ $ARG3$ $ARG4$ $ARG5$

What I did here is split each part of the command you provided me into an argument. You could do this cleaner and with less arguments, but this is the best way that I can explain it to you.

In my example...



$USER1$ is the path to the plugin directory, which is /usr/local/nagios/libexec
check_mbeam_collector is the plugin that you installed.
-H $HOSTADDRESS$ is going to be -H jbosserver from your command.
$ARG1$ is going to be -p port from your command.
$ARG2$ is going to be -m java.lang:type=Memory from your command.
$ARG3$ is going to be -a NonHeapMemoryUsage from your command.
$ARG4$ is going to be -w 10 from your command.
$ARG5$ is going to be -c 30 from your command.

This is the best way that I can explain how it breaks down.
Former Nagios Employee.
me.
lafargeuser
Posts: 341
Joined: Thu Sep 27, 2012 12:23 am

Re: How to monitor Jboss application

Post by lafargeuser »

We are able to get output using command line with root access. But using nagios user we are getting an below error. and i guess nagiosxi use nagios user to execute command . please help here

CRITICAL - cannot connect to 192.168.5.55:1521. install_driver(Oracle) failed: Can't locate DBD/Oracle.pm in @INC (@INC
contains: /usr/local/nagios/libexec /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: How to monitor Jboss application

Post by hsmith »

lafargeuser wrote:We are able to get output using command line with root access. But using nagios user we are getting an below error. and i guess nagiosxi use nagios user to execute command . please help here

CRITICAL - cannot connect to 192.168.5.55:1521. install_driver(Oracle) failed: Can't locate DBD/Oracle.pm in @INC (@INC
contains: /usr/local/nagios/libexec /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl
What are your permissions on the plugin?

Code: Select all

ls -l /usr/local/nagios/libexec
Former Nagios Employee.
me.
Locked