I like net::ping. But what's the point of reinventing the wheel? There's
dozens of network monitoring suites that'll do this for you - nagios for one
should suite the purpose well enough.

Also, nmap should have a module to allow you to audit ssh. With any luck,
you might be able to access that from perl.
On Nov 23, 2010 9:55 PM, "Peter Scott" <[email protected]> wrote:
> On Tue, 23 Nov 2010 21:59:19 +0530, Amit Saxena 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" ?
>
> If it's enough to check that something's listening to port 22:
>
> perl -MNet::Ping -le '$p=Net::Ping->new; $p->port_number(22); $p->ping
> (localhost) or warn "SSH down"'
>
> --
> Peter Scott
> http://www.perlmedic.com/ http://www.perldebugged.com/
> http://www.informit.com/store/product.aspx?isbn=0137001274
> http://www.oreillyschool.com/courses/perl3/
>
> --
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> http://learn.perl.org/
>
>

Reply via email to