11// Automatically generated by './scripts/generate-doc.sh'. Do not edit, or make the NETOBSERV team aware of the editions.
22:_mod-docs-content-type: REFERENCE
3+
34[id="network-observability-netobserv-cli-reference_{context}"]
45= Network Observability CLI usage
56
6- You can use the Network Observability CLI (`oc netobserv` ) to pass command line arguments to capture flow data and packet data for further analysis, enable Network Observability Operator features, or pass configuration options to the eBPF agent and `flowlogs-pipeline` .
7+ You can use the Network Observability CLI (`oc netobserv`) to pass command line arguments to capture flows data, packets data, and metrics for further analysis and enable features supported by the Network Observability Operator .
78
89[id="cli-syntax_{context}"]
910== Syntax
10- The basic syntax for `oc netobserv` commands is as follows :
11+ The basic syntax for `oc netobserv` commands:
1112
1213.`oc netobserv` syntax
1314[source,terminal]
@@ -26,6 +27,14 @@ $ oc netobserv [<command>] [<feature_option>] [<command_options>] <1>
2627| Capture flows information. For subcommands, see the "Flows capture options" table.
2728| packets
2829| Capture packets data. For subcommands, see the "Packets capture options" table.
30+ | metrics
31+ | Capture metrics data. For subcommands, see the "Metrics capture options" table.
32+ | follow
33+ | Follow collector logs when running in background.
34+ | stop
35+ | Stop collection by removing agent daemonset.
36+ | copy
37+ | Copy collector generated files locally.
2938| cleanup
3039| Remove the Network Observability CLI components.
3140| version
@@ -46,44 +55,52 @@ $ oc netobserv flows [<feature_option>] [<command_options>]
4655[cols="1,1,1",options="header"]
4756|===
4857| Option | Description | Default
49- |--enable_pktdrop| enable packet drop | false
50- |--enable_dns| enable DNS tracking | false
51- |--enable_rtt| enable RTT tracking | false
52- |--enable_network_events| enable Network events monitoring | false
53- |--enable_filter| enable flow filter | false
54- |--log-level| components logs | info
55- |--max-time| maximum capture time | 5m
56- |--max-bytes| maximum capture bytes | 50000000 = 50MB
57- |--copy| copy the output files locally | prompt
58- |--direction| filter direction | n/a
59- |--cidr| filter CIDR | 0.0.0.0/0
60- |--protocol| filter protocol | n/a
61- |--sport| filter source port | n/a
62- |--dport| filter destination port | n/a
63- |--port| filter port | n/a
64- |--sport_range| filter source port range | n/a
65- |--dport_range| filter destination port range | n/a
66- |--port_range| filter port range | n/a
67- |--sports| filter on either of two source ports | n/a
68- |--dports| filter on either of two destination ports | n/a
69- |--ports| filter on either of two ports | n/a
70- |--tcp_flags| filter TCP flags | n/a
71- |--action| filter action | Accept
72- |--icmp_type| filter ICMP type | n/a
73- |--icmp_code| filter ICMP code | n/a
74- |--peer_ip| filter peer IP | n/a
75- |--interfaces| interfaces to monitor | n/a
58+ |--enable_all| enable all eBPF features | false
59+ |--enable_dns| enable DNS tracking | false
60+ |--enable_network_events| enable network events monitoring | false
61+ |--enable_pkt_translation| enable packet translation | false
62+ |--enable_pkt_drop| enable packet drop | false
63+ |--enable_rtt| enable RTT tracking | false
64+ |--enable_udn_mapping| enable User Defined Network mapping | false
65+ |--get-subnets| get subnets information | false
66+ |--background| run in background | false
67+ |--copy| copy the output files locally | prompt
68+ |--log-level| components logs | info
69+ |--max-time| maximum capture time | 5m
70+ |--max-bytes| maximum capture bytes | 50000000 = 50MB
71+ |--action| filter action | Accept
72+ |--cidr| filter CIDR | 0.0.0.0/0
73+ |--direction| filter direction | –
74+ |--dport| filter destination port | –
75+ |--dport_range| filter destination port range | –
76+ |--dports| filter on either of two destination ports | –
77+ |--drops| filter flows with only dropped packets | false
78+ |--icmp_code| filter ICMP code | –
79+ |--icmp_type| filter ICMP type | –
80+ |--node-selector| capture on specific nodes | –
81+ |--peer_ip| filter peer IP | –
82+ |--peer_cidr| filter peer CIDR | –
83+ |--port_range| filter port range | –
84+ |--port| filter port | –
85+ |--ports| filter on either of two ports | –
86+ |--protocol| filter protocol | –
87+ |--regexes| filter flows using regular expression | –
88+ |--sport_range| filter source port range | –
89+ |--sport| filter source port | –
90+ |--sports| filter on either of two source ports | –
91+ |--tcp_flags| filter TCP flags | –
92+ |--interfaces| interfaces to monitor | –
7693|===
7794
7895.Example running flows capture on TCP protocol and port 49051 with PacketDrop and RTT features enabled:
7996[source,terminal]
8097----
81- $ oc netobserv flows --enable_pktdrop=true --enable_rtt=true --enable_filter=true --action=Accept --cidr=0.0.0.0/0 --protocol=TCP --port=49051
98+ $ oc netobserv flows --enable_pkt_drop --enable_rtt --enable_filter --action=Accept --cidr=0.0.0.0/0 --protocol=TCP --port=49051
8299----
83-
84100[id="cli-reference-packet-capture-options_{context}"]
85101== Packets capture options
86- You can filter on port and protocol for packet capture data.
102+ You can filter packets capture data the as same as flows capture by using the filters.
103+ Certain features, such as packets drop, DNS, RTT, and network events, are only available for flows and metrics capture.
87104
88105.`oc netobserv packets` syntax
89106[source,terminal]
@@ -93,31 +110,85 @@ $ oc netobserv packets [<option>]
93110[cols="1,1,1",options="header"]
94111|===
95112| Option | Description | Default
96- |--log-level| components logs | info
97- |--max-time| maximum capture time | 5m
98- |--max-bytes| maximum capture bytes | 50000000 = 50MB
99- |--copy| copy the output files locally | prompt
100- |--direction| filter direction | n/a
101- |--cidr| filter CIDR | 0.0.0.0/0
102- |--protocol| filter protocol | n/a
103- |--sport| filter source port | n/a
104- |--dport| filter destination port | n/a
105- |--port| filter port | n/a
106- |--sport_range| filter source port range | n/a
107- |--dport_range| filter destination port range | n/a
108- |--port_range| filter port range | n/a
109- |--sports| filter on either of two source ports | n/a
110- |--dports| filter on either of two destination ports | n/a
111- |--ports| filter on either of two ports | n/a
112- |--tcp_flags| filter TCP flags | n/a
113- |--action| filter action | Accept
114- |--icmp_type| filter ICMP type | n/a
115- |--icmp_code| filter ICMP code | n/a
116- |--peer_ip| filter peer IP | n/a
113+ |--background| run in background | false
114+ |--copy| copy the output files locally | prompt
115+ |--log-level| components logs | info
116+ |--max-time| maximum capture time | 5m
117+ |--max-bytes| maximum capture bytes | 50000000 = 50MB
118+ |--action| filter action | Accept
119+ |--cidr| filter CIDR | 0.0.0.0/0
120+ |--direction| filter direction | –
121+ |--dport| filter destination port | –
122+ |--dport_range| filter destination port range | –
123+ |--dports| filter on either of two destination ports | –
124+ |--drops| filter flows with only dropped packets | false
125+ |--icmp_code| filter ICMP code | –
126+ |--icmp_type| filter ICMP type | –
127+ |--node-selector| capture on specific nodes | –
128+ |--peer_ip| filter peer IP | –
129+ |--peer_cidr| filter peer CIDR | –
130+ |--port_range| filter port range | –
131+ |--port| filter port | –
132+ |--ports| filter on either of two ports | –
133+ |--protocol| filter protocol | –
134+ |--regexes| filter flows using regular expression | –
135+ |--sport_range| filter source port range | –
136+ |--sport| filter source port | –
137+ |--sports| filter on either of two source ports | –
138+ |--tcp_flags| filter TCP flags | –
117139|===
118140
119141.Example running packets capture on TCP protocol and port 49051:
120142[source,terminal]
121143----
122144$ oc netobserv packets --action=Accept --cidr=0.0.0.0/0 --protocol=TCP --port=49051
123145----
146+ [id="cli-reference-metrics-capture-options_{context}"]
147+ == Metrics capture options
148+ You can enable features and use filters on metrics capture, the same as flows capture. The generated graphs fill accordingly in the dashboard.
149+
150+ .`oc netobserv metrics` syntax
151+ [source,terminal]
152+ ----
153+ $ oc netobserv metrics [<option>]
154+ ----
155+ [cols="1,1,1",options="header"]
156+ |===
157+ | Option | Description | Default
158+ |--enable_all| enable all eBPF features | false
159+ |--enable_dns| enable DNS tracking | false
160+ |--enable_network_events| enable network events monitoring | false
161+ |--enable_pkt_translation| enable packet translation | false
162+ |--enable_pkt_drop| enable packet drop | false
163+ |--enable_rtt| enable RTT tracking | false
164+ |--enable_udn_mapping| enable User Defined Network mapping | false
165+ |--get-subnets| get subnets information | false
166+ |--action| filter action | Accept
167+ |--cidr| filter CIDR | 0.0.0.0/0
168+ |--direction| filter direction | –
169+ |--dport| filter destination port | –
170+ |--dport_range| filter destination port range | –
171+ |--dports| filter on either of two destination ports | –
172+ |--drops| filter flows with only dropped packets | false
173+ |--icmp_code| filter ICMP code | –
174+ |--icmp_type| filter ICMP type | –
175+ |--node-selector| capture on specific nodes | –
176+ |--peer_ip| filter peer IP | –
177+ |--peer_cidr| filter peer CIDR | –
178+ |--port_range| filter port range | –
179+ |--port| filter port | –
180+ |--ports| filter on either of two ports | –
181+ |--protocol| filter protocol | –
182+ |--regexes| filter flows using regular expression | –
183+ |--sport_range| filter source port range | –
184+ |--sport| filter source port | –
185+ |--sports| filter on either of two source ports | –
186+ |--tcp_flags| filter TCP flags | –
187+ |--interfaces| interfaces to monitor | –
188+ |===
189+
190+ .Example running metrics capture for TCP drops
191+ [source,terminal]
192+ ----
193+ $ oc netobserv metrics --enable_pkt_drop --enable_filter --protocol=TCP
194+ ----
0 commit comments