Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I wan't to check with our Nagios if a webapplication is running on Tomca7. I decided to use the check_http plugin with regex. I'm parsing the status-page of tomcat and check if column "Running" is true. The Sourcecode of the status-page looks like this (snipped):

<td class="row-left" bgcolor="#FFFFFF" rowspan="2"><small>Applicationname</small></td>
<td class="row-center" bgcolor="#FFFFFF" rowspan="2"><small>true</small></td>

The 2 informations are in 2 different lines. So my line to check is the folowing:

./check_http -I 111.111.111.111 -p 8080 -a user:password -u /manager/html -rl 'Applicationname</small></td>\n.<td class="row-center" bgcolor="#FFFFFF" rowspan="2"><small>true'

The problem is, that the response of the plugin is always true ("HTTP OK") when I'm using the parameter "-l". Also when I modify the search-string like this to force a critical:

./check_http -I 111.111.111.111 -p 8080 -a user:password -u /manager/html -rl 'Applicationname</small></td>\n.<td class="row-center" bgcolor="#FFFFFF" rowspan="2"><small>fail_true'

I have no idea why this happaned. Someone any idea? Thanks, Arny

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Why not use the /manager/text/list to see the plain text manager interface instead of the HTML interface:

./check_http -I 111.111.111.111 -p 8080 -a user:password -u /manager/text/list -s 'Applicationname:running'

HTTP OK: HTTP/1.1 200 OK - 510 bytes in 0.003 second response time |time=0.003004s;;;0.000000 size=510B;;;0
share|improve this answer
    
Yes, that was also an idea, but it seems, that the text-page don't work. On /manager/list you get a 404 error: The Manager application has been re-structured[..] /manager/text for the text interface. On /manager/text I get also a error: FAIL - Unknown command /text. The catalina.out says nothing. –  FTV Admin Mar 4 '13 at 16:04
1  
Tomcat 7 has changed the plain-text manager interface to /manager/text/list. –  quanta Mar 4 '13 at 16:09
    
Yea, I think I can work with this Info. Very thanks! –  FTV Admin Mar 4 '13 at 16:11

from the man page check_http "-s, --string=STRING String to expect in the content" have you try with "-s" ?

$  ./check_http  -I localhost -p 80 -s True -u /test.html
HTTP CRITICAL: HTTP/1.1 200 OK - string 'True' not found on 'http://localhost:80/test.html' -    419 bytes in 0.001 second response time |time=0.000667s;;;0.000000 size=419B;;;0

$  ./check_http  -I localhost -p 80 -s true -u /test.html
HTTP OK: HTTP/1.1 200 OK - 419 bytes in 0.001 second response time |time=0.000776s;;;0.000000    size=419B;;;0

$  cat /var/www/html/test.html 
<td class="row-left" bgcolor="#FFFFFF" rowspan="2"><small>Applicationname</small></td>
<td class="row-center" bgcolor="#FFFFFF" rowspan="2"><small>true</small></td>
share|improve this answer
    
The problem is, that "true" several times match, because there are running some more Webapps on this tomcat. Sorry for the missing info. –  FTV Admin Mar 4 '13 at 15:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.