...
Code Block | ||
---|---|---|
| ||
# This will produce archive file /tmp/delta-pod-diags.tar.gz $ onos-diagnostics -n delta-pod |
By default onos-diagnostics will use ONOS_PROFILE to collect the diags. We use the profiles to customize the behavior of the tool.
The resulting The resuling /tmp/*-diags.tar.gz file will contain all relevant information about the ONOS cluster.
The following is the usage help for the onos-diagnostics tool:
Code Block | ||
---|---|---|
| ||
usage: onos-diagnostics [-x] [-n name] [-u user] [-p password] [ip1 ip2...]
Environment Variables:
DIAGS_PROFILE Profile to be used to collect diags.
Availables profiles in onos-diagnostics-profile
ONOS_INSTANCES IPs or hostnames of ONOS cluster machines
ONOS_WEB_USER username for REST API
ONOS_WEB_PASS password for REST API
Example Usages:
# Collect compressed diagnostics for the cluster.
# REST API user and password are drawn from environment variables.
# Collection archive will be named /tmp/onos-diags.tar.gz
# The cluster node IPs will be drawn from ONOS_INSTANCES variable.
# Diags profile is drawn from environment variable.
$ onos-diagnostics
# Collect diagnostics for the cluster and leave them extracted.
# Collection directory will be named /tmp/prague-diags/
# Collection archive will be named /tmp/prague-diags.tar.gz.
# REST API user name is 'onos' and password is 'rules'.
# The cluster node IPs will be drawn from ONOS_INSTANCES variable.
$ onos-diagnostics -x -n prague -u onos -p rules
# Collect compressed diagnostics for a cluster.
# REST API user name is 'onos' and password is 'rules'.
# Collection archive will be named /tmp/onos-diags.tar.gz
# The cluster node IPs are listed explicitly.
$ onos-diagnostics -u onos -p rules 172.17.0.11 172.17.0.12 172.17.0.1 |
onos-diagnostics-k8s
Alternatively, it is possible to use onos-diagnostics-k8s in Kubernetes enabled environments. The tool will produce the same results of onos-diagnostics and relies only on kubectl commands.
Since the tools contacts all ONOS node cluster instances, it needs to know the IP addresses of those machines. To avoid having to specify these IP addresses as part of the command, you can export the ONOS_INSTANCES environment variable to specify the addresses as a space-separated list. Here’s an example of how to set the variable:
Code Block | ||
---|---|---|
| ||
$ export ONOS_INSTANCES="10.192.19.111 10.192.19.112 10.192.19.113" |
The tool also accesses the ONOS REST API to collect logs and for this it requires the REST API username and password credentials. These credentials can be provided either via ONOS_WEB_USER and ONOS_WEB_PASSWD environment variables or via command options (see usage below)
Once enabled, the onos-diagnostics tool can be run as follows:
Code Block | ||
---|---|---|
| ||
$ onos-diagnostics |
There is an option that allows for naming the resulting archive file for differentiation between different cluster instances, e.g.
Code Block | ||
---|---|---|
| ||
# This will produce archive file /tmp/delta-pod-diags.tar.gz
$ onos-diagnostics -n delta-pod |
By default onos-diagnostics will use ONOS_PROFILE to collect the diags. We use the profiles to customize the behavior of the tool.
The resulting /tmp/*-diags.tar.gz file will contain all relevant information about the ONOS cluster.
The following is the usage help for the onos-diagnostics tool:
Code Block | ||
---|---|---|
| ||
usage: onos-diagnostics [-x] [-n name] [-u user] [-p password] [ip1 ip2...] Environment Variables: DIAGS_PROFILE Profile to be used to collect diags. Availables profiles in onos-diagnostics-profileusage: onos-diagnostics [-x] [-n name] [-u user] [-p password] [ip1 ip2...] Environment Variables: ONOS_INSTANCES IPs or hostnames of ONOS cluster machines ONOS_WEB_USER username for REST API ONOS_WEB_PASS password for REST API Example Usages: # Collect compressed diagnostics for the cluster. # REST API user and password are drawn from environment variables. # Collection archive will be named /tmp/onos-diags.tar.gz # The cluster node IPs will be drawn from ONOS_INSTANCES variable. # Diags profile is drawn from environment variable. $ onos-diagnostics # Collect diagnostics for the cluster and leave them extracted. # Collection directory will be named /tmp/prague-diags/ # Collection archive will be named /tmp/prague-diags.tar.gz. # REST API user name is 'onos' and password is 'rules'. # The cluster node IPs will be drawn from ONOS_INSTANCES variable. $ onos-diagnostics -x -n prague -u onos -p rules # Collect compressed diagnostics for a cluster. # REST API user name is 'onos' and password is 'rules'. # Collection archive will be named /tmp/onos-diags.tar.gz # The cluster node IPs are listed explicitly. $ onos-diagnostics -u onos -p rules 172.17.0.11 172.17.0.12 172.17.0.1 |
...