• 产品与解决方案
  • 行业解决方案
  • 服务
  • 支持
  • 合作伙伴
  • 新华三人才研学中心
  • 关于我们

11-网络管理和监控命令参考

目录

18-GOLD命令

本章节下载 18-GOLD命令  (229.99 KB)

docurl=/cn/Service/Document_Software/Document_Center/Switches/Catalog/S12500/S12500X-AF/Command/Command_Manual/H3C_S12500X-AF_CR(R3606)/11/202208/1677577_30005_0.htm

18-GOLD命令


1 GOLD

测试例的支持情况与设备的型号有关,请以设备的实际情况为准。GOLD配置命令举例中使用的测试例仅为示例,可在命令行中输入测试例名称位置输入“?”来获取设备支持的测试例的名称。

1.1  GOLD配置命令

1.1.1  diagnostic event-log size

diagnostic event-log size命令用来配置可存储的GOLD日志的最大条数。

undo diagnostic event-log size命令用来恢复缺省情况。

【命令】

diagnostic event-log size number

undo diagnostic event-log size

【缺省情况】

可存储的GOLD日志的最大条数为512条。

【视图】

系统视图

【缺省用户角色】

network-admin

【参数】

number:可存储的GOLD日志的最大条数,取值范围为0~1024。

【使用指导】

执行该命令时,如果指定的number值小于当前已存储的GOLD日志的条数,则系统会自动删除最旧的GOLD日志,直到当前GOLD日志的条数为number

当设备当前已存储的GOLD日志的条数达到最大值,同时还有新的GOLD日志需要存储时,系统会删除最旧的日志来存储新的日志。

【举例】

# 配置可存储的GOLD日志的最大条数为600条。

<Sysname> system-view

[Sysname] diagnostic event-log size 600

1.1.2  diagnostic monitor enable

diagnostic monitor enable命令用来开启监控诊断功能。

undo diagnostic monitor enable命令用来关闭监控诊断功能。

【命令】

diagnostic monitor enable slot slot-number-list [ test test-name ]

undo diagnostic monitor enable slot slot-number-list [ test test-name ]

【缺省情况】

不同监控诊断测试例的开启/关闭状态不同,请使用display diagnostic content命令查看。

【视图】

系统视图

【缺省用户角色】

network-admin

【参数】

slot slot-number-list:槽位号列表。表示方式为slot-number-list = { slot-number [ to slot-number ] }&<1-7>。其中,slot-number表示单板所在的槽位号,&<1-7>表示前面的参数最多可以输入7次。

test test-name:指定测试例的名称,区分大小写。具体取值可通过在test参数后输入问号来获取。不指定该参数时,表示所有监控诊断测试例。

【使用指导】

监控诊断是指系统在运行过程中按照一定的时间间隔定时执行测试例,来检测系统中的硬件故障并记录诊断结果。监控诊断只能执行非破坏性的测试例。

破坏性和非破坏性是测试例的一个属性,由开发人员在设计测试例的时候指定。其中:

·     破坏性测试例在执行过程中会对设备当前正常运行的业务产生影响或导致业务无法运行,如内存耗尽测试例。

·     非破坏性测试例在执行过程中不会对设备当前正常运行的业务产生影响。

对于缺省启动的监控诊断测试例,在设备启动后会自动执行;对于缺省关闭的监控诊断测试例,须使用本命令才能执行。

【举例】

# 使能指定slot上的测试例MonitorTest。

<Sysname> system-view

[Sysname] diagnostic monitor enable slot 1 test MonitorTest

【相关命令】

·     diagnostic monitor interval

1.1.3  diagnostic monitor interval

diagnostic monitor interval命令用来配置监控诊断测试例的执行时间间隔。

undo diagnostic monitor interval命令用来恢复缺省情况。

【命令】

diagnostic monitor interval slot slot-number-list [ test test-name ] time interval

undo diagnostic monitor interval slot slot-number-list [ test test-name ]

【缺省情况】

不同测试例的执行时间间隔不同,请使用display diagnostic content命令查看。

【视图】

系统视图

【缺省用户角色】

network-admin

【参数】

slot slot-number-list:槽位号列表。表示方式为slot-number-list = { slot-number [ to slot-number ] }&<1-7>。其中,slot-number表示单板所在的槽位号。&<1-7>表示前面的参数最多可以输入7次。

test test-name:指定测试例的名称,区分大小写。具体取值可通过在test参数后输入问号来获取。不指定该参数时,表示所有监控诊断测试例。

interval:监控诊断测试例的执行时间间隔,格式为hh:mm:ss(小时:分钟:秒)。其中hh取值范围为0~23,mm取值范围为0~59,ss取值范围为0~59。如果要设置成整分,则可以不输入秒;如果要设置成整时,则可以不输入分和秒。比如将interval参数设置为1表示执行时间间隔为1小时。

【使用指导】

使能监控诊断测试例后,测试例会按照一定的执行时间间隔周期执行,这个执行时间间隔可用该命令配置。

用户配置的执行时间间隔不能小于监控诊断测试例要求的最小值。监控诊断测试例要求的最小值可使用携带verbose参数的display diagnostic content命令查看。

【举例】

# 配置指定slot上测试例MonitorTest的执行时间间隔为1分钟。

<Sysname> system-view

[Sysname] diagnostic monitor interval slot 1 test MonitorTest time 00:01:00

【相关命令】

·     diagnostic monitor enable

display diagnostic content

1.1.4  diagnostic ondemand failure

diagnostic ondemand failure命令用来配置按需诊断测试例的累计失败执行次数的最大值。

undo diagnostic ondemand failure命令用来恢复缺省情况。

【命令】

diagnostic ondemand failure failure-number

undo diagnostic ondemand failure

【缺省情况】

不限制按需测试例的累计失败执行次数的最大值。

【视图】

用户视图

【缺省用户角色】

network-admin

【参数】

failure-number:失败的次数,取值范围为1~999。

【使用指导】

使用diagnostic ondemand start命令启动按需诊断测试例后,这些测试例什么时候终止执行,受三条命令的限制:

·     使用diagnostic ondemand stop命令可立即停止执行该测试例。

·     如果某测试例的执行次数达到diagnostic ondemand repeating命令中指定的值,则系统会自动停止执行该测试例。

·     如果某测试例的执行次数还未达到diagnostic ondemand repeating命令中指定的值,但是测试例在启动后,累计失败的执行次数已达到diagnostic ondemand failure命令中指定的值,则系统会自动停止执行该测试例。

本命令可用来修改将要启动的按需诊断测试例的累计失败执行次数的最大值,当前已启动的按需诊断测试例仍使用修改前的值。设备重启后,本命令会恢复到缺省情况,如仍需修改,请重新配置。

【举例】

# 配置按需诊断测试例的累计失败执行次数的最大值为5次。

<Sysname> diagnostic ondemand failure 5

【相关命令】

·     diagnostic ondemand repeating

·     diagnostic ondemand start

·     display diagnostic ondemand configuration

1.1.5  diagnostic ondemand repeating

diagnostic ondemand repeating命令用来配置按需诊断测试例重复执行的次数。

undo diagnostic ondemand repeating命令用来恢复缺省情况。

【命令】

diagnostic ondemand repeating repeating-number

undo diagnostic ondemand repeating

【缺省情况】

按需类型诊断测试例重复执行的次数为1次数,表示执行一次就结束。

【视图】

用户视图

【缺省用户角色】

network-admin

【参数】

repeating-number:表示按需诊断测试例重复执行的次数,取值范围为1~999。

【使用指导】

本命令用来修改将要启动的按需诊断测试例重复执行的次数,当前已启动的按需诊断测试例仍使用修改前的值。设备重启后,本命令会恢复到缺省情况,如仍需修改,请重新配置。

按需诊断测试例重复执行的次数不能小于diagnostic ondemand failure命令配置的失败次数,否则,命令执行失败。

【举例】

# 配置按需类型测试例重复执行的次数为2。

<Sysname> diagnostic ondemand repeating 2

【相关命令】

·     diagnostic ondemand failure

·     diagnostic ondemand start

·     display diagnostic configuration

1.1.6  diagnostic ondemand start

diagnostic ondemand start命令用来启动按需类型诊断。

【命令】

diagnostic ondemand start slot slot-number-list test { test-name | non-disruptive } [ para parameters ]

【缺省情况】

所有的按需类型测试例都需要用户手动启动。

【视图】

用户视图

【缺省用户角色】

network-admin

【参数】

slot slot-number-list:槽位号列表。表示方式为slot-number-list = { slot-number [ to slot-number ] }&<1-7>。其中,slot-number表示单板所在的槽位号。&<1-7>表示前面的参数最多可以输入7次。

non-disruptive:执行所有的非破坏性的测试例。

test-name:指定测试例的名称,区分大小写。具体取值可通过在test参数后输入问号来获取。

para parameters:扩展参数,暂时无意义。

【使用指导】

按需诊断是指在设备维护过程中,用户手工启动某些测试例对设备进行诊断。用于这种诊断的测试例称为按需诊断测试例。

用户可以通过命令行配置按需诊断测试例重复执行的次数以及累计失败执行次数的最大值。当用户开启某测试例后,测试例在执行过程中,只要达到上述任意条件,则立即自动停止执行。

【举例】

# 启动指定slot上破坏性按需诊断测试例OndemandTest。

<Sysname> diagnostic ondemand start slot 1 test OndemandTest

Running test OndemandTest on slot 1 may disrupt system operation. Continue? [Y/N]:y

# 在指定slot上启动所有非破坏性按需诊断测试例。

<Sysname> diagnostic ondemand start slot 1 test non-disruptive

【相关命令】

·     diagnostic ondemand failure

·     diagnostic ondemand repeating

1.1.7  diagnostic ondemand stop

diagnostic ondemand stop命令用来停止按需类型诊断。

【命令】

diagnostic ondemand stop slot slot-number-list test { test-name | non-disruptive }

【视图】

用户视图

【缺省用户角色】

network-admin

【参数】

slot slot-number-list:槽位号列表。表示方式为slot-number-list = { slot-number [ to slot-number ] }&<1-7>。其中,slot-number表示单板所在的槽位号。&<1-7>表示前面的参数最多可以输入7次。

test-name:指定测试例的名称,区分大小写。具体取值可通过在test参数后输入问号来获取。

non-disruptive:停止所有的非破坏性的测试例。

【使用指导】

用户可以通过命令行配置按需诊断测试例重复执行的次数以及累计失败执行次数的最大值。当用户开启某测试例后,测试例在执行过程中,只要达到上述任意条件,则立即自动停止执行。

用户还可以使用本命令手工停止按需类型诊断。

【举例】

# 手工停止指定slot上执行的所有非破坏性测试例。

<Sysname> diagnostic ondemand stop slot 1 test non-disruptive

【相关命令】

·     diagnostic ondemand failure

·     diagnostic ondemand repeating

1.1.8  diagnostic simulation

diagnostic simulation命令用来设置诊断的执行方式为模拟方式。

undo diagnostic simulation命令用来恢复缺省情况。

【命令】

diagnostic simulation slot slot-number-list test test-name { failure | random-failure | success }

undo diagnostic simulation slot slot-number-list test test-name

【缺省情况】

诊断为非模拟方式。即启动测试例后,系统会真正执行该测试例。

【视图】

用户视图

【缺省用户角色】

network-admin

【参数】

slot slot-number-list:槽位号列表。表示方式为slot-number-list = { slot-number [ to slot-number ] }&<1-7>。其中,slot-number表示单板所在的槽位号。&<1-7>表示前面的参数最多可以输入7次。

test-name:指定进行模拟诊断的测试例名称,区分大小写。具体取值可通过在test参数后输入问号来获取。

failure:假设模拟执行测试例失败,此时将输出测试失败的结果。

random-failure:表示随机选择模拟执行测试例的结果是成功还是失败。

success:假设模拟执行测试例成功,此时将输出测试成功的结果。

【使用指导】

配置该命令后,当测试例满足执行条件时,在执行测试例的时候就直接生成测试结果,并不真正执行测试例,也不会触发硬件纠正行为。该功能用于判断GOLD模块框架功能是否正常。

【举例】

# 配置指定slot上的MonitorTest模拟诊断失败。

<Sysname> diagnostic simulation slot 1 test MonitorTest failure

【相关命令】

·     display diagnostic simulation

1.1.9  diagnostic start test

diagnostic start test命令用来执行和脚本绑定的诊断。

【命令】

diagnostic start test test-name [ parameters ]

【视图】

用户视图

【缺省用户角色】

network-admin

【参数】

test-name:指定和脚本绑定的测试例的名称,为1~31个字符的字符串,不区分大小写。具体取值可通过执行diagnostic start test ?命令来获取。

parameters:输入测试例的执行参数。如需输入多个参数,则每个参数以空格分隔,参数值中不能包含反斜杠(\)、中文格式双引号(“”)、英文格式双引号("")和单引号(')。

【使用指导】

设备出厂时,会安装一些和脚本绑定的测试例。用户执行这样的测试例,系统会自动执行对应的脚本,目前支持Tcl脚本和Shell脚本,比如通过调用Tcl脚本来检测设备上电后芯片或端口的基本信息。执行一次命令,和脚本绑定的测试例就执行一次,检测结果会直接输出到命令行输入界面供用户查看。

【举例】

# 执行和脚本绑定的测试例ScriptTest。

<Sysname> diagnostic start test ScriptTest

This command requires null configuration and reboot device aferwards. Continue?

[Y/N]:y

=================================================

  ===============display clock===================

10:55:19 UTC Fri 06/27/2015

  ===============system-view=====================

System View: return to User View with Ctrl+Z.

  ===============undo stp enable=====================

  ===============probe-view=====================

  ===========undo monitor inner-channel=================

1.1.10  display diagnostic content

display diagnostic content命令用来显示测试例的内容。

【命令】

display diagnostic content [ slot slot-number ] [ verbose ]

【视图】

任意视图

【缺省用户角色】

network-admin

network-operator

【参数】

slot slot-number:表示单板所在的槽位号。不指定该参数时,表示所有单板。

verbose:显示测试例的详细信息;不指定该参数时,显示测试例的简要信息。

【举例】

# 显示指定slot上诊断测试例的简要信息。

<Sysname> display diagnostic content slot 1

Diagnostic test suite attributes:

#B/*: Bootup test/NA

#O/*: Ondemand test/NA

#M/*: Monitoring test/NA

#D/*: Disruptive test/Non-disruptive test

#P/*: Per port test/NA

#A/I/*: Monitoring test is active/Monitoring test is inactive/NA

 

Slot 1:

Name                            Attributes             Interval

MonitorTest                     **M*PA                 01:00:00

# 显示指定slot上诊断测试例的详细信息。

<Sysname> display diagnostic content slot 1 verbose

Diagnostic test suite attributes:

#B/*: Bootup test/NA

#O/*: Ondemand test/NA

#M/*: Monitoring test/NA

#D/*: Disruptive test/Non-disruptive test

#P/*: Per port test/NA

#A/I/*: Monitoring test is active/Monitoring test is inactive/NA

 

Slot 1:

Test name        : MonitorTest

Test attributes  : **M*PA

Test interval    : 01:00:00

Min interval     : 00:00:06

Correct-action   : -NA-

Description      : A Real-time test, enabled by default that checks board status

 between local master and other local boards.

Exec             : -NA-                                                        

表1-1 display diagnostic content命令显示信息描述表

字段

描述

B/*

(暂不支持)启动诊断测试例/非启动诊断测试例

O/*

按需诊断测试例/非按需诊断测试例

M/*

监控诊断测试例/非监控诊断测试例

D/*

破坏性测试例/非破坏性测试例

P/*

端口相关的测试例/不是端口相关的测试例

A/I/*

使能的监控诊断测试例/未使能的监控诊断测试例/非监控诊断测试例

Test name

测试例的名称

Test attributes

测试例的属性。从左到右依次为是否为启动诊断测试例,是否为按需诊断测试例,是否为监控诊断测试例,是否是破坏性测试例,是否是端口都相关的测试例,是否使能,对于不相关的属性用“*”表示

Test interval

执行监控测试例的执行时间间隔,没有执行时间间隔用“-NA-”表示

Min interval

执行监控测试例允许的最小执行时间间隔,没有最小执行时间间隔用“-NA-”表示

Correct-action

测试失败时的触发动作

Description

测试例的描述信息

Exec

测试例执行的脚本的路径。取值为“-NA-”时,表示测试例没有使用脚本

 

1.1.11  display diagnostic event-log

display diagnostic event-log命令用来显示GOLD日志的信息。

【命令】

display diagnostic event-log [ error | info ]

【视图】

任意视图

【缺省用户角色】

network-admin

network-operator

【参数】

error:显示所有错误相关的GOLD日志信息。

info显示所有非错误的GOLD日志信息

【使用指导】

不指定errorinfo参数时,显示所有GOLD日志的信息。

系统在执行完诊断测试例后,会产生GOLD日志用于记录测试例相关执行情况,日志内容包括测试例的名称、执行时间、执行结果、失败原因等信息。由于所有测试例在执行过程都会产生日志,因此GOLD日志会较多,为了不影响信息中心的性能,GOLD日志独立存储和显示,不会发往信息中心统一处理。

【举例】

# 显示所有GOLD日志的信息。

<Sysname> display diagnostic event-log

Event: E_INFO, Wed Jan  7 11:39:53:314 2014, -Slot=1 TestName->SystemMgmtBus, Event_INFO: Result->Success.

Event: E_ERROR, Wed Jan  7 11:39:53:314 2014, -Slot=1 TestName->SystemMgmtBus, Event_INFO: Result->Failure Reason->The port 9 is offline.

1.1.12  display diagnostic ondemand configuration

display diagnostic ondemand configuration命令用来显示按需诊断的配置信息。

【命令】

display diagnostic ondemand configuration

【视图】

任意视图

【缺省用户角色】

network-admin

network-operator

【举例】

# 配置了重复执行次数与失败次数,显示按需诊断配置信息。

<Sysname> display diagnostic ondemand configuration

Maximum test-repeating times: 4

Maximum test-failure times: 1

【相关命令】

·     diagnostic ondemand failure

·     diagnostic ondemand repeating

1.1.13  display diagnostic result

display diagnostic result命令用来显示测试例的执行结果。

【命令】

display diagnostic result [ slot slot-number [ test test-name ] ] [ verbose ]

【视图】

任意视图

【缺省用户角色】

network-admin

network-operator

【参数】

slot slot-number:表示单板所在的槽位号。不指定该参数时,表示所有单板。

test test-name:指定测试例的名称,区分大小写。具体取值可通过在test参数后输入问号来获取。不指定该参数时,表示所有测试例。

verbose:显示当前处于使能状态的测试例或者累计执行次数大于0的测试例执行结果的详细信息,不包括统计信息。不指定该参数时,只显示累计执行次数大于0的测试例执行结果的简要信息。

【举例】

# 显示指定slot上所有测试例的简要诊断结果。

<Sysname> display diagnostic result slot 1

Slot 1:

  Name                            Run count    Failure count    Last result

  MonitorTest                     386          0                Success

# 显示所有测试例的详细诊断结果

<Sysname> display diagnostic result verbose

Slot 1:

  Test name                : MonitorTest

  Total run count          : 386

  Total failure count      : 0

  Consecutive failure count: 0

  Last execution time      : Fri Nov 21 23:00:01 2014

  First failure time       : -NA-

  Last failure time        : -NA-

  Last pass time           : Fri Nov 21 23:00:01 2014

  Last execution result    : Success

  Last failure reason      : -NA-

  Next execution time      : Sat Nov 22 00:00:07 2014

  Slot  check status : Normal                                                  

表1-2 display diagnostic result命令显示信息描述表

字段

描述

Test name

测试例的名称

Total run count

诊断执行的总次数

Total failure count

诊断失败的总次数

Consecutive failure count

连续执行测试例失败的次数

Last execution time

最近一次测试执行的时间

First failure time

第一次诊断失败的时间。如果没有失败的测试例,此字段内容为-NA-

Last failure time

最近一次诊断失败的时间。如果没有失败的测试例,此字段内容为-NA-

Last pass time

最近一次诊断成功的时间。如果没有成功的测试例,此字段内容为-NA-

Last execution result

最近一次诊断结果

Last failure reason

最近一次诊断失败的原因。当用户配置模拟失败时,此字段内容即为Simulated Test;当诊断未失败时,此字段内容即为-NA-

Next execution time

下次诊断执行的时间。如果是监控诊断类型的测试例,下次执行时间为最后一次测试执行时间加上测试例的执行时间间隔;如果是按需诊断类型的测试例,则此字段的内容为-NA-

 

1.1.14  display diagnostic result statistics

display diagnostic result statistics命令用来显示与报文相关的测试例的统计信息。

【命令】

display diagnostic result [ slot slot-number [ test test-name ] ] statistics

【视图】

任意视图

【缺省用户角色】

network-admin

network-operator

【参数】

slot slot-number:表示单板所在的槽位号。不指定该参数时,表示所有单板。

test test-name:指定测试例的名称,区分大小写。具体取值可通过在test参数后输入问号来获取。不指定该参数时,表示所有测试例。

【举例】

# 显示指定slot上MonitorTest执行后的统计结果。

<Sysname> display diagnostic result slot 1 test MonitorTest statistics

Slot 1:

  Test name: MonitorTest

  Port    Packets sent    Packets received   Packets lost

  1       0               0                  0

  2       0               0                  0

  3       0               0                  0

  4       4               4                  0

  5       4               4                  0

  6       4               4                  0

  7       4               4                  0

  8       0               0                  0

表1-3 display diagnostic result statistics命令显示信息描述表

字段

描述

Test name

测试例的名称

Port

端口号

Packets sent

已发送数据包

Packets received

已接收数据包

Packets lost

丢失的数据包

 

1.1.15  display diagnostic simulation

display diagnostic simulation命令用来显示模拟诊断的配置信息。

【命令】

display diagnostic simulation [ slot slot-number ]

【视图】

任意视图

【缺省用户角色】

network-admin

network-operator

【参数】

slot slot-number:表示单板所在的槽位号。不指定该参数时,表示所有单板。

【举例】

# 显示指定slot上模拟诊断配置信息。

<Sysname> display diagnostic simulation slot 1

Slot 1:

  Name                            Mode

  MonitorTest                     failure

【相关命令】

·     diagnostic simulation

1.1.16  reset diagnostic event-log

reset diagnostic event-log命令用来清除GOLD日志。

【命令】

reset diagnostic event-log

【视图】

用户视图

【缺省用户角色】

network-admin

【举例】

# 清除GOLD日志。

<Sysname> reset diagnostic event-log

【相关命令】

·     display diagnostic event-log

1.1.17  reset diagnostic result

reset diagnostic result命令用来清除诊断测试结果。

【命令】

reset diagnostic result [ slot slot-number [ test test-name ] ]

【视图】

用户视图

【缺省用户角色】

network-admin

【参数】

slot slot-number:表示单板所在的槽位号。不指定该参数时,表示所有单板。

test test-name:指定测试例的名称,区分大小写。具体取值可通过在test参数后输入问号来获取。不指定该参数时,表示所有测试例。

【使用指导】

本命令清除测试结果时,不会清除下次诊断执行时间。

【举例】

# 清除指定slot上MonitorTest的测试结果。

<Sysname> reset diagnostic result slot 1 test MonitorTest

【相关命令】

·     display diagnostic result

 

不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!

新华三官网
联系我们