Forum Discussion
Dbow_21284
Nimbostratus
Apr 02, 2010Mulitple CuRL Statements - How and do you think this will help?
Hello All,
I have used cURL statements in the external monitors successfully in the past, but I have a scenario with a SharePoint website that requires HTTP basic authentica...
Dbow_21284
Nimbostratus
Apr 06, 2010OK, I have figured out how to nest the if statement. It was easy, guess I just need to try. However, I still don't know if its the most efficient way.
I am still running into an issue though. It seems that for a specific SharePoint site, that requires HTTP authentication, I cannot browse to the URI that serves as my monitor script. Its almost as if the credentials aren't getting passed.
Here is my code:
curl -L -v http://${IP}:${PORT}/_layouts/ACCApplications/CommonLogin/login.aspx?ReturnUrl=%2fwhatsup.aspx -H "Host:members.acc.org" | grep -i "Welcome" 2>&1 > /dev/null
mark node UP if expected response was received
if [ $? -eq 0 ]
then
curl -L -v --user 'username:somepswd' http://${IP}:${PORT}/whatsup.aspx -H "Host:members.acc.org" | grep -i "1-UP" 2>&1 > /dev/null
if [ $? -eq 0 ]
then
echo "UP"
fi
fi
rm -f $PIDFILE
exit
Here are the results:
[admin@dmzlb1:Active] monitors sh -x /usr/bin/monitors/AUTH_Members2 10.10.185.39 80
++ echo 10.10.185.39
++ sed s/::ffff://
+ IP=10.10.185.39
+ PORT=80
++ basename /usr/bin/monitors/AUTH_Members2
+ PIDFILE=/var/run/AUTH_Members2.10.10.185.39_80.pid
+ '[' -f /var/run/AUTH_Members2.10.10.185.39_80.pid ']'
+ echo 9974
+ curl -L -v 'http://10.10.185.39:80/_layouts/ACCApplications/CommonLogin/login.aspx?ReturnUrl=%2fwhatsup.aspx' -H Host:members.acc.org
* About to connect() to 10.10.185.39 port 80
* Trying 10.10.185.39... + grep -i Welcome
connected
* Connected to 10.10.185.39 (10.10.185.39) port 80
> GET /_layouts/ACCApplications/CommonLogin/login.aspx?ReturnUrl=%2fwhatsup.aspx HTTP/1.1
> User-Agent: curl/7.15.3 (i686-redhat-linux-gnu) libcurl/7.15.3 OpenSSL/0.9.7l zlib/1.1.4
> Accept: */*
> Host:members.acc.org
>
< HTTP/1.1 200 OK
< Date: Tue, 06 Apr 2010 16:03:03 GMT
< Server: Microsoft-IIS/6.0
< MicrosoftSharePointTeamServices: 12.0.0.6510
< X-Powered-By: ASP.NET
< XBOX: W5
< X-AspNet-Version: 2.0.50727
< Cache-Control: private
< Content-Type: text/html; charset=utf-8
< Content-Length: 21385
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 21385 100 21385 0 0 1039k 0 --:--:-- --:--:-- --:--:-- 4581k* Connection 0 to host 10.10.185.39 left intact
* Closing connection 0
+ '[' 0 -eq 0 ']'
+ curl -L -v --user username:somepswd http://10.10.185.39:80/whatsup.aspx -H Host:members.acc.org
* About to connect() to 10.10.185.39 port 80
* Trying 10.10.185.39... + grep -i 1-UP
connected
* Connected to 10.10.185.39 (10.10.185.39) port 80
* Server auth using Basic with user 'testes'
> GET /whatsup.aspx HTTP/1.1
> Authorization: Basic ZGRlbmJvdzpiYWJ5cmVuMQ==
> User-Agent: curl/7.15.3 (i686-redhat-linux-gnu) libcurl/7.15.3 OpenSSL/0.9.7l zlib/1.1.4
> Accept: */*
> Host:members.acc.org
>
< HTTP/1.1 403 Forbidden
< Date: Tue, 06 Apr 2010 16:03:03 GMT
< Server: Microsoft-IIS/6.0
< MicrosoftSharePointTeamServices: 12.0.0.6510
< X-Powered-By: ASP.NET
< XBOX: W5
< X-AspNet-Version: 2.0.50727
< Cache-Control: private
< Content-Type: text/html; charset=utf-8
< Content-Length: 13
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 13 0 13 0 0 547 0 --:--:-- --:--:-- --:--:-- 0Connection 0 to host 10.10.185.39 left intact
* Closing connection 0
+ '[' 1 -eq 0 ']'
+ rm -f /var/run/AUTH_Members2.10.10.185.39_80.pid
+ exit
I will be parousing the web logs and everything looking for stuff but just wanted to post this for insight and if anyone else has experienced this.
Thanks
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
