Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

To Shell or To Perl, that is the question

by tradez (Pilgrim)
on Mar 05, 2002 at 19:51 UTC ( #149482=perlquestion: print w/ replies, xml ) Need Help??
tradez has asked for the wisdom of the Perl Monks concerning the following question:

Fellow Monks, I come to you with a question over a few things. First of course is perl versus another solution (basic shell) and the next is over libpcap and tcpdump. I currently have a script (shell) that looks something like this snidbit:
#!/bin/sh # # # Sector au-135 cd /tmp/tcptrace FILENAME=au135-`date +%Y%m%d%H%M%S`.tcpdump /usr/sbin/tcpdump -n -c 30000 -w /tmp/tcptrace/$FILENAME -i eth1 host +`/usr/local/bin/which-hosts au-135 50|/usr/local/bin/host-it.pl`& MYJOB=$! sleep 60 sync kill $MYJOB /usr/local/bin/tcptrace-munch $FILENAME rm /tmp/tcptrace/$FILENAME
Basically I am going to be going back to tcpdump to dump data for a certain "sector" of users on a broadband network. With shell, I am using sleep, and doing these all at once. I am planning on updating to perl with systems calls and forking off multiple tcpdump sessions at once, but I wanted to ask if anyone had done something like this before. Will tcpdump run multiple sessions? What type of load are we talking if somewhere around 15 sessions are running? What type of degredation of integrity/is there any that I can expect from the data recieved through tcpdump? Thanks ahead of time for any help you can spare.

Tradez
"Never underestimate the predicability of stupidity"
- Bullet Tooth Tony, Snatch (2001)

Comment on To Shell or To Perl, that is the question
Download Code
Re: To Shell or To Perl, that is the question
by C-Keen (Monk) on Mar 05, 2002 at 20:16 UTC
    I doubt that running tcpdump "parallel" would give you an improvement since your hardware has to deliver the packets and is therefore the bottleneck in your setup. Would be different if you had mutliple networking hardware...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://149482]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2014-09-18 01:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (103 votes), past polls