Please bottom post....

> This works however I was hoping perl had a module so I didn't have to
run a system application.  I've been playing around with modules such as
scp, telnet and ftp.  I'm curious if there is one for netstat.
> 
> thanks :-)
> > I am still new to working with Perl myself but I think I know the anwer 
> > to this one...
> > 
> > #!/bin/perl
> > 
> > use strict;
> > use warnings;
> > 
> > my $cmd = system('netstat -s')or die "Could not run command: $1";
> > my $cmd = system('netstat -a | grep tcp')or die "Could not run
command: $1";
> > 
> > HTH
> > Jas
> > 
> > [EMAIL PROTECTED] wrote:
> > 
> > > Is there a CPAN module to pull netstat summary information from a
system?
> > > 
> > > Rather than run 'netstat -s', I was hoping to find some way within
perl.
> > > 
> > > What I basically want to do is generate a couple of reports from
the summary 
> > output.  ICMP and TCP information.  If someone can point me in the
right 
> > direction I should be good to go :-)
> > > 
> > > Thanks
> > 
> > 

It appears netstat just reads the values from /proc/net and prints them
in a nice way, so presumably you could use standard opens on the /proc
files and read specifically what you want rather than having netstat
parse them for you.  Though this might actually be one of the places
where shelling out makes sense.  CPAN didn't turn up much...

http://search.cpan.org/~vsego/Linux-net-dev-1.00/dev.pm

http://danconia.org


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to