本节详细介绍了在控制器上通过脚本上载日志的步骤。

您可以在控制器上通过 attach2case.py 脚本上载日志。在运行脚本之前,请确保具备以下各项:

  • 用于 API 身份验证的每用户或每帐户令牌。

  • 控制器所属网络上的正向代理。

  • 超级用户对控制器的访问权限。

注:

Attach2case.py 脚本可在 /opt/avi/scripts 目录下找到。

CLI 格式如下所示。

User@Test-MacBook-Pro:~$ ssh [email protected]

Avi Cloud Controller

Avi Networks software, Copyright (C) 2013-2017 by Avi Networks, Inc.
All rights reserved. 

Version:      17.1.8
Date:         2017-09-21 06:03:07 UTC
Build:        9020
Management:   10.10.22.62/23                 UP 
Gateway:      10.10.22.1                     UP 

[email protected]'s password: 

The copyrights to certain works contained in this software are
owned by other third parties and used and distributed under
license. Certain components of this software are licensed under
the GNU General Public License (GPL) version 2.0 or the GNU
Lesser General Public License (LGPL) Version 2.1. A copy of each
such license is available at
http://www.opensource.org/licenses/gpl-2.0.php and
http://www.opensource.org/licenses/lgpl-2.1.php
Last login: Fri Oct  6 07:01:03 2017 from 10.10.221.61
admin@Test-Cntl:~$ 
admin@Test-Cntl:~$ cd /opt/avi/scripts
admin@Test-Cntl:/opt/avi/scripts$ pwd
/opt/avi/scripts
admin@Test-Cntl:/opt/avi/scripts$ ls -l attach2case.py 
rwxrwx-- 1 root root 14187 Sep 21 06:03 attach2case.py

root@Test-Cntl:/opt/avi/scripts# ./attach2case.py --help
usage: attach2case.py [-h] [-c CONFIG] [-d] [-H HOSTNAME] [-i]
[-p {http,https}] [-P] [-t TOKEN]
CASE-NUMBER FILE [FILE ...] 

Attaches files to a case on the Avi Networks portal.

positional arguments:
CASE-NUMBER           case number to attach files to
FILE                  files to attach to the case

optional arguments:
-h, --help            show this help message and exit
-c CONFIG, --config CONFIG
Path to configuration file (JSON) (default: None)
-d, --debug           Enable HTTP debug (default: False)
-H HOSTNAME, --hostname HOSTNAME
HTTP hostname (default: avinetworks.com)
-i, --insecure        Allow insecure SSL connections (default: False)
-p {http,https}, --protocol {http,https}
HTTP protocol (default: https)
-P, --progress        Display progress indicator (default: False)
-t TOKEN, --token TOKEN
API authentication token

可按以下方式执行脚本。

/opt/avi/scripts/attach2case.py -H avinetworks.com -t  -P -p https <case#>                       
</code></pre>

**Example**


admin@Test-Cntl:/opt/avi/scripts$ sudo su
[sudo] password for admin: 
root@Test-Cntl:/opt/avi/scripts# ls -ltrh /home/admin/test
total 5.4G
-rwxrwxrwx 1 admin admin 3.5G Oct  6 06:44 test.tar.gz
-rwxrwxrwx 1 admin admin 2.0G Oct  6 06:47 controller.pkg

root@Test-Cntl:/opt/avi/scripts# ./attach2case.py -H avinetworks.com -t  -P -p https 3763 /home/admin/test/controller.pkg 
100%
root@Test-Cntl:/opt/avi/scripts# ./attach2case.py -H avinetworks.com -t  -P -p https 3763 /home/admin/test/test.tar.gz
100% 
Attaches files to a case on the Avi Networks portal.  </code></pre>

## What Data Are Collected in Tech Support Logs

As the Avi Vantage system has evolved functionally over time, so too have the number of tech support log _types_ and the data captured in each. Ten tech support types appear below. The debuglogs type captures Controller-specific debugging data; all other types capture data associated with their self-explanatory name.


clustering

metricslogs

debuglogs

placement

portal

serviceengine

upgrade

virtualservice

gslb

pool



The logs collected through the shell command show tech-support debuglogs contains all the relevant Controller logs from the previous and current partition from all the nodes in the cluster; this command is a superset of other show tech-support [clustering, upgrade, placement, portal, metricslogs, gslb] commands.

The two exceptions are

1. show tech-support virtualservice </code> collects the additional show-command output listed below for a given virtual service, along with SE logs for SEs onto which the virtual service has been placed, and the Controller logs from all the nodes in the current partition. * show virtualservice * show virtualservice <key> * show virtualservice <key> detail * show virtualservice <key> tcpstat * show virtualservice <key> dnstable * show virtualservice <key> internal * show virtualservice <key> httpstats * show virtualservice <key> dosstat * show shardserver 2. show tech-support pool </code> collects the additional show-command output listed below for a given pool, along with SE logs for SEs onto which the virtual service has been placed, and the vs_mgr logs from all the Controller nodes in the current partition. * show pool * show pool <key> algo * show pool <key> connpool * show pool <key> connpool filter disable_aggregate se * show pool <key> debug - show pool <key> detail * show pool <key> detail filter disable_aggregate se * show pool <key> internal * show pool <key> internal filter disable_aggregate se * show pool <key> httpcache * show pool <key> httpcache filter disable_aggregate se * show pool <key> httpcachestats * show pool <key> httpcachestats filter disable_aggregate se * show pool <key> persistence * show pool <key> persistence filter disable_aggregate se * show pool <key> hmon * show pool <key> summary * show pool <key> vs * show pool <key> server detail * show pool <key> server detail filter disable_aggregate se * show pool <key> server summary * show pool <key> server internal * show pool <key> server internal filter disable_aggregate se * show pool <key> server hmonstat * show pool <key> server hmonstat filter disable_aggregate se If it is clear to the system administrator that a problem is associated with a particular virtual service, then capturing the virtualservice tech support log specific to that VS is best. Otherwise, the combination of debuglogs and serviceengine tech support logs is generally best.