|
[ Return To FAQ Index | Search The FAQs ]
|
|
| Title: | nagios tomcat monitor howto |
| FAQ ID: | F0310 |
| Submitted By: | Kiarna |
| Last Updated: | 03/14/2007 |
|
| Description: | How to monitor Tomcat server status?
In monitoring the tomcat app I wanted to make sure I was hitting a live jsp page. It took me a while to figure out the correct flags to use with the check_http plugin to make sure I was drilling down far enough and not just getting false positives from my webserver layer and redirect error handling. |
|
| Solution: | Use the httpd_check plugin to check a modified tomcat page (.jsp)
I used the check via SSL therefore the --ssl flag. However if you want non SSL, replace with the -H (host) flag.
My custom test.jsp when working contains the text 'UP' which is searched for by the string flag in the example.
Test it on the cmdline first:
./check_http --ssl server.com --url=/path/to/tomcat.generated/test.jsp --onredirect=critical --string=UP
The '--onredirect=critical' is in case tomcat is down and the webserver returns a neat outage response(302), it should still trigger the Nagios alarm.
Once working, add in checkcommands.cfg (I copied a check_http to check_tomcat though you can use the same executable):
# 'check_tomcat' command definition
define command{
command_name check_tomcat
command_line $USER1$/check_tomcat --ssl $HOSTADDRESS$ --url=/path/to/test.jsp --onredirect=critical --string=UP
}
|
|
| Keywords: | tomcat check_http |
|