Page 2 of 3

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

Posted: Sun Sep 06, 2015 8:01 pm
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 ?

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

Posted: Sun Sep 06, 2015 8:37 pm
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

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

Posted: Tue Sep 08, 2015 1:28 am
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?

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

Posted: Tue Sep 08, 2015 1:35 am
by Box293
In your command definition, remove the - sign in front of "$ARG1$"

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

Posted: Tue Sep 08, 2015 7:52 pm
by wangyu
When I remove the - sign in front of "$ARG1$" .
The picture show the error.

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

Posted: Tue Sep 08, 2015 7:56 pm
by Box293
Your $ARG6$ does not end with a $ sign, it is $ARG6 but should be $ARG6$

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

Posted: Wed Sep 09, 2015 1:19 am
by wangyu
Thanks very much ,I'll try.

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

Posted: Wed Sep 09, 2015 1:39 am
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 ?

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

Posted: Wed Sep 09, 2015 3:57 pm
by tmcdonald
Does that directory exist? If so, what are the permissions?

ls -l /usr/local/pnp4nagios/var/perfdata

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

Posted: Mon Sep 14, 2015 1:33 am
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 ?