Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 47 additions & 8 deletions modules/network-observability-netobserv-cli-reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
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.

[id="cli-syntax_{context}"]
== Syntax
The basic syntax for `oc netobserv` commands:
== Syntax
The basic syntax for `oc netobserv` commands:

.`oc netobserv` syntax
[source,terminal]
Expand Down Expand Up @@ -57,12 +57,14 @@ $ oc netobserv flows [<feature_option>] [<command_options>]
| Option | Description | Default
|--enable_all| enable all eBPF features | false
|--enable_dns| enable DNS tracking | false
|--enable_ipsec| enable IPsec tracking | false
|--enable_network_events| enable network events monitoring | false
|--enable_pkt_translation| enable packet translation | false
|--enable_pkt_drop| enable packet drop | false
|--enable_rtt| enable RTT tracking | false
|--enable_udn_mapping| enable User Defined Network mapping | false
|--get-subnets| get subnets information | false
|--sampling| value that determines the ratio of packets being sampled | 1
|--background| run in background | false
|--copy| copy the output files locally | prompt
|--log-level| components logs | info
Expand All @@ -84,12 +86,13 @@ $ oc netobserv flows [<feature_option>] [<command_options>]
|--port| filter port | –
|--ports| filter on either of two ports | –
|--protocol| filter protocol | –
|--regexes| filter flows using regular expression | –
|--query| filter flows using a custom query | –
|--sport_range| filter source port range | –
|--sport| filter source port | –
|--sports| filter on either of two source ports | –
|--tcp_flags| filter TCP flags | –
|--interfaces| interfaces to monitor | –
|--interfaces| list of interfaces to monitor, comma separated | –
|--exclude_interfaces| list of interfaces to exclude, comma separated | lo
|===

.Example running flows capture on TCP protocol and port 49051 with PacketDrop and RTT features enabled:
Expand Down Expand Up @@ -131,7 +134,7 @@ $ oc netobserv packets [<option>]
|--port| filter port | –
|--ports| filter on either of two ports | –
|--protocol| filter protocol | –
|--regexes| filter flows using regular expression | –
|--query| filter flows using a custom query | –
|--sport_range| filter source port range | –
|--sport| filter source port | –
|--sports| filter on either of two source ports | –
Expand All @@ -157,12 +160,14 @@ $ oc netobserv metrics [<option>]
| Option | Description | Default
|--enable_all| enable all eBPF features | false
|--enable_dns| enable DNS tracking | false
|--enable_ipsec| enable IPsec tracking | false
|--enable_network_events| enable network events monitoring | false
|--enable_pkt_translation| enable packet translation | false
|--enable_pkt_drop| enable packet drop | false
|--enable_rtt| enable RTT tracking | false
|--enable_udn_mapping| enable User Defined Network mapping | false
|--get-subnets| get subnets information | false
|--sampling| value that defines the ratio of packets being sampled | 1
|--action| filter action | Accept
|--cidr| filter CIDR | 0.0.0.0/0
|--direction| filter direction | –
Expand All @@ -179,16 +184,50 @@ $ oc netobserv metrics [<option>]
|--port| filter port | –
|--ports| filter on either of two ports | –
|--protocol| filter protocol | –
|--regexes| filter flows using regular expression | –
|--query| filter flows using a custom query | –
|--sport_range| filter source port range | –
|--sport| filter source port | –
|--sports| filter on either of two source ports | –
|--tcp_flags| filter TCP flags | –
|--interfaces| interfaces to monitor | –
|--include_list| list of metric names to generate, comma separated | namespace_flows_total,node_ingress_bytes_total,node_egress_bytes_total,workload_ingress_bytes_total
|--interfaces| list of interfaces to monitor, comma separated | –
|--exclude_interfaces| list of interfaces to exclude, comma separated | lo
|===

.Example running metrics capture for TCP drops
[source,terminal]
----
$ oc netobserv metrics --enable_pkt_drop --protocol=TCP
$ oc netobserv metrics --enable_pkt_drop --protocol=TCP
----

.Example running metrics capture for list of metric names to generate
[source,terminal]
----
$ oc netobserv metrics --include_list=node,workload
----

[source,terminal]
----
$ oc netobserv metrics --include_list=node_egress_bytes_total,workload_egress_packets_total
----

[source,terminal]
----
$ oc netobserv metrics --enable_all --include_list=node,namespace,workload
----

.Example output for list of metric names
[source, terminal]
----
opt: include_list, value: node,workload
Matching metrics:
- node_egress_bytes_total
- node_ingress_bytes_total
- workload_egress_bytes_total
- workload_ingress_bytes_total
- workload_egress_packets_total
- workload_ingress_packets_total
- workload_flows_total
- workload_drop_packets_total
- workload_drop_bytes_total
----