Jump to content
Welcome to our new Citrix community!

Recommended Posts

Hi All,


I recently discovered a weakness (in my opinion) in using the nssmtp.pl script for a SMTP monitor.  It seems that all this script does is recognize if a connection can be made or not.  That is not great for SMTP as I had a issue the other day where one of my mailservers was malfunctioning and while it could establish a SMTP connection, it was a '451 4.7.0 Temporary Server Error'.  So while the VPX was connecting it was connecting to a server that was not working and could not accept mail but since the connection was made the VPX showed it as up.


I would like to modify the nssmtp.pl script to do more that simply check for a connection but read the banner and if it has specific text "ESMTP MAIL Service Ready" and if it sees that then mark the connection as ok, otherwise down.


I have come up with the following code which the banner part but when I add it to the script and upload the new script, and assign it to a monitor, the servers show as down.


***code begin***



if(index($banner, 'ESMTP MAIL Service ready')eq -1) {return(1,"Unable to connect to server -$!");}


***code end***


I have attached the original script to this post for review.  I had added my code right before the $smtp->quit lines for both SMTP and SMTP6 areas of the script.


Any help is greatly appreciated.


Thanks in advance,






Link to comment
Share on other sites

  • 4 months later...



Were you able to get this working? I am having a similar problem (SMTP service is up, but server is "not ready")... so we are having SMTP failures going through the load balancer


It would be nice to see if the perl script would check for "Mail Service Ready" list the original poster suggested.

Link to comment
Share on other sites

  • 4 years later...
  • 6 months later...
On 2/10/2020 at 12:06 PM, Ilia Osipov said:

Here's my solution for SMTP monitor using Net::SMTP (v4 only) module:

take a script attached, copy it to "/nsconfig/monitors/", don't forget to make it executable: chmod a+x smtp-ext.pl

For probe customisation, change "$searchstr" variable.

Thanks to original author for an idea.

smtp-ext.pl 1.28 kB · 11 downloads


I tried your Script but even if I stop the MS Exchange Transport Service (Exchange 2016) i can connect via Putty without any problems and getting the "Microsoft ESMTP MAIL service ready" message back?! I've created a new topic on this, checkout https://discussions.citrix.com/topic/410050-create-custom-smtp-monitor-to-check-exchange-servercomponentstate/ maybe you have got some new ideas...



Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...