]> git.puffer.fish Git - mirror/frr.git/commit
FRR: Python script to generate support bundle for FRR 3839/head
authorSri Mohana Singamsetty <msingamsetty@vmware.com>
Wed, 20 Feb 2019 19:56:22 +0000 (11:56 -0800)
committerSri Mohana Singamsetty <msingamsetty@vmware.com>
Wed, 20 Feb 2019 19:56:22 +0000 (11:56 -0800)
commite60eb780e48396088c58131ff0af7b828fa93baa
tree2031af33374e9badff70885384b104f78734df89
parentc06c9ded2114055fcba55ee1020d68121f0f1aad
FRR: Python script to generate support bundle for FRR

This has a python script that helps in collecting various CLI show command outputs in an automated way.

This commit has two files.

1.Text Configuration file: support_bundle_commands.conf - This file has list of CLI show commands to be executed. This file will be in tools/etc/frr/ directory. On executing command "sudo install -m 644 tools/etc/frr/ support_bundle_commands.conf /etc/frr/support_bundle_commands.conf", as part of FRR installation, this file will be copied into /etc/frr directory.

2.Python script file: generate_support_bundle.py - This file has the python code that has the below functionality.
  * It reads the support_bundle_commands.conf file. For each process present in the conf file, it creates a support_bundle file. For example, it creates bgp_support_bundle.log file for BGP and zebra_support_bundle.log file for Zebra. These files will be created in /var/log/frr/ directory. This is where regular FRR log files are also stored currently.
  * The script reads the CLI command specified between CLI_START and CLI_END key words for each process. It will execute the commands one by one.
  * For each such command, the script also appends the current time stamp at which the CLI command is executed.
  * In case of successful execution of the CLI command, it will copy the CLI output into the above support bundle file.
  * In case of CLI command failure, it will capture the error thrown and the error is also written into the same file.
  * A small snippet of the output file is as below.

  >>[2019-01-02 13:55:23.318987]show bgp summary

  IPv4 Unicast Summary:
  BGP router identifier 203.0.113.1, local AS number 65000 vrf-id 0
  BGP table version 4
  RIB entries 7, using 1176 bytes of memory
  Peers 1, using 21 KiB of memory
  Peer groups 1, using 64 bytes of memory

  Neighbor        V         AS MsgRcvd MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd
  203.0.113.2     4      65001      34      34        0    0    0 00:29:47            2

  Total number of neighbors 1
  >>[2019-01-02 13:55:23.619953]show ip bgp

  BGP table version is 4, local router ID is 203.0.113.1, vrf id 0
  Status codes:  s suppressed, d damped, h history, * valid, > best, = multipath,
                 i internal, r RIB-failure, S Stale, R Removed

Signed-off-by: Sri Mohana Singamsetty <msingamsetty@vmware.com>
tools/etc/frr/support_bundle_commands.conf [new file with mode: 0644]
tools/generate_support_bundle.py [new file with mode: 0644]