zach-r-long / minimega-phenix

minimega
GNU General Public License v3.0
0 stars 1 forks source link

Stop All Packet Captures #13

Open eric-c-wood opened 3 years ago

eric-c-wood commented 3 years ago

Describe your feature It would be convenient to be able to stop all packet captures for all interfaces. Currently, a user must stop a packet capture for each VM for each interface. In addition, this feature could also be applied to the set of VMs displayed in the running VMs list view as result of a query instead of all VMs capturing packets.

Feature Details Stage of Experiment when feature is active: (Creation, Start, Post Start, Running, Stop, Delete) stage: Running

Where should feature be visible (current phenix tab and general location or propose a new tab, or not visible) view: A button could be added to the multiAction toolbar. This would need to be combined with a search that returned VMs that were capturing packets.
multiaction

Alternatively, a button could be added adjacent to the IPv4 column header. (see screenshot below)

ip_header

This button would be used to stop all packet captures for all VMs capturing packets.

Expected behavior When the button adjacent to the IPv4 header is clicked, packet captures for all VMs are stopped. When the button on the multiAction toolbar is clicked, all packet captures for the VMs that are displayed in the current running VM list view should be stopped.

eric-c-wood commented 3 years ago

I ended up unintentionally implementing this behavior. My goal was to implement a "start/stop capture by subnet" function. Unfortunately, the minimega cli does not currently support stopping a packet capture for a specific VM interface. Consequently, I ended up just implementing the ability to stop all packet captures for all VMs that have an interface in a specific subnet. In addition, I implemented the ability to stop all packet captures for all VMs that are capturing packets.

I ended up adding buttons adjacent to the IPv4 header. The buttons become active when there is a valid IPv4 subnet entered in the search bar. From that list, the play button can be used to start packet captures for all displayed VMs or a selected subset.

In addition, if "capturing" is entered, all VMs that are currently capturing packets will be displayed. From that list, the stop button can be used to stop all packet captures.

captureBySubnet

The "start/stop captures by subnet feature" can be found at this branch https://github.com/eric-c-wood/minimega-phenix/tree/captureSubnet