Skip to content

Commit 7c97802

Browse files
committed
OSDOCS-10730: NetObserv 1.8 CLI reference
1 parent 6e028b5 commit 7c97802

File tree

1 file changed

+63
-15
lines changed

1 file changed

+63
-15
lines changed

modules/network-observability-netobserv-cli-reference.adoc

Lines changed: 63 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
[id="network-observability-netobserv-cli-reference_{context}"]
44
= Network Observability CLI usage
55

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-
8-
[id="cli-syntax_{context}"]
6+
You can use the 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.
97
== Syntax
108
The basic syntax for `oc netobserv` commands is as follows:
119

@@ -16,16 +14,15 @@ $ oc netobserv [<command>] [<feature_option>] [<command_options>] <1>
1614
----
1715
<1> Feature options can only be used with the `oc netobserv flows` command. They cannot be used with the `oc netobserv packets` command.
1816

19-
[id="cli-basic-commands_{context}"]
2017
== Basic commands
2118
[cols="3a,8a",options="header"]
2219
.Basic commands
2320
|===
2421
| Command | Description
2522
| flows
26-
| Capture flows information. For subcommands, see the "Flows capture options" table.
23+
| Capture flows information. For subcommands, see the "Flow capture subcommands" table.
2724
| packets
28-
| Capture packets data. For subcommands, see the "Packets capture options" table.
25+
| Capture packets data. For subcommands, see the "Packet capture subcommand" table.
2926
| cleanup
3027
| Remove the Network Observability CLI components.
3128
| version
@@ -34,10 +31,8 @@ $ oc netobserv [<command>] [<feature_option>] [<command_options>] <1>
3431
| Show help.
3532
|===
3633

37-
[id="cli-reference-flows-capture-options_{context}"]
3834
== Flows capture options
39-
Flows capture has mandatory commands as well as additional options, such as enabling extra features about packet drops, DNS latencies, Round-trip time, and filtering.
40-
35+
Flow capture has mandatory commands as well as additional options, such as enabling extra features about packet drops, DNS latencies, Round-trip time, and filtering.
4136
.`oc netobserv flows` syntax
4237
[source,terminal]
4338
----
@@ -50,11 +45,14 @@ $ oc netobserv flows [<feature_option>] [<command_options>]
5045
|--enable_dns| enable DNS tracking | false
5146
|--enable_rtt| enable RTT tracking | false
5247
|--enable_network_events| enable Network events monitoring | false
53-
|--enable_filter| enable flow filter | false
48+
|--get-subnets| get subnets informations | false
5449
|--log-level| components logs | info
5550
|--max-time| maximum capture time | 5m
5651
|--max-bytes| maximum capture bytes | 50000000 = 50MB
52+
|--background| run in background | false
5753
|--copy| copy the output files locally | prompt
54+
|--node-selector| capture on specific nodes | n/a
55+
|--enable_filter| enable flow filter | false
5856
|--direction| filter direction | n/a
5957
|--cidr| filter CIDR | 0.0.0.0/0
6058
|--protocol| filter protocol | n/a
@@ -72,18 +70,18 @@ $ oc netobserv flows [<feature_option>] [<command_options>]
7270
|--icmp_type| filter ICMP type | n/a
7371
|--icmp_code| filter ICMP code | n/a
7472
|--peer_ip| filter peer IP | n/a
73+
|--drops| filter flows with only dropped packets | false
74+
|--regexes| filter flows using regex | n/a
7575
|--interfaces| interfaces to monitor | n/a
7676
|===
7777

78-
.Example running flows capture on TCP protocol and port 49051 with PacketDrop and RTT features enabled:
78+
.Example running flow capture on TCP protocol and port 49051 with PacketDrop and RTT features enabled:
7979
[source,terminal]
8080
----
8181
$ oc netobserv flows --enable_pktdrop=true --enable_rtt=true --enable_filter=true --action=Accept --cidr=0.0.0.0/0 --protocol=TCP --port=49051
8282
----
83-
84-
[id="cli-reference-packet-capture-options_{context}"]
8583
== Packets capture options
86-
You can filter on port and protocol for packet capture data.
84+
You can filter packet capture data as same as flow capture using the filters. However, the features are not available here.
8785

8886
.`oc netobserv packets` syntax
8987
[source,terminal]
@@ -96,7 +94,10 @@ $ oc netobserv packets [<option>]
9694
|--log-level| components logs | info
9795
|--max-time| maximum capture time | 5m
9896
|--max-bytes| maximum capture bytes | 50000000 = 50MB
97+
|--background| run in background | false
9998
|--copy| copy the output files locally | prompt
99+
|--node-selector| capture on specific nodes | n/a
100+
|--enable_filter| enable flow filter | false
100101
|--direction| filter direction | n/a
101102
|--cidr| filter CIDR | 0.0.0.0/0
102103
|--protocol| filter protocol | n/a
@@ -114,10 +115,57 @@ $ oc netobserv packets [<option>]
114115
|--icmp_type| filter ICMP type | n/a
115116
|--icmp_code| filter ICMP code | n/a
116117
|--peer_ip| filter peer IP | n/a
118+
|--drops| filter flows with only dropped packets | false
119+
|--regexes| filter flows using regex | n/a
117120
|===
118121

119-
.Example running packets capture on TCP protocol and port 49051:
122+
.Example running packet capture on TCP protocol and port 49051:
120123
[source,terminal]
121124
----
122125
$ oc netobserv packets --action=Accept --cidr=0.0.0.0/0 --protocol=TCP --port=49051
123126
----
127+
== Metrics capture options
128+
You can enable features and use filters on metrics capture as same as flow capture. The generated graphs will fill accordingly.
129+
130+
.`oc netobserv metrics` syntax
131+
[source,terminal]
132+
----
133+
$ oc netobserv metrics [<option>]
134+
----
135+
[cols="1,1,1",options="header"]
136+
|===
137+
| Option | Description | Default
138+
|--enable_pktdrop| enable packet drop | false
139+
|--enable_dns| enable DNS tracking | false
140+
|--enable_rtt| enable RTT tracking | false
141+
|--enable_network_events| enable Network events monitoring | false
142+
|--get-subnets| get subnets informations | false
143+
|--node-selector| capture on specific nodes | n/a
144+
|--enable_filter| enable flow filter | false
145+
|--direction| filter direction | n/a
146+
|--cidr| filter CIDR | 0.0.0.0/0
147+
|--protocol| filter protocol | n/a
148+
|--sport| filter source port | n/a
149+
|--dport| filter destination port | n/a
150+
|--port| filter port | n/a
151+
|--sport_range| filter source port range | n/a
152+
|--dport_range| filter destination port range | n/a
153+
|--port_range| filter port range | n/a
154+
|--sports| filter on either of two source ports | n/a
155+
|--dports| filter on either of two destination ports | n/a
156+
|--ports| filter on either of two ports | n/a
157+
|--tcp_flags| filter TCP flags | n/a
158+
|--action| filter action | Accept
159+
|--icmp_type| filter ICMP type | n/a
160+
|--icmp_code| filter ICMP code | n/a
161+
|--peer_ip| filter peer IP | n/a
162+
|--drops| filter flows with only dropped packets | false
163+
|--regexes| filter flows using regex | n/a
164+
|--interfaces| interfaces to monitor | n/a
165+
|===
166+
167+
.Example running metrics capture for TCP drops:
168+
[source,terminal]
169+
----
170+
$ oc netobserv metrics --enable_pktdrop=true --enable_filter=true --protocol=TCP
171+
----

0 commit comments

Comments
 (0)