Author Topic: USER monitoring using nsntlm-lwp.pl  (Read 1186 times)

Offline savolan

  • Contributor
  • *
  • Posts: 3
  • Karma: 1
USER monitoring using nsntlm-lwp.pl
« on: November 04, 2011, 03:02:06 AM »
We're running ns 9.3 and trying to set up USER monitoring for Sharepoint.
How ever we haven't got the monitor to work yet.

Has anyone actually got it working successfully?
The Citrix article http://support.citrix.com/article/CTX126201 doesn't help since the nsntlm-lwp.pl has changed since the document was created.

We're using
add service Intra x.x.x.x HTTP 80 -gslb NONE -maxClient 0 -maxReq 0 -cip DISABLED -usip NO -useproxyport YES -sp ON -cltTimeout 180 -svrTimeout 360 -CKA NO -TCPB YES -CMP NO -appflowLog DISABLED

set lb monitor NTLM USER -scriptName nsntlm-lwp.pl -scriptArgs "url=http://intra.company.com;user=user.name;password=password;domain=DOMAIN;version=2" -dispatcherIP 127.0.0.1 -dispatcherPort 3013 -LRTM ENABLED  -destIP x.x.x.x -destPort 80

bind lb monitor NTLM Intra

Logs say:
Fri Nov  4 11:10:52 2011: ./nsntlm-lwp.pl Script failed. Exit code : 1
Fri Nov  4 11:10:52 2011: ./nsntlm-lwp.pl Exit Reason : (Authentication failed!-> 401 401 Unauthorized

Username, password and domain are correct.
I get:

POST /nsntlm-lwp.pl HTTP/1.1
Nsmonitor-responsetimeout: 2
Content-Length: 157
Host: 127.0.0.1
Connection: Close

nsumon_ip=X.X.X.X&nsumon_port=80&nsumon_args=url=http://intra.company.com;user=user.name;password=password;domain=DOMAIN;version=2

HTTP/1.1 503 Service Unavailable
Failure-reason:  This is a KAS result
Server: Netscaler Internal Monitor Dispatcher
Content-Length: 48
Connection: Close

Authentication failed!-> 401 401 Unauthorized

Also the header to backend server doesn't contain NTLM (this is kind of obvious):

GET / HTTP/1.1
Keep-Alive: 300
Connection: Keep-Alive
Host: intra.company.com
User-Agent: libwww-perl/5.805

HTTP/1.1 401 Unauthorized
Content-Length: 1656
Content-Type: text/html
Server: Microsoft-IIS/6.0
WWW-Authenticate: NTLM
MicrosoftSharePointTeamServices: 12.0.0.4518
X-Powered-By: ASP.NET
Date: Fri, 04 Nov 2011 09:23:07 GMT

Any ideas?
« Last Edit: December 27, 2011, 01:03:57 AM by savolan »

Offline vikashj

  • Contributor
  • *
  • Posts: 2
  • Karma: 1
Re: USER monitoring using nsntlm-lwp.pl
« Reply #1 on: November 17, 2011, 10:31:58 PM »
You monitor config looks fine to me. Can you try increasing  interval and response time. I have it successfully running on latest 9.3.

You can try running the script from NS shell using below command
Goto:
/nsconfig/monitors

nsumon-debug.pl nsntlm-lwp.pl <IP>  80 10 "url=http://abc.com;user=xxxx;password=xxxx;version=2"

If it return 0, that means its success. For failure case it will return 1.

If it fails, try removing version information.

Offline savolan

  • Contributor
  • *
  • Posts: 3
  • Karma: 1
Re: USER monitoring using nsntlm-lwp.pl
« Reply #2 on: December 27, 2011, 12:18:58 AM »
To let you know I found solution to my problem in case you are struggling with nsntlm-lwp.pl:

set lb monitor NTLM USER -scriptName nsntlm-lwp.pl -scriptArgs "url=http://intra.company.com;user=DOMAIN\user.name;password=password;domain=DOMAIN" -dispatcherIP 127.0.0.1 -dispatcherPort 3013 -LRTM ENABLED  -destIP x.x.x.x -destPort 80

For some reason I have to have domain information in the username, but also as separate user=DOMAIN\user.name;...;domain=DOMAIN.

Offline Anton van Pelt

  • VIP Member
  • ***
  • Posts: 33
  • Karma: 100
  • twitter.com/antonvanpelt
Re: USER monitoring using nsntlm-lwp.pl
« Reply #3 on: December 27, 2011, 12:47:07 PM »
Thanks for sharing guys, good info!

Cheers!  8)