Check_SMTP

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Check_SMTP

Post by rlinux57 »

Getting SMTP "CRITICAL - Socket timeout after 10 seconds" , it was working from last 4 months but suddenly getting socket timeout error.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Check_SMTP

Post 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?
Former Nagios Employee.
me.
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: Check_SMTP

Post by rlinux57 »

Ping is successfully done from nagios server.
Nothing was changed, and i have already added nagios server ip to client firewall.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Check_SMTP

Post 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.
Former Nagios Employee.
me.
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: Check_SMTP

Post 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.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Check_SMTP

Post by hsmith »

What happens when you try to run the check from the command line?

./check_smtp -H <IP>
Former Nagios Employee.
me.
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: Check_SMTP

Post 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
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: Check_SMTP

Post 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
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Check_SMTP

Post by hsmith »

That makes sense then, by default there is a 10 second timeout. Is this one good to mark resolved?
Former Nagios Employee.
me.
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: Check_SMTP

Post by rlinux57 »

yes mark this thread resolved, thanks for your kind support.
Locked