create_device_sniffer
Creates a persistent firewall sniffer definition on a managed FortiGate device, enabling continuous traffic capture with filters for interface, host, port, protocol, VLAN, IPv6, and non-IP packets.
Instructions
Create a firewall sniffer definition on a managed device.
This targets the FortiGate's own persistent firewall sniffer object
(device-DB, Configuration API firewall.json /firewall/sniffer) so the
capture actually runs on the device's own traffic -- not
FortiManager's separate, unrelated local diagnostic sniffer
(/cli/global/system/sniffer, a different object that happens to
share a name). Unlike FMG's local sniffer there is no packet-count cap
or start/stop action: the definition captures continuously while
status is "enable", same as any other persistent FortiOS config
object -- disable or delete it to stop.
Args: device: Managed device name interface: Interface name traffic sniffing takes place on host: Hosts to filter for (e.g. "1.1.1.1", "2.2.2.0/24") port: Ports to sniff (e.g. "80", "1-1024") protocol: IANA protocol number as a string (e.g. "6" for TCP) vlan: VLAN(s) to sniff capture_ipv6: Include IPv6 packets (default: False) capture_non_ip: Include non-IP packets (default: False) status: "enable" or "disable" (default: "enable") logtraffic: "all", "utm", or "disable" (optional) sniffer_id: Explicit sniffer ID (0-9999); omit to let FortiOS assign the next available one vdom: VDOM the sniffer lives in (default "root")
Returns: Creation result including the new sniffer id
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | No | ||
| port | No | ||
| vdom | No | root | |
| vlan | No | ||
| device | Yes | ||
| status | No | enable | |
| protocol | No | ||
| interface | Yes | ||
| logtraffic | No | ||
| sniffer_id | No | ||
| capture_ipv6 | No | ||
| capture_non_ip | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||