Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance PCAP Command #672

Merged

Conversation

a18e
Copy link
Contributor

@a18e a18e commented Nov 19, 2024

Changes:

  • Start tcpdump commands in parallel, so the captures start at the same time on each VM
    • Uses the global --parallel parameter of the bosh-cli (which defaults to 5)
  • Allow for multiple Instance Groups/InstanceID capture targets, e.g.:
    bosh -d cf pcap nats router/0 -o test.pcap
    • Overlaps between Instance Groups/IDs are handled gracefully (e.g. router router/0 will merge to router)
  • Reduce verbosity of pcap command
  • Show a table of all the VMs where the capture will be started and prompt if capturing should begin. Include a warning if the number of VMs is > 5 (-n/--non-interactive is supported):
./bosh pcap -d cf  -o test.pcap
[...]

Expected VMs for SSH capture

Job              IP         ID
uaa              10.1.1.65  d5033e83-5750-4e46-bc9c-e69d93cc107c
router           10.1.1.8   37747b53-7a56-460f-bdc7-f991d373cd7f
log-api          10.1.1.71  b65ed4a2-529c-45db-a0dc-50249f06e983
scheduler        10.1.1.68  da38fc60-6938-40d1-9e7d-0e65f313277c
router           10.1.1.9   5fff48d8-1456-4e7c-8a74-63f9b23096eb
cc-worker        10.1.1.67  9cd001cb-d1be-46c4-994d-6f53539710f4
diego-api        10.1.1.64  185b8031-0db4-4e19-92b5-05c7f7481d61
api              10.1.1.66  0cc45a0f-47ce-4a2d-9842-77a137de691d
doppler          10.1.1.70  b3054bbc-a02b-426f-9c3f-9f419888c8e5
nats             10.1.1.3   d6effa85-1cbd-4915-a5ff-93add8c77d4b
graphite-nozzle  10.1.1.72  9dccedaa-6138-4618-9ee9-56354f0af1ec
log-cache        10.1.1.69  1968bd85-f1fd-4007-9c94-8a83815f8124

Traffic on 12 VMs will be captured.

Warning: This could put a significant load on the BOSH Director. Use at your own discretion.

Continue? [yN]:

(Prompt can be omitted via -n/--non-interactive flag)

Correspondings docs PR: cloudfoundry/docs-bosh#858

@a18e a18e force-pushed the pcap-parallel-and-filters branch from 20c07df to 78b6278 Compare November 19, 2024 15:15
Update warning for >5 captured VMs
@a18e a18e force-pushed the pcap-parallel-and-filters branch from 064dcbc to b4d9367 Compare November 20, 2024 16:48
cmd/pcap.go Show resolved Hide resolved
cmd/pcap.go Outdated Show resolved Hide resolved
a18e added 2 commits November 28, 2024 15:08
Fix overlap function
Fix parallelism
Reduce over-verbose print statememts
@a18e a18e marked this pull request as ready for review November 28, 2024 15:16
@rkoster rkoster requested review from a team, klakin-pivotal and nouseforaname and removed request for a team November 28, 2024 16:07
a18e added a commit to sap-contributions/docs-bosh that referenced this pull request Nov 29, 2024
@beyhan beyhan requested review from maxmoehl and removed request for nouseforaname December 5, 2024 15:48
Copy link
Contributor

@ramonskie ramonskie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. as this only have impact on pcap subcmd

@a18e
Copy link
Contributor Author

a18e commented Dec 12, 2024

Thanks for the reviews everyone, could someone please hit the merge button?
(My team is from ARP WG so nobody has any permissions here 😅 )

@lnguyen lnguyen merged commit 0f84de6 into cloudfoundry:main Dec 12, 2024
5 checks passed
@lnguyen
Copy link
Member

lnguyen commented Dec 12, 2024

done @a18e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

5 participants