NetScaler SMTP Monitor Probe Fails with “Socket is already connected” error in nsumond.log

NetScaler SMTP Monitor Probe Fails with “Socket is already connected” error in nsumond.log

book

Article ID: CTX225357

calendar_today

Updated On:

Description


When SMTP Monitor is configured in Netscaler, "Socket is already connected" errors are logged in “/var/nslog/nsumond/nsumond.log”
 
User-added image

Fri Jun 23 10:18:21 2017: /netscaler/monitors/nssmtp.pl Script failed. Exit code : 1 (partition ID: 0)
Fri Jun 23 10:18:21 2017: /netscaler/monitors/nssmtp.pl Exit Reason : (Unable to connect to server - Socket is already connected) (partition ID: 0)

If the “nssmtp.pl” script is customized to include the Server’s IP address, the error includes Server’s IP address as well.
 
Fri Jun 23 10:18:21 2017: /netscaler/monitors/nssmtp.pl Script failed. Exit code : 1 (partition ID: 0)
Fri Jun 23 10:18:21 2017: /netscaler/monitors/nssmtp.pl Exit Reason : (Unable to connect to server 10.102.163.134 - Socket is already connected) (partition ID: 0)
 

Resolution

  1. Fix the Timeout issue at the back end server  
  2. Change the Response Timeout to a higher value in the SMTP Monitor configurations

Problem Cause

The "Socket is already connected" message is logged by nsumond when the application fails to respond in time, based on response timeout value configured for the corresponding Monitor.
 
"Socket is already connected" message is raised by the PERL module used for probing the server, when TCP connection is established, but the application times out.

This is a genuine response timeout, that happens from the application to respond back for the probe sent by Dispatcher to back end server.

newnslog :

As we can see below, the probes to the SMTP Server are failing and the Netscaler logs this monitor failures in the Newnslogs,

Checking the current newnslog with the below command shows the probes that failed

nsconmsg –g mon_tot -d current –s disptime=1 | grep “Service_Name”

User-added image
 
Note : Replace “Service_Name” with the actual service name

NS Trace Log :

In the NS Trace log, we can see the Dispatcher returns the HTTP 503 error

User-added image

Frame#12176 - Packet Engine (127.0.0.1) is sending the probe message using the POST /nssmtp.pl to the Dispatcher (127.0.0.2)
Frame#15643 - Dispatcher returns the HTTP 503 error to Packet Engine

Additional Information

http://docs.citrix.com/en-us/netscaler/12/load-balancing/load-balancing-custom-monitors/understand-user-monitors.html
http://docs.citrix.com/en-us/netscaler/11-1/load-balancing/load-balancing-custom-monitors/understand-user-monitors.html
http://docs.citrix.com/en-us/netscaler/11/traffic-management/load-balancing/load-balancing-custom-monitors/understand-user-monitors.html
http://docs.citrix.com/en-us/netscaler/10-5/ns-tmg-wrapper-10-con/ns-lb-wrapper-con-10/ns-lb-monitors-custommonitors-con/ns-lb-monitors-custom-user-con.html