How can I use the check_tomcat script to monitor ?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
wangyu
Posts: 41
Joined: Tue Aug 25, 2015 2:41 am

Re: How can I use the check_tomcat script to monitor ?

Post by wangyu »

Accroding to the PDF: Monitoring JMX with Nagios XI
I use this command,Please see picture 27,it's OK now.

I install rrdtool+pnp4nagios on nagios server.
Then the picture 28 , 29 show the photo of the cpu , memory status.

I configure the content of the services.cfg on nagios server is:

#######################################################################
define service{
use local-service,srv-pnp
host_name cmmsgplm.ECMMS.FOXCONN
service_description check-CPULOAD
check_period 24x7
max_check_attempts 4
normal_check_interval 3
retry_check_interval 2
contact_groups GROUP
notification_interval 10
notification_period 24x7
notification_options w,u,c,r
check_command check_nt!CPULOAD!-l 5,80,90
}

define service{
use srv-pnp
host_name cmmsgplm.ECMMS.FOXCONN
service_description check-MEMINFO
check_period 24x7
max_check_attempts 4
normal_check_interval 3
retry_check_interval 2
contact_groups GROUP
notification_interval 10
notification_period 24x7
notification_options w,u,c,r
check_command check_nt!MEMUSE!-w 80 -c 90
}
##############################################################################

Now I want to show the JMX status photo on the nagios web interface ,include Heap Memory Usage , Threads, CPU Usage.
How could I configure the services.cfg to finish this goal ?
Attachments
29.png
28.png
27.png
27.png (4.96 KiB) Viewed 3256 times
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: How can I use the check_tomcat script to monitor ?

Post by Box293 »

You would need a command:

Code: Select all

define command {
       command_name                  	check_jmx
       command_line                  		$USER1$/check_jmx "$ARG1$" "$ARG2$" "$ARG3$" "$ARG4$" "$ARG5$" "$ARG6$" "$ARG7$" "$ARG8$"
}
And a service:

Code: Select all

define service{
use srv-pnp
host_name cmmsgplm.ECMMS.FOXCONN
service_description JMX Memory
check_period 24x7
max_check_attempts 4
normal_check_interval 3
retry_check_interval 2
contact_groups GROUP
notification_interval 10
notification_period 24x7
notification_options w,u,c,r
check_command check_jmx!-U service:jmx:rmi:///jndi/rmi://10.202.16.78:8080/jmxrmi!-O java.lang:type=Memory!-A HeapMemoryUsage!-K used! -I HeapMemoryUsage!-J used!-w 4248302272!-c5498760192
}
Not tested but this should get you on the right track.

edit note: removed the - sign from -"$ARG1$" in command
Last edited by Box293 on Tue Sep 08, 2015 1:36 am, edited 1 time in total.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
wangyu
Posts: 41
Joined: Tue Aug 25, 2015 2:41 am

Re: How can I use the check_tomcat script to monitor ?

Post by wangyu »

The picture 42 show the command.cfg
The picture 43 show the services.cfg
The picture 44 show the status of the JMX ,the status of JMX is unknown .
What 's the wrong with the problem ?
How can I solve this problem?
Attachments
44.png
44.png (7.46 KiB) Viewed 3245 times
43.png
42.png
42.png (3.99 KiB) Viewed 3245 times
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: How can I use the check_tomcat script to monitor ?

Post by Box293 »

In your command definition, remove the - sign in front of "$ARG1$"
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
wangyu
Posts: 41
Joined: Tue Aug 25, 2015 2:41 am

Re: How can I use the check_tomcat script to monitor ?

Post by wangyu »

When I remove the - sign in front of "$ARG1$" .
The picture show the error.
Attachments
48.png
48.png (8.81 KiB) Viewed 3239 times
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: How can I use the check_tomcat script to monitor ?

Post by Box293 »

Your $ARG6$ does not end with a $ sign, it is $ARG6 but should be $ARG6$
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
wangyu
Posts: 41
Joined: Tue Aug 25, 2015 2:41 am

Re: How can I use the check_tomcat script to monitor ?

Post by wangyu »

Thanks very much ,I'll try.
wangyu
Posts: 41
Joined: Tue Aug 25, 2015 2:41 am

Re: How can I use the check_tomcat script to monitor ?

Post by wangyu »

Thanks very much for box293,it's OK now.Please see the picture 54.
The JMX Memory show the HeapMemoryUsage of the Tomcat.
But the question when I click the button of .Please see the picture 55.
The picture 56 show the error information.
How can I solve this problem ?
Attachments
56.png
55.png
55.png (5.92 KiB) Viewed 3233 times
54.png
54.png (4.87 KiB) Viewed 3233 times
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: How can I use the check_tomcat script to monitor ?

Post by tmcdonald »

Does that directory exist? If so, what are the permissions?

ls -l /usr/local/pnp4nagios/var/perfdata
Former Nagios employee
wangyu
Posts: 41
Joined: Tue Aug 25, 2015 2:41 am

Re: How can I use the check_tomcat script to monitor ?

Post by wangyu »

The picture 13 show the result of execute "ls -l "
It show there is not the host "swhdtplmap01.efoxconn.com" name in /usr/local/pnp4nagios/var/perfdata
So what should I do can solve this problem ?
Attachments
13.png
Locked