status failed when contact smtp server

Issue #888 closed
Anace BYAOUI created an issue

Hi All,

I have a problem with the smtp server check, there seems to be a fake problem in reporting the smtp server contact status, I tried with a script to contact the smtp server and it appears that it is reachable every time monit reports this error:

in “log”:

[CEST Apr 16 16:40:22] error : 'smtp2.domain.com' failed protocol test [SMTP] at [smtp2.domain.com]:25 [TCP/IP] -- Error receiving data from the mailserver -- Resource temporarily unavailable

in “monit status”:

Remote Host 'smtp2.domain.com'
status Connection failed
monitoring status Monitored
monitoring mode active
on reboot start
port response time FAILED to [smtp2.domain.com]:25 type TCP/IP protocol SMTP
data collected Thu, 16 Apr 2020 17:44:44

my config :

in file '/etc/monit.d/host'

check host smtp2.domain.com with address smtp2.domain.com
group SMTP
if failed port 25 and protocol smtp for 20 cycles then alert

in file ‘/etc/monitrc’

set mailserver smtp2.domain.com

could you please help me ?

thank you in advance

Anace

Comments (11)

  1. Tildeslash repo owner

    Hi,

    please can you send us a network trace of the communication between monit and your smtp server? You can use for example wireshark or tcpdump to capture the data.

    best regards

  2. Anace BYAOUI reporter

    hi,
    I have attached the trace.
    please let’s me know when you have received it, then i can delete it from the issue

    best regards

    Anace

  3. Tildeslash repo owner

    it is quite strange … the capture contains 3 attempts to connect to the SMTP server, where the client did TCP reset immediately after it received a valid response from the server (most probably monit’s SMTP checks)

    Then there is one successful SMTP transaction between monit and the server when monit sent the alert message via the same server … which worked fine.

    I have tried to reproduce the problem, adding an SMTP check for the server IP which is visible in the trace … works fine:

    'xxx' succeeded testing protocol [SMTP] at [xxx]:25 [TCP/IP] [response time 309.765 ms]
    
    'xxx' connection succeeded to [xxx]:25 [TCP/IP]
    

    It seems that the problem is on lower layer … maybe some firewall killing the connection or incompatible TCP/IP settings.

    I’m not sure if we can help you in this case, it is probably a network problem, not monit bug.

  4. Anace BYAOUI reporter

    Thank you for the feedback.

    could you please send me the config you put to get this log:

    'xxx' succeeded testing protocol [SMTP] at [xxx]:25 [TCP/IP] [response time 309.765 ms]
    'xxx' connection succeeded to [xxx]:25 [TCP/IP]
    

  5. Tildeslash repo owner

    set daemon 5
    
    set httpd port 2812 allow localhost
    
    check host shared-proxy-01.zimbra.id with address 93.62.133.224
            group SMTP
            if failed port 25 and protocol smtp for 20 cycles then alert
    

    and executing it via “monit -vIc <path to configuration file>”

  6. Anace BYAOUI reporter

    it seems that it remains stable for some time at the first check and then reports that it has failed:

    the status in the first check :

    Remote Host ' smtp2.domain.com'
    status OK
    monitoring status Monitored
    monitoring mode active
    on reboot start
    port response time 3.716 s to smtp2.domain.com:25 type TCP/IP protocol SMTP
    data collected Fri, 17 Apr 2020 14:51:15

    after :

    Remote Host 'smtp2.domain.com:25
    status OK
    monitoring status Monitored
    monitoring mode active
    on reboot start
    port response time FAILED to [smtp2.domain.com:25 ]:25 type TCP/IP protocol SMTP
    data collected Fri, 17 Apr 2020 14:52:50

    I can't explain this behavior.

  7. Log in to comment