It's all about the answers!

Ask a question

simple automated test to check RTC server/web accessible?


Virginia Brown (9333841) | asked Aug 27 '12, 9:43 a.m.
edited Aug 27 '12, 10:08 a.m.
RTC production server went down yesterday evening, but it wasn't discovered until this morning.  
I would like to implement a simple automated health check to run hourly and send an alert on failure.

Is anyone doing this?   Right now our system is super simple - users go directly to the web server.


Accepted answer


permanent link
sam detweiler (12.5k6189201) | answered Aug 27 '12, 11:19 a.m.
here is a little script

set COOKIES=.\cookies.txt

set USER=user_name
set PASSWORD=user_password
set HOST=https://localhost:9743/ccm - server url


curl -k -c %cookies% "%host%/authenticated/identity"

curl -k -L -b %COOKIES% -c %COOKIES% -d j_username=%USER% -d j_password=%PASSWORD% "%host%/authenticated/j_security_check"

rem pick some other api to call. this resets the perf counters.. get a workitem..
curl -k -L -b %COOKIES% "%host%/service/com.ibm.team.repository.service.internal.counters.ICountersRestService/allCounters"

Virginia Brown selected this answer as the correct answer

3 other answers



permanent link
David Chadwick (1511) | answered Aug 27 '12, 11:16 a.m.
JAZZ DEVELOPER
You could also use curl to retrieve the ccm/scr and jts/scr pages to ensure both apps are responding.  The other thing to note is hitting the login window is probably more expensive than just asking for a valid page that doesn't require authentication.  This test does not check to see if the database is up or if connection to LDAP is working but then again neither does testing to see if you get a login window.  Just an alternative suggestion.

Comments
Virginia Brown commented Aug 28 '12, 1:06 p.m.

good point. we just need enough of a test to go say - oh oh better go look


Nick Edgar commented Aug 31 '12, 3:30 p.m.
JAZZ DEVELOPER

Another one is ../jts/rootservices and .../ccm/rootservices. They don't require authentication either, and are about the same size as the scr requests.


permanent link
Anthony Kesterton (7.5k7178136) | answered Aug 27 '12, 10:31 a.m.
JAZZ DEVELOPER
I have a customer that uses the web login page as their test - they check for a response to their main login page.

They also use monitoring tools to check the app server and database servers are running.

regards

anthony

Comments
Virginia Brown commented Aug 27 '12, 10:36 a.m.

thanks anthony. the followup Q - how have they coded up the web check so that it can be run from a cron?


Anthony Kesterton commented Aug 27 '12, 10:45 a.m.
JAZZ DEVELOPER

Not quite sure. It was probably scripted in some way. I suspect you could use something like curl and a simple shell script to do this but have to tried this myself.


permanent link
David Castellanos (20686) | answered Aug 27 '12, 11:13 a.m.
You could use a script like the one outline in this article: https://jazz.net/library/article/1017 and wrap it around a scheduler (cron or AT for windows)

Comments
Virginia Brown commented Aug 28 '12, 1:07 p.m.

thanks for the pointer to the article. this looks like a good one for admins to have in their toolkit.

Your answer


Register or to post your answer.