• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 227
  • Last Modified:

unix solaris snoop command

when i run snoop command, it generate a file too big. Is there any way to run the command to output to different files versions (i.e. snoopfile1,snoopfile2,snoopfile3,etc)
0
Shen
Asked:
Shen
  • 4
  • 2
1 Solution
 
Joseph GanSystem AdminCommented:
You can use snoop -c maxcount common, where "maxcount" is number of packets captured before quit.
0
 
Joseph GanSystem AdminCommented:
For example, if you want to capture 10k packets in each file, something like:

for i in 1 2 3 4 5
do
snoop -c 10000 > snoopfile$i
done
0
 
ShenAuthor Commented:
Gangos,

Just to make sure i understand your logic. I  was running the following command:
 snoop -c 10000  -v -tr -o /snoop1out.pcap -d e1000g3 &

when i use your loop with my command, will this run the snoop until it reaches 10k and then generate another file? After it write to the file it it goes back and increment the loop count and does it again until it reaches 5?

for i in 1 2 3 4 5
do
   snoop -c 10000 -v -tr -o /snoop1out.pcap -d e1000g3  & > snoopfile$i
done
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
ShenAuthor Commented:
gangos,

correction:
 snoop -c 10000 -v -tr  -d e1000g3  & > snoopfile$i
0
 
ShenAuthor Commented:
Gangos,

your soluction worked with a minor variation:
using the redirect ">" to a file does not let the file be red by wiereshark. Ineed to use -o  "file". So i changed to code below and it worked.
 
for i in {1..10}
 do
    snoop -c 10000 -v -tr -o /snoop1out.pcap -d e1000g3
 done

Thank you very much. Your suggestion was very helpful.
0
 
ShenAuthor Commented:
thanks again. Now i am looking the  syntax to filter multiple ports with snoop.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now