Page 1 of 2

Tomcat Monitoring

Posted: Sat Mar 27, 2021 2:17 pm
by ar0431
I am trying to use "Global Request Processors" for tomcat. But can some one give some example how to use this option? I am not expert of Mbeans or jconsole. I have jconsole. But do not know what I have to put in "Global Request Processors".
I tried but it gives me error of Invalid check type. I have no idea what is check type.
If you give some example then it will be helpful.

Re: Tomcat Monitoring

Posted: Mon Mar 29, 2021 7:20 am
by ar0431
Anyone can help on this???

Re: Tomcat Monitoring

Posted: Mon Mar 29, 2021 1:36 pm
by dchurch
MBeans are special classes that live inside your application that give a specific set of application performance data. Unless the application (i.e. not Tomcat) contains Mbean classes, you can safely leave this field blank.

Adding Mbeans to Tomcat: https://tomcat.apache.org/tomcat-7.0-do ... howto.html
Introduction to Mbeans (how to write them): https://docs.oracle.com/javase/tutorial ... index.html

Re: Tomcat Monitoring

Posted: Mon Mar 29, 2021 3:06 pm
by ar0431
I want to use these option to monitor request response time or other monitoring. How we can use this option. Can you give some example to use it?

Re: Tomcat Monitoring

Posted: Mon Mar 29, 2021 5:00 pm
by dchurch
Catalina's list of mbeans: https://tomcat.apache.org/tomcat-8.0-do ... names.html

Here's another overview of how to use the JMX monitoring plugin in Nagios: https://assets.nagios.com/downloads/nag ... ios-XI.pdf

Unfortunately the Tomcat wizard doesn't seem to respect this setting when adding to the configuration database, or I'd be able to give you an example of using it.

Re: Tomcat Monitoring

Posted: Tue Mar 30, 2021 11:56 am
by swolf
ar0431 wrote:I am trying to use "Global Request Processors" for tomcat. But can some one give some example how to use this option? I am not expert of Mbeans or jconsole. I have jconsole. But do not know what I have to put in "Global Request Processors".
I tried but it gives me error of Invalid check type. I have no idea what is check type.
If you give some example then it will be helpful.
Since you have JConsole, the easiest way to achieve this is to do the following:

1) Connect to your Tomcat server using JConsole.
2) Click on the "MBeans" tab
3) For Tomcat specifically, there should be a section called "Catalina" and a subsection "GlobalRequestProcessors"
4) Under this subsection, there should be at least a couple of names, which will be similar to "http-bio-8080", "ajp-nio-8009", etc.

You should choose one of these names for the "MBean name" entry in the config wizard. Let me know if that doesn't work for you or if you need further assistance.

Re: Tomcat Monitoring

Posted: Thu Apr 01, 2021 10:33 am
by ar0431
I went to jconsole. I go to GlobalRequestProcessor and then I select "http-nio-8080". I copy that name into the Nagios tomcat wizard but it still gave me the following error.

UNKNOWN: Invalid Check Type

The following is the command Nagios is using. ( in the following command, I removed the user name and password. so ignore that). But I think "args" are not correct.

check_xi_ncpa!-t -P -M plugins/check_jvm.jar -q "args=-s service:jmx:rmi:///jndi/rmi:// /jmxrmi,args=-u '',args=-p '',args=-t tomcat,args=-C '',args=-w '',args=-c ''"

Re: Tomcat Monitoring

Posted: Fri Apr 02, 2021 9:25 am
by gsmith
Hi

I was getting the same error message. I noticed in jconsole that "http-nio-8080" was in quotes
and I think that is what is causing the issue. What I found is that on the machine to be monitored
this command works:

java -jar check_jvm.jar -s service:jmx:rmi:///jndi/rmi://localhost:9000/jmxrmi -u tomcat -p tomcat -t tomcat -C RequestsPerMinute:"http-nio-8080" -w 10 -c 20

And on the monitoring server this is the config that works:
Image3.jpg
where $ARGS1$ is:

-t Yk0LGDKF2i4Mi5tW -P 5693 -M plugins/check_jvm.jar -a '-s "service:jmx:rmi:///jndi/rmi://localhost:9000/jmxrmi" -u tomcat -p tomcat -t tomcat -C RequestsPerMinute:"http-nio-8080" -w 10 -c 20'

Let me know how it works out for you.

Thanks

Re: Tomcat Monitoring

Posted: Tue Apr 06, 2021 8:42 am
by ar0431
Thank for the help. The following command is working but I have to work on position of commas. It is also not taking the warning and critical threshold. See the following output. In your documentation, this command should be as an example. And please fix your Wizard for tomcat. I really appreciate it. It is really annoying if wizard not working properly.

/usr/local/nagios/libexec/check_ncpa.py -H -t -P -M plugins/check_jvm.jar -a '-s "service:jmx:rmi:///jndi/rmi:///jmxrmi" -u -p -t tomcat -C RequestsPerMinute:"https-jsse-nio-8443" -w 20 -c 40'
Requests Per Minute (https-jsse-nio-8443) returned CRITICAL with 14.41 requests | tomcat_requests_minute=14.410952079498436;20;40;;

Re: Tomcat Monitoring

Posted: Tue Apr 06, 2021 3:36 pm
by gsmith
Hi

I saw the same behavior with the critical and warning thresholds. I am going to run all these issues
through QA so they can validate what we are seeing (as a sanity check). I will keep you posted as
I find out more.

Thanks