forked from netobserv/netobserv-cli
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgenerate-doc.sh
More file actions
executable file
·115 lines (104 loc) · 3.43 KB
/
generate-doc.sh
File metadata and controls
executable file
·115 lines (104 loc) · 3.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#!/usr/bin/env bash
ADOC=./docs/netobserv_cli.adoc
# Header
echo "// Automatically generated by '$0'. Do not edit, or make the NETOBSERV team aware of the editions.
:_mod-docs-content-type: REFERENCE
[id=\"network-observability-cli-usage_{context}\"]
= Network Observability CLI usage
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.
== Syntax
The basic syntax for \`oc netobserv\` commands:
.\`oc netobserv\` syntax
[source,terminal]
----
$ oc netobserv [<command>] [<feature_option>] [<command_options>] <1>
----
<1> Feature options can only be used with the \`oc netobserv flows\` command. They cannot be used with the \`oc netobserv packets\` command.
== Basic commands
[cols=\"3a,8a\",options=\"header\"]
.Basic commands
|===
| Command | Description
| flows
| Capture flows information. For subcommands, see the \"Flow capture subcommands\" table.
| packets
| Capture packets data. For subcommands, see the \"Packet capture subcommand\" table.
| cleanup
| Remove the Network Observability CLI components.
| version
| Print the software version.
| help
| Show help.
|===
" > $ADOC
# Flow table
{
echo "== Flows capture options
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.
.\`oc netobserv flows\` syntax
[source,terminal]
----
$ oc netobserv flows [<feature_option>] [<command_options>]
----
[cols=\"1,1,1\",options=\"header\"]
|===
| Option | Description | Default"
./build/oc-netobserv flows help
echo -e "|==="
# Flow example
echo "
.Example running flow capture on TCP protocol and port 49051 with PacketDrop and RTT features enabled:
[source,terminal]
----
$ oc netobserv flows --enable_pktdrop=true --enable_rtt=true --enable_filter=true --action=Accept --cidr=0.0.0.0/0 --protocol=TCP --port=49051
----"
# Packet table
echo "== Packets capture options
You can filter packet capture data as same as flow capture using the filters. However, the features are not available here.
.\`oc netobserv packets\` syntax
[source,terminal]
----
$ oc netobserv packets [<option>]
----
[cols=\"1,1,1\",options=\"header\"]
|===
| Option | Description | Default"
./build/oc-netobserv packets help
echo -e "|==="
# Packet example
echo "
.Example running packet capture on TCP protocol and port 49051:
[source,terminal]
----
$ oc netobserv packets --action=Accept --cidr=0.0.0.0/0 --protocol=TCP --port=49051
----"
# Metrics table
echo "== Metrics capture options
You can enable features and use filters on metrics capture as same as flow capture. The generated graphs will fill accordingly in the dashboard.
.\`oc netobserv metrics\` syntax
[source,terminal]
----
$ oc netobserv metrics [<option>]
----
[cols=\"1,1,1\",options=\"header\"]
|===
| Option | Description | Default"
./build/oc-netobserv metrics help
echo -e "|==="
# Metrics example
echo "
.Example running metrics capture for TCP drops:
[source,terminal]
----
$ oc netobserv metrics --enable_pktdrop=true --enable_filter=true --protocol=TCP
----"
} >> $ADOC
# remove double spaces
sed -i.bak "s/ */ /" $ADOC
# add table rows
sed -i.bak "/^ /s/ --*/|--/" $ADOC
# add table columns
sed -i.bak "/^|/s/(default:/|/" $ADOC
sed -i.bak "/^|/s/: /|/" $ADOC
sed -i.bak "/^|/s/)//" $ADOC
rm ./docs/*.bak