Page 1 of 1

Apache tomcat monitoring issue using ncpa

Posted: Thu Jun 03, 2021 9:38 am
by deek
We are trying to monitor apache tomcat using ncpa agent but we are facing issues.

As this is completely new monitoring set up and not aware of right use case of arguments, could you please suggest. we did follow the document.
https://assets.nagios.com/downloads/nag ... 1773666937

please let us know if ncpa.cfg has to edited with options and right way to have this monitored

./check_ncpa_.py -H XXXXX -t xxxx -P 5693 -M 'plugins/check_jvm.jar' -q "args=-s xxxxxx:1000/jmxrmi,args=-u 'xxx',args=-p 'xxx',args=-t tomcat,args=-C 'ClassCount',args=-w '10000',args=-c '50000'"
UNKNOWN: An error occured connecting to API. (HTTP error: '500 INTERNAL SERVER ERROR')

Please help with this?

Re: Apache tomcat monitoring issue using ncpa

Posted: Thu Jun 03, 2021 4:06 pm
by gsmith
Hi,

Firstly make sure you have JMX monitoring enabled on the Tomcat machine.

Then give this a try:
Image8.jpg
Let me know if that helps please.

Thanks

Re: Apache tomcat monitoring issue using ncpa

Posted: Fri Jun 04, 2021 5:21 am
by deek
Thanks for the reply yes jmx is installed and i am able to login to jconsole using username and password.

Could you please let me know if the ncpa.cfg has been updated right?
ncpa_cfg.png

still not sure if i am using right verbose.
output.PNG
Please help me update with right config and use case

Re: Apache tomcat monitoring issue using ncpa

Posted: Fri Jun 04, 2021 11:52 am
by gsmith
Hi

The ncpa.cfg line for .jar should be:

Code: Select all

.jar = java -jar $plugin_name $plugin_args
verify that the check_jvm.jar file is in /usr/local/ncpa/plugins (on the Tomcat machine)

make sure this works on the Tomcat machine:

Code: Select all

cd /usr/local/ncpa/plugins
java -jar check_jvm.jar -s service:jmx:rmi:///jndi/rmi://localhost:9000/jmxrmi -u tomcat -p tomcat -t tomcat -C ClassCount:"http-nio-8080"  -w 10000 -c 50000
***** note the -C ClassCount:"http-nio-8080" you have -C ClassCount *****


At this point we should have everything set up correctly on the Tomcat machine. If not we need to fix it first.

Then on the xi server:
Image9.jpg
where $ARGS1$ is:

-t mytoken -P 5693 -M plugins/check_jvm.jar -a '-s "service:jmx:rmi:///jndi/rmi://localhost:9000/jmxrmi" -u tomcat -p tomcat -t tomcat -C ClassCount:"http-nio-8080" -w 10000 -c 50000'

Please let me know the result.

Thanks