Skip to main content

Do you work with load balancers with an Identity Management SSO solution? Yes?

Then… IT’S ALL YOUR FAULT!

Well, not really. But whenever a user can’t get to their app, they’ll immediately blame you for it =)

A problem that I deal with time and time again is the problem of a load balancer failing, or maybe one of my OHS servers being down behind it.

Here’s a quick little script I threw together to test for issues. All it does is make a curl request to the same URL 100 times and output the errors. Let’s you get a quick view of intermittent problems.

Also, if you’re working behind a proxy, you can set your /etc/hosts file to the external hostname with the internal IP to send requests directly to the OHS reverse proxy and skip your load balancer.

#!/bin/bash
COUNTER=0
File=test.txt

while [ $COUNTER -lt 100 ]; do
curl http://www.yoursite.com/folder/protected.png -s -o test.txt –connect-timeout 10 2>test.txt

if grep -q “302 Found” “$File”; then
echo -ne .
else
echo ERROR
fi

let COUNTER=COUNTER+1
done

echo
echo COMPLETE

’tis all