Oops.. Yes, it's seem the same thing, but i never see that :'( Thanks
On Thu, Nov 27, 2008 at 10:00 AM, <[EMAIL PROTECTED]>wrote: > Send lvs-users mailing list submissions to > [email protected] > > To subscribe or unsubscribe via the World Wide Web, visit > http://lists.graemef.net/mailman/listinfo/lvs-users > 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 lvs-users digest..." > > Today's Topics: > > 1. Re: Checking SSH with ldirectord.- (Graeme Fowler) > > > ---------- Forwarded message ---------- > From: Graeme Fowler <[EMAIL PROTECTED]> > To: "LinuxVirtualServer.org users mailing list." < > [email protected]> > Date: Thu, 27 Nov 2008 10:35:03 +0000 > Subject: Re: [lvs-users] Checking SSH with ldirectord.- > Hi Ariel > > On Tue, 2008-11-25 at 11:57 -0200, Ariel Liguori wrote: > > Hi friends, i've attached a new functionality to my ldirectord, the > > capability of test if an SSH port is listening and based on that redirect > > the trafic or not. > > Basically i create a new sub called check_ssh, look up the code and feel > > free to correct me if something is worng :) > > Correct me if I'm wrong :) but this looks almost exactly like the > existing "connect" check type in ldirectord: > > sub check_connect > { > my ($v, $r) = @_; > my $port = ld_checkport($v, $r); > > eval { > local $SIG{'__DIE__'} = "DEFAULT"; > local $SIG{'ALRM'} = sub { die "Timeout Alarm" }; > &ld_debug(4, "Timeout is $$v{checktimeout}"); > alarm $$v{checktimeout}; > my $sock = &ld_open_socket($$r{server}, $port, > $$v{protocol}); > if ($sock) { > close($sock); > } else { > alarm 0; # Cancel the alarm > die("Socket Connect Failed"); > } > &ld_debug(3, "Connected to $$r{server} (port $port)"); > alarm 0; # Cancel the alarm > }; > if ($@) { > &service_set($v, $r, "down"); > &ld_debug(3, "Deactivated service $$r{server}:$$r{port}: > $@"); > return $SERVICE_DOWN; > } else { > &service_set($v, $r, "up"); > &ld_debug(3, "Activated service $$r{server}:$$r{port}"); > return $SERVICE_UP; > } > } > > > in that it opens a socket to the listening server and confirms that the > three-way handshake is successful, then closes the connection. > > It looks to me like you've reinvented the wheel here. > > Graeme > > > > > _______________________________________________ > lvs-users mailing list > [email protected] > http://lists.graemef.net/mailman/listinfo/lvs-users > > -- --- Ariel M. Liguori Buenos Aires, Argentina. http://hacksecurity.com.ar _______________________________________________ LinuxVirtualServer.org mailing list - [email protected] Send requests to [EMAIL PROTECTED] or go to http://lists.graemef.net/mailman/listinfo/lvs-users
