Send Linux-ha-cvs mailing list submissions to linux-ha-cvs@lists.linux-ha.org
To subscribe or unsubscribe via the World Wide Web, visit http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs or, via email, send a message with subject or body 'help' to [EMAIL PROTECTED] You can reach the person managing the list at [EMAIL PROTECTED] When replying, please edit your Subject line so it is more specific than "Re: Contents of Linux-ha-cvs digest..." Today's Topics: 1. Linux-HA CVS: ldirectord by horms from (linux-ha-cvs@lists.linux-ha.org) 2. Linux-HA CVS: linux-ha by horms from (linux-ha-cvs@lists.linux-ha.org) ---------------------------------------------------------------------- Message: 1 Date: Tue, 4 Jul 2006 21:40:45 -0600 (MDT) From: linux-ha-cvs@lists.linux-ha.org Subject: [Linux-ha-cvs] Linux-HA CVS: ldirectord by horms from To: [EMAIL PROTECTED] Message-ID: <[EMAIL PROTECTED]> linux-ha CVS committal Author : horms Host : Project : linux-ha Module : ldirectord Dir : linux-ha/ldirectord Modified Files: ldirectord Log Message: ldirectord: Add pops and imaps checks This adds the following new dependancies for the ldirectord package Debian: libmail-pop3client-perl, libnet-imap-simple-ssl-perl RPM: perl-Net-IMAP-Simple-SSL, perl-POP3Client A subsequent patch will consolidate the modules used by the imap, imaps, pop and pops checks. Thanks to Julien Ducros =================================================================== RCS file: /home/cvs/linux-ha/linux-ha/ldirectord/ldirectord,v retrieving revision 1.136 retrieving revision 1.137 diff -u -3 -r1.136 -r1.137 --- ldirectord 5 Apr 2006 02:12:24 -0000 1.136 +++ ldirectord 5 Jul 2006 03:40:44 -0000 1.137 @@ -1,5 +1,5 @@ #!/usr/bin/perl -my($VERSION)=(qw$Id: ldirectord,v 1.136 2006/04/05 02:12:24 horms Exp $)[2]; +my($VERSION)=(qw$Id: ldirectord,v 1.137 2006/07/05 03:40:44 horms Exp $)[2]; ###################################################################### # ldirectord http://www.vergenet.net/linux/ldirectord/ @@ -241,14 +241,14 @@ On means no checking will take place and real servers will always be activated. Default is I<negotiate>. -B<service = ftp>|B<smtp>|B<http>|B<pop>|B<nntp>|B<imap>|B<ldap>|B<https>|B<dns>|B<mysql>|B<pgsql>|B<sip>|B<none> +B<service = ftp>|B<smtp>|B<http>|B<pop>|B<pops>|B<nntp>|B<imap>|B<imaps>|B<ldap>|B<https>|B<dns>|B<mysql>|B<pgsql>|B<sip>|B<none> The type of service to monitor when using checktype=negotiate. None denotes a service that will not be monitored. If the port specfied for the virtual server is 21, 25, 53, 80, 110, 119, 143, 389, 443, 3306, 5432 or 5060 then -the default is B<ftp>, B<smtp>, B<dns>, B<http>, B<pop>, B<nntp>, B<imap>, -B<ldap>, B<https>, B<mysql>, B<pgsql> or B<sip> respectivly. Otherwise the -default service is B<none>. +the default is B<ftp>, B<smtp>, B<dns>, B<http>, B<pop>, B<pops>, B<nntp>, +B<imap>, <B<imaps>, B<ldap>, B<https>, B<mysql>, B<pgsql> or B<sip> respectivly. +Otherwise the default service is B<none>. B<checkport = >I<n> @@ -911,8 +911,8 @@ } } elsif ($rcmd =~ /^service\s*=\s*(.*)/) { lc($1); - $1 =~ /(\w+)/ && ($1 eq "http" || $1 eq "https" || $1 eq "ldap" || $1 eq "ftp" || $1 eq "none" || $1 eq "smtp" || $1 eq "pop" || $1 eq "imap" || $1 eq "nntp" || $1 eq "dns" || $1 eq "mysql" || $1 eq "pgsql" || $1 eq "sip") - or &config_error($line, "service must be http, https, ftp, smtp, pop, imap, ldap, nntp, dns, mysql, pgsql, sip, or none"); + $1 =~ /(\w+)/ && ($1 eq "http" || $1 eq "https" || $1 eq "ldap" || $1 eq "ftp" || $1 eq "none" || $1 eq "smtp" || $1 eq "pop" || $1 eq "pops" || $1 eq "imap" || $1 eq "imaps" || $1 eq "nntp" || $1 eq "dns" || $1 eq "mysql" || $1 eq "pgsql" || $1 eq "sip") + or &config_error($line, "service must be http, https, ftp, smtp, pop, pops, imap, imaps, ldap, nntp, dns, mysql, pgsql, sip, or none"); $vsrv{service} = $1; if($vsrv{service} eq "ftp" and $vsrv{login} eq "") { @@ -1061,7 +1061,7 @@ # post: Take ip_port, resolve it as per ld_gethostservbyname # and set $vsrv->{server} and $vsrv->{port} accordingly. # If $vsrv->{service} is not set, then set it to "http", -# "https", "ftp", "smtp", "pop", "imap", "ldap", "nntp" or "none" +# "https", "ftp", "smtp", "pop", "pops", "imap", "imaps", "ldap", "nntp" or "none" # if $vsrv->{port} is 80, 443, 21, 25, 110, 143, 389 or # any other value, respectivley # return: none @@ -1098,12 +1098,18 @@ elsif ($vsrv->{port} eq "110") { $vsrv->{service} = "pop"; } + elsif ($vsrv->{port} eq "995") { + $vsrv->{service} = "pops"; + } elsif ($vsrv->{port} eq "119") { $vsrv->{service} = "nntp"; } elsif ($vsrv->{port} eq "143") { $vsrv->{service} = "imap"; } + elsif ($vsrv->{port} eq "993") { + $vsrv->{service} = "imaps"; + } elsif ($vsrv->{port} eq "389") { $vsrv->{service} = "ldap"; } @@ -1705,8 +1711,12 @@ # $ua->register($req, \&http_received); } elsif ($$v{service} eq "pop") { $$r{num_connects} = 0 if (check_pop($v, $r)); + } elsif ($$v{service} eq "pops") { + $$r{num_connects} = 0 if (check_pops($v, $r)); } elsif ($$v{service} eq "imap") { $$r{num_connects} = 0 if (check_imap($v, $r)); + } elsif ($$v{service} eq "imaps") { + $$r{num_connects} = 0 if (check_imaps($v, $r)); } elsif ($$v{service} eq "smtp") { $$r{num_connects} = 0 if (check_smtp($v, $r)); } elsif ($$v{service} eq "ftp") { @@ -1876,6 +1886,40 @@ return 1; } +sub check_pops +{ + require Mail::POP3Client; + my ($v, $r) = @_; + my $port=(defined $$v{checkport}?$$v{checkport}:$$r{port}); + + &ld_debug(2, "Checking pops server=$$r{server} port=$port"); + + my $pops = new Mail::POP3Client(USER => $$v{login}, + PASSWORD => $$v{passwd}, + HOST => $$r{server}, + USESSL => 1, + PORT => $port, + DEBUG => 0, + TIMEOUT => $$v{negotiatetimeout}); + if (!$pops) { + service_set($v, $r, "down"); + return 1; + } + + if($$v{login} ne "") { + my $authres = $pops->login(); + $pops->close(); + if (!$authres) { + service_set($v, $r, "down"); + return 1; + } + } + + + $pops->close(); + service_set($v, $r, "up"); + return 0; +} sub check_imap { @@ -1908,6 +1952,36 @@ return 0; } +sub check_imaps +{ + require Net::IMAP::Simple::SSL; + my ($v, $r) = @_; + my $port=(defined $$v{checkport}?$$v{checkport}:$$r{port}); + + &ld_debug(2, "Checking imaps server=$$r{server} port=$port"); + + my $imaps = Net::IMAP::Simple::SSL->new($$r{server}, + port => $port, + timeout => $$v{negotiatetimeout}); + if (!$imaps) { + service_set($v, $r, "down"); + return 1; + } + + if($$v{login} ne "") { + my $authres = $imaps->login($$v{login},$$v{passwd}); + $imaps->quit; + if (!$authres) { + service_set($v, $r, "down"); + return 1; + } + } + + $imaps->quit(); + service_set($v, $r, "up"); + return 0; +} + sub check_ldap { my ($v, $r) = @_; ------------------------------ Message: 2 Date: Tue, 4 Jul 2006 21:43:08 -0600 (MDT) From: linux-ha-cvs@lists.linux-ha.org Subject: [Linux-ha-cvs] Linux-HA CVS: linux-ha by horms from To: [EMAIL PROTECTED] Message-ID: <[EMAIL PROTECTED]> linux-ha CVS committal Author : horms Host : Module : linux-ha Dir : linux-ha Modified Files: Tag: STABLE_1_2 heartbeat.spec.in Log Message: ldirectord: Add pops and imaps checks (Sync with 1.137) This adds the following new dependancies for the ldirectord package Debian: libmail-pop3client-perl, libnet-imap-simple-ssl-perl RPM: perl-Net-IMAP-Simple-SSL, perl-POP3Client A subsequent patch will consolidate the modules used by the imap, imaps, pop and pops checks. Thanks to Julien Ducros =================================================================== RCS file: /home/cvs/linux-ha/linux-ha/heartbeat.spec.in,v retrieving revision 1.80.2.27 retrieving revision 1.80.2.28 diff -u -3 -r1.80.2.27 -r1.80.2.28 --- heartbeat.spec.in 5 Jul 2006 03:22:48 -0000 1.80.2.27 +++ heartbeat.spec.in 5 Jul 2006 03:43:07 -0000 1.80.2.28 @@ -1,4 +1,4 @@ -# $Id: heartbeat.spec.in,v 1.80.2.27 2006/07/05 03:22:48 horms Exp $ +# $Id: heartbeat.spec.in,v 1.80.2.28 2006/07/05 03:43:07 horms Exp $ # Workaround for a change in RPM 4.1.x; needs proper fixing soon! %define _unpackaged_files_terminate_build 1 @@ -20,9 +20,10 @@ %package ldirectord Summary: Monitor daemon for maintaining high availability resources Group: Utilities -Requires: perl, perl-libwww-perl perl-Crypt-SSLeay, ipvsadm, perl-HTML-Parser, perl-ldap, perl-MailTools, perl-Mail-IMAPClient, perl-libnet, perl-Net-DNS +Requires: perl, perl-libwww-perl perl-Crypt-SSLeay, ipvsadm, perl-HTML-Parser, perl-ldap, perl-MailTools, perl-Mail-IMAPClient, perl-Net-IMAP-Simple-SSL, perl-POP3Client, perl-libnet, perl-Net-DNS # perl-libwww-perl, perl-HTML-Parser, perl-ldap, perl-MailTools, -# perl-Mail-IMAPClient, perl-libnet, perl-Net-DNS and ipvsadm +# perl-Mail-IMAPClient, perl-Net-IMAP-Simple-SSL, perl-POP3Client, +# perl-libnet, perl-Net-DNS and ipvsadm # available from www.ultramonkey.org and others %package stonith ------------------------------ _______________________________________________ Linux-ha-cvs mailing list Linux-ha-cvs@lists.linux-ha.org http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs End of Linux-ha-cvs Digest, Vol 32, Issue 12 ********************************************