Ed OConnor1709156122 Posted September 2, 2015 Share Posted September 2, 2015 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*** $banner=$smtp->banner(); 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, Ed nssmtp.txt Link to comment Share on other sites More sharing options...
CarlStalhood Posted September 2, 2015 Share Posted September 2, 2015 Did you try running the script using nsumon-debug.pl? http://support.citrix.com/article/CTX132944 2 Link to comment Share on other sites More sharing options...
Ed OConnor1709156122 Posted September 2, 2015 Author Share Posted September 2, 2015 Thank You, this greatly helped. Link to comment Share on other sites More sharing options...
Jeff Hein Posted January 20, 2016 Share Posted January 20, 2016 Hi, 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 More sharing options...
Ilia Osipov Posted February 10, 2020 Share Posted February 10, 2020 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 Link to comment Share on other sites More sharing options...
Julian Jakob Posted August 20, 2020 Share Posted August 20, 2020 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... Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now