Page 1 of 1

Check_SMTP

Posted: Tue Oct 13, 2015 4:59 am
by rlinux57
Getting SMTP "CRITICAL - Socket timeout after 10 seconds" , it was working from last 4 months but suddenly getting socket timeout error.

Re: Check_SMTP

Posted: Tue Oct 13, 2015 9:42 am
by hsmith
Can we get some more information?

Can you ping the SMTP server that you are trying to check?
Did something change?
Is there a firewall between these devices?

Re: Check_SMTP

Posted: Tue Oct 13, 2015 10:58 am
by rlinux57
Ping is successfully done from nagios server.
Nothing was changed, and i have already added nagios server ip to client firewall.

Re: Check_SMTP

Posted: Tue Oct 13, 2015 11:23 am
by hsmith
Are you running SMTP on the default port of 25?

Please try to telnet <IP> <SMTPPORT>.

If you do not have telnet you can install it by using yum -y install telnet or apt-get -y install telnet.

Re: Check_SMTP

Posted: Tue Oct 13, 2015 11:33 am
by rlinux57
Yes it's 25 by default.

telnet IP Address 25
Output:

Code: Select all

Trying IP Address...
Connected to IP Address.
Escape character is '^]'.
220-Reverse DNS ESMTP Exim 4.86 #2 Tue, 13 Oct 2015 21:31:25 +0500 
220-We do not authorize the use of this system to transport unsolicited, 
220 and/or bulk e-mail.

Re: Check_SMTP

Posted: Tue Oct 13, 2015 11:38 am
by hsmith
What happens when you try to run the check from the command line?

./check_smtp -H <IP>

Re: Check_SMTP

Posted: Tue Oct 13, 2015 11:44 am
by rlinux57
From nagios server:
./check_smtp -H IP Address

Code: Select all

CRITICAL - Socket timeout after 10 seconds

On Host:
/usr/local/nagios/libexec/check_smtp -H IP Address

Code: Select all

SMTP OK - 0.026 sec. response time|time=0.025778s;;;0.000000

Re: Check_SMTP

Posted: Tue Oct 13, 2015 12:16 pm
by rlinux57
I have fixed it at my own by using below command:
./check_smtp -H IP Address -t 30 -w 10 -c 20

Code: Select all

SMTP CRITICAL - 20.080 sec. response time|time=20.079998s;10.000000;20.000000;0.000000

Re: Check_SMTP

Posted: Tue Oct 13, 2015 12:20 pm
by hsmith
That makes sense then, by default there is a 10 second timeout. Is this one good to mark resolved?

Re: Check_SMTP

Posted: Tue Oct 13, 2015 12:26 pm
by rlinux57
yes mark this thread resolved, thanks for your kind support.