On Tue, Nov 23, 2010 at 10:13 PM, Amit Saxena <[email protected]> wrote:
>
> On Tue, Nov 23, 2010 at 10:09 PM, shawn wilson <[email protected]> wrote:
>
> > Well, each new ssh connection should spawn a new process so you could look
> > at it from that end. More technically, you could look into netstat or lsof
> > modules.
> > On Nov 23, 2010 11:31 AM, "Amit Saxena" <[email protected]> wrote:
> > > Hi all,
> > >
> > > What's the best way to monitor ssh connectivity, and not just ssh port
> > > availability, to a server using perl assuming following constraints ?
> > >
> > > I tried for Net::SSH but public private key is not allowed.
> > >
> > > I tried for Net::SSH::Perl etc but these are not built in perl
> > distribution
> > > (active perl on windows or part of perl distribution of linux / solaris).
> > >
> > > Can we do it via "IO::Socket::INET" ?
> > >
> > > Thanks & Regards,
> > > Amit Saxena
> >
>
> Thanks Shawn for the reply.
>
> Actually my requirement, to be specific, is as follows.
>
> The script will be executed in periodic fashion from a *nix server and the
> script will initiate a ssh connection to itself using perl. This is to
> confirm that the ssh service is running and there is no issue in getting a
> new and authenticated ssh session when clients will connect to the server
> via ssh externally.
>
> Please suggest.
>
> Thanks & Regards,
> Amit Saxena


I don't have experience with perl SSH module(s). But I have read about
Net::SSH::Perl being slow. I don't think IO::Socket is a viable option
because you'll have to manage the encryption and nitty-gritty of SSH
itself. I guess your only options are to either go with Net::SSH::Perl
(it supports public key authentication) or to use the OS's ssh client
in system().

_agn_
--
::: Keep Smiling :::

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/


Reply via email to