Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagetext
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 athe cluster.
   # REST API user name is 'onos' and password is 'rules' and store them in JSON files.
   # JSON_CLI_COMMANDS below lists JSON-supported diagnostics commands.
   # 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 onos-diagnostics -j
   # 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 The tools needs to know the IP addresses of those machinesnames of the pods. To avoid having to specify these IP addresses names as part of the command, you can export the ONOS_INSTANCESPODS environment variable to specify the addresses names as a space-separated list. Here’s an example of how to set the variable:

Code Block
languagetext
$ export ONOS_INSTANCESPODS="10.192.19.111 10.192.19.112 10.192.19.113onos-0 onos-1 onos-2"

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 followsneeds to know the Karaf home (path from the mount point). To avoid having to specify this path as part of the command, you can export the KARAF_HOME environment variable:

Code Block
languagetext
$ onos-diagnostics export KARAF_HOME="apache-karaf-4.2.8"

Once enabled, the onos-diagnostics-k8s tool can be run as follows:There is an option that allows for naming the resulting archive file for differentiation between different cluster instances, e.g.

Code Block
languagetext
# 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:

$ onos-diagnostics-k8s

The following is the usage help for the onos-diagnostics tool:

Code Block
languagetext
usage: onos-diagnostics-k8s [-x] [-j] [-n name] [-k karaf_home] [pod1 pod2...]
Environment Variables:
    DIAGS_PROFILE     Profile to be used to collect diags.
                      Availables profiles in onos-diagnostics-profile
    KARAF_HOME        KARAF_HOME inside the ONOS pod (path from the mount point)
    ONOS_PODS         ONOS pods composing the cluster
Example Usages:
    # Collect compressed diagnostics for the cluster.
    # Karaf home is drawn from environment variable.
    # Collection archive will be named /tmp/onos-diags.tar.gz
    # ONOS pods names will be drawn from ONOS_PODS variable.
    # Diags profile is drawn from environment variable.
    $ onos-diagnostics-k8s 
 
Code Block
languagetext
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 passwordleave arethem drawn from environment variables.
extracted. 
    # Collection archivedirectory will be named /tmp/onosprague-diags.tar.gz/
    # The cluster node IPsCollection archive will be drawn from ONOS_INSTANCES variablenamed /tmp/prague-diags.tar.gz.
    # DiagsKaraf profilehome is drawn from environment variable'/root/foo/karaf'.
   $ onos-diagnostics
# ONOS pods #names Collectwill diagnosticsbe fordrawn the cluster and leave them extractedfrom ONOS_PODS variable.
   # Collection directory will be named /tmp/prague-diags/
$ onos-diagnostics-k8s -x -n prague -k karaf
    # Collect diagnostics Collectionfor archivethe willcluster beand named /tmp/prague-diags.tar.gz.
   # REST API user name is 'onos' and password is 'rules'.
store them in JSON files.
    # JSON_CLI_COMMANDS below lists JSON-supported diagnostics commands.
    # The cluster node IPsCollection archive will be drawn from ONOS_INSTANCES variable.
named /tmp/onos-diags.tar.gz
    $ onos-diagnostics -xk8s -n prague -u onos -p rules
j
    # Collect compressed diagnostics for a cluster.
    # RESTKaraf API userhome name is 'onos' and password is 'rules'karaf'.
    # Collection archive will be named /tmp/onos-diags.tar.gz
    # The clusterpods node IPsnames are listed explicitly.
    $ onos-diagnostics-k8s -uk karaf onos -p rules 172.17.0.11 172.17.0.12 172.17.0.1 onos-1 onos-2

onos-log-query

Since ONOS Apache Karaf log can be spread across multiple files, i.e. karaf.log, karaf.log.1, karaf.log.3, etc. and since each ONOS cluster node has its own set of such logs, it can be cumbersome to find relevant information in the logs purely manual means. The onos-log-query tool has been provided to make log stitching, filtering and collating much easier. The tool can operate on standalong log files, but it works well with information collected via the onos-diagnostics tool.

...