Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- proxy_targets="http://10.1.1.4:3128 http://10.1.1.5:3128 http://10.1.1.6:3128"
- failed_hosts=""
- for i in $proxy_targets
- do
- if http --check-status --ignore-stdin --timeout=2.5 --proxy=http:$i HEAD www.msftncsi.com/ncsi.txt &> /dev/null; then
- echo 'OK!'
- else
- case $? in
- 2) echo 'Request timed out!'| mail -s "The following WSA has failed to pass traffic with the following error" moe.abdel@childrens.ha
- rvard.edu ;;
- 3) echo 'Unexpected HTTP 3xx Redirection!'| mail -s "The following WSA has failed to pass traffic with the following error" katkota@newwork.com ;;
- 4) echo 'HTTP 4xx Client Error!'| mail -s "The following WSA has failed to pass traffic with the following error" katkota@newwork.com ;;
- 5) echo 'HTTP 5xx Server Error!'| mail -s "The following WSA has failed to pass traffic with the following error" katkota@newwork.com ;;
- 6) echo 'Exceeded --max-redirects=<n> redirects!'| mail -s "The following WSA has failed to pass traffic with the following error" katkota@newwork.com ;;
- *) echo 'Other Error!'| mail -s "The following WSA has failed to pass traffic with the following error" katkota@newwork.com ;;
- esac
- fi
- done;
Add Comment
Please, Sign In to add comment