add_packet_capture
Creates a FortiManager packet capture definition for traffic to or from FortiManager, returning a capture ID to start capturing later.
Instructions
Add a new FortiManager packet capture definition.
Creates a packet capture (sniffer) definition for traffic originating or destined to the FortiManager itself. The definition is created but not started -- call start_packet_capture() with the returned capture_id to begin capturing.
Args: interface: Interface to capture on (e.g. "port1") host: Filter by host address (optional, matches any host if unset) port: Filter by port or port range as a string, e.g. "80" or "1-1024" (optional) protocol: Filter by IP protocol number as a string, e.g. "6" for TCP (optional) vlan: Filter by VLAN ID as a string (optional) capture_ipv6: Include IPv6 traffic (default: False) capture_non_ip: Include non-IP traffic (default: False) max_packet_count: Maximum number of packets to capture (default: 4000, matching the FMG default)
Returns: dict: Create result with keys: - status: "success" or "error" - capture_id: ID of the created capture definition (FMG auto-assigns this) - message: Status or error message
Example: >>> result = await add_packet_capture(interface="port8", max_packet_count=300) >>> if result["status"] == "success": ... await start_packet_capture(result["capture_id"])
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | No | ||
| port | No | ||
| vlan | No | ||
| protocol | No | ||
| interface | Yes | ||
| capture_ipv6 | No | ||
| capture_non_ip | No | ||
| max_packet_count | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||