Re: Couple of issues with SMTP_CHECK

Alexey Andrianov <[email protected]>
Newsgroups gmane.linux.keepalived.devel
Message-ID <[email protected]>

25.03.2015 18:00, Chris Adams пишет:
> Once upon a time, Alexey Andrianov <[email protected]> said:
>> Hello, Chris.
>>
>> To proceed with the second issue, please provide the section of your
>> keepalived.conf corresponding to an SMTP real-server.
> Here's an example:
>
>      real_server 10.0.9.144 587 {
>          weight 1
>          SMTP_CHECK {
>              connect_timeout 3
>              connect_port 587
>          }
>      }
>
> I verified with tcpdump that keepalived was still connecting to port 25.
> IPVS is properly configured for port 587; only the check is wrong.
Yes, I thought so. This is a configuration issue, not a bug. The 
SNMP_CHECK uses the default port (25) and not the RS port for checks 
unless 'host' section is specified in config.
Any connection options (except of connect_timeout) must be specified 
only in 'host' subsection.

Sample config from keepalived.conf.SNMP_CHECK provides this:
     real_server 172.16.1.11 25 {
         weight 1
         SMTP_CHECK {
             connect_timeout 10
             retry 2
             delay_before_retry 5
             helo_name foo.bar.com

             host {
                 connect_ip 172.16.1.11
             }

             host {
                 connect_ip  192.168.155.10
             }

             host {
                 connect_ip  64.233.167.99
             }
         }
     }


The syntax of SNMP_CHECK as it is declared in the source code:

/* Config callback installer */
void
install_smtp_check_keyword(void)
{
         /*
          * Notify the config log parser that we need to be notified via
      * callbacks when the following keywords are encountered in the
      * keepalive.conf file.
          */
     install_keyword("SMTP_CHECK", &smtp_check_handler);
     install_sublevel();
     install_keyword("helo_name", &smtp_helo_name_handler);

     /* This is kept for backward compatibility.
     Used as default value for per-host timeout */
      install_keyword("connect_timeout", &smtp_timeout_handler);

     install_keyword("warmup", &warmup_handler);
     install_keyword("delay_before_retry", &smtp_db_retry_handler);
     install_keyword("retry", &smtp_retry_handler);
     install_keyword("host", &smtp_host_handler);
     install_sublevel();
     install_connect_keywords();
     install_sublevel_end();
     install_sublevel_end();
}


-- 
Best regards,
Alexey


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Keepalived-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/keepalived-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.