Maintenance CLI Tool (mdbctl)
更新时间: 2025/10/30
在Gitcode上查看源码

高级命令参考

前言

概述

本文主要描述高级用户、开发及生产人员使用的命令参数说明。

说明

本资料中涉及的命令,是高级用户、研发人员或生产人员使用的,应避免非专业人员执行此资料中的命令,否则由使用人承担相关责任。

1 mdbctl 调试命令

调测命令由维护人员在现场使用mdbctl进行问题定位时使用,该调试命令只允许具有调试诊断权限的用户执行。

1.1 进入调试界面

命令功能

进入调试命令界面。

命令格式

mdbctl

参数说明

使用实例

shell
#进入调试模式界面。
**********************************************************************

                             Debug Shell

                          Copyright(C) 2023

**********************************************************************

%

1.2 帮助命令

命令功能

获取帮助信息。

命令格式

help

参数说明

使用实例

shell
# 已进入调试模式界面。
% help
Usage: help
Get all command help information.

Usage: bye
Quit micro component command line interface.

Usage: lsmc
List all micro component names.

Usage: lsclass [module name]
List all class name of this board or specified module.

Usage: lsobj <class name>
List all objects of specified class.

Usage: lsprop <object name> [interface name]
List all props of specified object.

Usage: getprop <object name> <interface name> <property name>
Get property value of specified object.

Usage: attach <module name>
Attach certain module to debug.

%
shell
# 已进入调试模式界面且连接模块。

% help
Usage: help
Get all command help information.

Usage: bye
Quit micro component command line interface.

Usage: lsmc
List all micro component names.

Usage: Isclass [module name]
List all class name of this board or specified module.

Usage: lsobj <class name>
List all objects of specified class.

Usage: lsprop <object name> [interface name]
List all props of specified object.

Usage: getprop <object name> <interface name> <property name>
Get property value of specified object.

Usage: attach <module name>
Attach certain module to debug.

Usage: lscmd
List all debug commands of attached module.

Usage: dloglevel [level] [effective hours]
Query or set debug log output level [debug, info, notice, warning, error]. effective hours: [1-24].

Usage: dlogtype [type]
Query or set debug log output type [file, local].

%

1.3 退出命令

命令功能

退出调试界面。

命令格式

bye

参数说明

使用实例

shell
# 已进入调试模式界面。
% bye
Byebye. See you next time.

1.4列举模块命令

命令功能

列举当前的功能模块。

命令格式

lsmc

参数说明

使用实例

shell
#已进入调试模式界面。
% lsmc
aiengine bios bmc_health bmc_network bmc_soc bmc_time bmc_upgrade chassis compute cooling ddns event event_policy fault_diagnosis file_transfer firmware_mgmt fructrl frudata general_hardware host_agent hwdiscovery hwproxy iam ipmi_core key_mgmt license manufacture mctpd metric_analyzer network_adapter nsm oms pcie_device persistence power_mgmt power_strategy product_mgmt redfish remote_console rmcpd sensor soctrl ssdp storage thermal_mgmt trust usb_entry web_backend

%

1.5 连接模块命令

命令功能

连接到指定模块,方便进行后续操作。

命令格式

attach <module name>

参数说明

参数参数说明
module name当前运行的功能模块名称,可以使用lsmc命令获取模块名。

使用实例

shell
#已进入调试模式界面。
% attach hwdiscovery
Success.

%

1.6 列举类命令

命令功能

列举当前所有的类,或指定模块的类。

命令格式

lsclass [module name]

参数说明

参数参数说明
module name当前运行的功能模块名称,可以使用lsmc命令获取模块名。可选参数。

使用实例

shell
#已进入调试模式界面。
% lsclass
Accessor AccountService Authentication Authorization BMC Bios BoardNICCard BoardRAS BootError BusinessConnector CPU CPUMetrics CPURAS CertificateAuthentication CertificateLocation CertificateService Chassis Chip Component ComputerSystem Connector CoolingArea CoolingFan CoolingRequirement Cpld CpuBoard DFT DataAcquisitionService Dft12V0Vlot Dft3V3Vlot Dft5V0Vlot DftBmcCard DftButtonCell DftCD DftCardPresence DftChassisCover DftCpld DftDdr3 DftEeprom DftEepromWp DftEth DftFlash DftIOTest DftIpmb DftTAG DftKeyBoard DftLedIntelligence DftLedTube DftLedTubeIntelligence DftLm75 DftLpc DftNCSI DftNandFlash DftNewVideo DftPmu DftPowerButton DftPowerSupply DftPhysicalLed DftSPI DftUidButton DftUSB DiscreteEvent DiscreteSensor Drive Eeprom Entity Event Events ExpBoard FDMDomain FDMService FanFanBoard FanType FaultPrediction FirmwareInventory Fru FruCtrl FruData HddBackplane Hisport I2c I2cMux IpmiCore Kerberos Key KeyService Keys LDAP Led LicenseService Lm75 ManagerAccounts ManagerVersion Memory MemoryChannel MemoryMetrics MemoryRAS Mock NCSICapabilities NandFlash NandFlashMock NetworkAdapter NetworkPort ObjectGroup OnePower PCIeDevice Pca9545 PCIeAddrInfo Pmu RMCPCipherSuites Redfish RemoteGroups RestrictedPrivileges SDRDevice SOC SOL SP Scanner SecureBootOptions Sender SerialManagement Sessions Smc Sms Smtp Snmp StorageConfig SystemLockDown Temperature ThresholdSensor Time Tracelpmi UartData Ums UpdateService UsbLocalOMService VrdMgmt Watchdog2

% lssclass hwproxy
Accessor Chip Cpld DftLm75 Eeprom Hisport I2c I2cMux Lm75 Mock Pca9545 Scanner Smc

% lssclass hwdiscovery
Connector ObjectGroup

%

1.7 列举类的所有对象命令

命令功能

列举类的所有对象。

命令格式

lsobj <class name>

参数说明

参数参数说明
class name类名称。

使用实例

shell
#已进入调试模式界面。
% lsobj Connector
Connector_BCU_1_0101
Connector_CLU_1_0101
Connector_EXU_1_01
Connector_IEU_1_010101
Connector_IEU_2_010101
Connector_IEU_3_010101
Connector_LOM_1_0101
Connector_LOM_2_0101
Connector_OCP_1_0101
Connector_OCP_2_0101
Connector_PSR_1_0101
Connector_PowerSupply_1_0101
Connector_PowerSupply_2_0101
Connector_SEU_1_0101
Connector_SEU_2_0101  
Connector_Sensor_01  
Connector-TrustedModule_010101  

%

1.8 列举对象的所有属性命令

命令功能

列举对象的所有属性。

命令格式

lsprop <object name> [interface name]

参数说明

参数参数说明
object name对象名称。
interface name接口名称。可选参数。

使用实例

shell
#已进入调试模式界面。
% lsprop Connector_BCU_1_0101
bmc.kepler.Connector
 AuxId=""
 Bom="14100513"
 Buses=["I2c_1","I2c_2","I2c_8","JtagOverLocalBus_1","Hisport_0","Hisport_5","Hisport_6","Hisport_7"]
 ChassisId=""
 GroupId=16
 GroupPosition="010101"
 Id="00000001020302024339"
 IdentifyMode=3
 LoadStatus=0
 ManagerId="1"
 Presence=1
 SilkText="BCU"
 Slot=1
 SystemId=1
 Type="CPUBoard"
bmc.kepler.Object.Properties
 ClassName="Connector"
 ObjectIdentifier=[1,"1","","0101"]
 ObjectName="Connector_BCU_1_0101"

% lsprop Connector_BCU_1_0101 bmc.kepler.Connector
bmc.kepler.Connector
 AuxId=""
 Bom="14100513"
 Buses=["I2c_1","I2c_2","I2c_8","JtagOverLocalBus_1","Hisport_0","Hisport_5","Hisport_6","Hisport_7"]
 ChassisId=""
 GroupId=16
 GroupPosition="010101"
 Id="00000001020302024339"
 IdentifyMode=3
 LoadStatus=0
 ManagerId="1"
 Presence=1
 SilkText="BCU"
 Slot=1
 SystemId=1
 Type="CPUBoard"

%

1.9 获取属性值命令

命令功能

获取指定对象的指定属性值。

命令格式

getprop <object name> <interface name> <property name>

参数说明

参数参数说明
object name对象名称。
interface name接口名称。
property name属性名称。

使用实例

shell
#已进入调试模式界面。
% getprop Connector_BCU_1_0101 bmc.KeplerConnector Buses
["l2c_1","l2c_2","l2c_8","JtagOverLocalBus_1","Hisport_0","Hisport_5","Hisport_6","Hisport_7"]

% getprop Connector_BCU_1_0101 bmc.KeplerConnector Id
"00000001020302024339"
%

1.10 列举调试方法命令

命令功能

列举指定连接模块的调试方法。

命令格式

lscmd

参数说明

使用实例

shell
#已进入调试模式界面且连接指定模块。

% attach maca
Success

% lscmd
Usage: setmonitorstatus <Type> <Enabled>
Enable or disable a specified check mechanism, including component startup status check, component running status check, and component online status check.
Type s Type of the enabled check mechanism. The values can be starting (starting status check), running (running status check), and online (component online status check).
Enabled b Enable or disable the check mechanism.

Usage: dloglimit <Enabled> [DurationMins]
Set the log flow control status.
Enabled b The value true indicates that the log flow control function is enabled, and the value false indicates that the log flow control function is disabled.
DurationMins u Set the validity period of the log flow control status. The value ranges from 1 to 720, in minutes. 10

%

1.11 查询和设置组件的调试日志级别命令

命令功能

查询和设置组件的调试日志级别。

命令格式

dloglevel [level] [effective hours]

参数说明

参数参数说明取值
level日志级别。可选参数。debug, info, notice, warning, error
effective hours生效时长,单位为小时,默认为1。可选参数。1-24

使用实例

shell
#已进入调试模式界面且连接指定模块。
% attach hwdiscovery
Success.

% dloglevel
"notice'

% dloglevel info 2

% dloglevel
"info"

1.12 查询和设置组件的调试日志输出类型命令

命令功能

查询和设置组件的调试日志输出类型

命令格式

dlogtype [type]

参数说明

参数参数说明取值
type日志输出类型。可选参数file, local
取值为file时组件调试日志输出到文件
取值为local时组件调试日志输出到mdbctl终端

使用实例

shell
#已进入调试模式界面且连接指定模块。
% attach maca
Success.

%  dlogtype
"file"

% dlogtype local
Success.

% dlogtype
"local"

1.13 追踪指定通道 IPMI 消息命令

命令功能

追踪指定通道IPMI消息

命令格式

traceipmi <operation type> <log type><channel> [netfn] [cmd]

参数说明

参数参数说明取值
operation type操作类型。start, stop
取值为start时启动ipmi命令跟踪功能
取值为stop时停止ipmi命令跟踪功能
log type日志输出类型。file
取值为file时IPMI追踪消息记录到文件
channel通道类型bt, ipmb, edma, ipmbeth
netfn网络功能码,可选参数0x00-0xff,默认值0xff
cmd命令号,可选参数0x00-0xff,默认值0xff

使用实例

shell
#已进入调试模式界面。
% traceipmi start file bt
Success.

% traceipmi stop file bt
Success.

1.14 设置组件的日志限流状态命令

命令功能

设置指定组件的日志限流状态

命令格式

dloglimit <Enabled> [DurationMins]

参数说明

参数参数说明取值
Enabled操作类型。true,false
取值为true时设置日志限流状态为开启
取值为false时设置日志限流状态为关闭
DurationMins设置日志限流状态生效时长,可选参数[1 - 720] min
取值单位为分钟,范围为1-720,默认值10

使用实例

shell
#已进入调试模式界面并连接目标模块。
% attach maca  
Success.

% dlogimit false 10

% dloglimit true

%

1.15 追踪器件读写数据命令

命令功能

追踪指定器件的读写数据

命令格式

tracechip <ObjectName> <Action>

参数说明

参数参数说明取值
ObjectName跟踪器件对象名称hwproxy资源树器件对象名称,包含ads78、canbuschip、chip、cpld、cpldregister、EEPROM、jtag、lm75、pca9544、pca9545、pca9555、smc、vrd
Action操作类型取值为start时开始追踪器件读写数据
取值为stop时停止追踪器件读写数据

使用实例

shell
#已进入调试模式界面并连接硬件代理模块。
% attach hwproxy
Success.

% tracechip Lm75_1_010105 start

% 2001-05-18 10:50:31.620996, Scanner_NicLm75_010105, block_read, Lm75_1_010105, addr: 144, offset: 0, read_length: 2, read_result: 24 70  

% tracechip Lm75_1_010105 stop

%

1.16 设置微组件检查机制状态命令

命令功能

开启或关闭指定的检查机制的命令,包括组件启动状态检查、组件运行状态检查、组件在线状态检查

命令格式

setmonitorstatus <Type> <Enabled>

参数说明

参数参数说明取值
Type使能的检查机制类型starting, running, online
表示使能的检查机制类型,参数选择包括:starting(启动状态检查), running(运行状态检查), online(组件在线状态检查)
Enabled开启或关闭检查机制的开关true, false
true表示开启,false表示关闭

使用实例

shell
#已进入调试模式界面并连接微组件管理模块。
% attach maca
Success.

% setmonitorstatus starting true  
0  

% setmonitorstatus starting false  
0  

%

1.17 redfish 统计资源协作接口属性变更次数 TOPn 系列命令

1.17.1 查询使能状态命令

命令功能

打印当前redfish统计的资源协作接口属性变更次数TOPn功能的使能状态,返回值是true(or false)

命令格式

pcgetstatus

参数说明

使用实例

shell
#已进入调试模式界面并连接redfish组件模块。

% attach redfish
Success

% pcgetstatus
false

%

1.17.2 设置使能状态命令

命令功能

设置当前redfish资源协作接口属性变更统计TOPn功能的使能状态

命令格式

pcsetstatus <Status>

参数说明

参数参数说明取值
Status设置的使能状态true,false
true表示开启,false表示关闭

使用实例

shell
#已进入调试模式界面并连接redfish组件模块。
% attach redfish
Success

% pcsetstatus true

%

1.17.3 查询TOPn统计数据命令

命令功能

打印当前redfish统计到的资源协作接口属性变更次数TOPn的数据

命令格式

pcgetreport

参数说明

使用实例

shell
#已进入调试模式界面并连接redfish组件模块。
% attach redfish   
Success   

% pcsetstatus true   

% pcgetstatus   
true   

% pcgetreport   
{
 "now_period_time": "10:00 - 10:01",
 "now_period_top5": [
 "path, interface, property, count"
 ],
 "pre_period_time": "09:58 - 09:59",
 "pre_period_top5": [
 "path, interface, property, count"
 ]
}

%

1.18 查询生效调速因子命令

命令功能

获取指定散热器件和模式生效的调速因子

命令格式

getactivatedpolicy <Type> <Mode>

参数说明

参数参数说明取值
Type散热器件类型Fan
Mode散热生效模式0,1
0表示生效因子,1表示生效算法

使用实例

shell
# 已进入调试模式界面并连接thermal_mgmt组件模式
% attach thermal_mgmt
Success

# 1. 查询风扇类型的生效因子
% getactivatedpolicy Fan 0
"Inlet_Temp"

# 2. 查询风扇类型的生效算法
% getactivatedpolicy Fan 1
"MPC"

1.19 查询电源信息命令

1.19.1 查询电源风扇转速

命令功能

查询电源风扇转速

命令格式

getpsufanspeed <ObjectName>

参数说明

参数参数说明取值
ObjectName电源对象名称通过lsobj OnePower对象获取

使用实例

shell
#已进入调试模式界面并连接power_mgmt组件模式。
% attach power_mgmt
Success

% lsobj OnePower   
OnePower_0_010109   
OnePower_0_01010B  

% getpsufanspeed OnePower_0_01010B   
6419   

%

1.19.2 查询电源寄存器信息

命令功能

查询pmbus协议的电源寄存器信息

命令格式

getpsureg <ObjectName> <Cmd> <Length>

参数说明

参数参数说明取值
ObjectName电源对象名称通过lsobj OnePower对象获取
Cmd电源寄存器地址pmbus协议支持的寄存器地址
Length读取长度大于0

使用实例

shell
#已进入调试模式界面并连接power_mgmt组件模式。
% attach power_mgmt  
Success  

% lobj OnePower  
OnePower_0_010109  
OnePower_0_01010B  

% getpsureg OnePower_0_01010B 144 2
[26,25]

1.20 设置安全协处理器日志级别

命令功能

设置安全协处理器日志级别

  • 说明 该命令行为取决于芯片能力

命令格式

setcoploglevel <LogLevel>

参数说明

参数参数说明取值
LogLevel日志级别0-紧急(emergency)
1-内核打印(common)
2-错误(error)
3-警告(warning)
4-通知(info)
5-调试(debug)

使用实例

shell
#已进入调试模式界面并连接soctrl组件模式
% attach soctrl  
Success  

% lscmd  
Usage: setcoploglevel <LogLevel>  
Set the coprocessor log level.  
LogLevel y 0-emergency, 1-common, 2-error, 3-warning, 4-info, 5-debug  

% setcoploglevel 5

%

1.21 获取运行时硬盘对象及信息命令

命令功能

获取运行时硬盘对象及信息

命令格式

getdrivedetails <DriveName>

参数说明

参数参数说明取值
DriveName硬盘名称指定硬盘名称:获取指定硬盘实时运行数据,如“Disk0”不指定名称:“**”表示获取所有硬盘实时运行数据

使用实例

shell
# 已进入调试模式界面并连接storage组件模式
% attach storage   
Success   

% lscmd   
Usage: getdrivedetails <DriveName>   
Get the drive details.   
DriveName s The name of drive.   

% getdrivedetails *   
[[["ActivationLed":"1","RelativeSlot":"2","HddBackplaneStartSlot":"0","Name":"Disk2","CommandTimeoutTimes":"0","UnexpectedSenseTimes":"0","LinkFault":"false”]],   
[[["ActivationLed":"1","RelativeSlot":"4","HddBackplaneStartSlot":"0","Name":"Disk4","CommandTimeoutTimes":"0","UnexpectedSenseTimes":"0","LinkFault":"false”]],   
[[["ActivationLed":"1","RelativeSlot":"7","HddBackplaneStartSlot":"0","Name":"Disk7","CommandTimeoutTimes":"0","UnexpectedSenseTimes":"0","LinkFault":"false”]],   
[[["ActivationLed":"1","RelativeSlot":"0","HddBackplaneStartSlot":"0","Name":"Disk0","CommandTimeoutTimes":"0","UnexpectedSenseTimes":"0","LinkFault":"false”]],   
[[["ActivationLed":"1","RelativeSlot":"3","HddBackplaneStartSlot":"0","Name":"Disk3","CommandTimeoutTimes":"0","UnexpectedSenseTimes":"0","LinkFault":"false”]]]

1.22 查询运行时 RAID 卡信息命令

命令功能

获取运行时RAID卡信息

命令格式

getctrlinfo <ControllerId>

参数说明

参数参数说明取值
ControllerIdRAID卡ID0-N:表示所查询的RAID卡ID

使用实例

shell
# 已进入调试模式界面并连接storage组件模式
% attach storage   
Success   

% lscmd   
Usage: getctrlinfo <Controllerld>   
Get the running information of controller.   
Controllerld y The ld of controller.   

% getctrlinfo 0   
{"DevDevice":"0","DevBus":"65","Phyaddr":"65","Eid":"0","CtrlOption3":"5888","Slotld":"3","CtrlOption2":"65 559","CtrlOption1":"34691","DevFunction":"0"}

1.23 查询和设置资源协作对象跟踪使能命令

命令功能

设置与查询资源协作对象可视化跟踪相关能力

命令格式

trace <operation> [parameter list]

参数说明

参数参数说明取值
operation对资源协作对象执行的可观测跟踪使能操作["sampling"] "sampling": 设置指定资源协作对象的跟踪采样率
parameter list对资源协作对象执行可观测跟踪使能的参数sampling [object name][rate]
object name: 跟踪采样的资源协作对象,默认为查询当前已使能的资源协作对象
rate: 设置的跟踪采样率[0-1], 默认为1

使用实例

shell
#已进入调试模式界面
% trace sampling Object_0
Success

% trace sampling Object_1 0.8
Success

% trace sampling
Object_0 1
Object_1 0.8

1.24追踪Mctp Endpoint报文命令

命令功能

设置与查询资源协作对象可视化跟踪相关能力

命令格式

tracemctp <ObjectName> <Action>

参数说明

参数参数说明取值
.ObjectName跟踪Endpoint对象名称mctpd组件资源树上的 Endpoint对象
Action操作类型取值为start时开始追踪 Endpoint收发报文数据
取值为stop时停止追踪 Endpoint收发报文数据

使用实例

shell
#已进入调试模式界面
% attach mctpd 
Success 
% tracemctp Endpoint_173_4 start
============= PCIe capture [SEND] =============
7F 30 00 03 08 10 00 72 CA 0A 09 01 B4 1A 00 96
02 00 01 00 AB 50 1F 00 08 00 00 00 00 00 00 00
00 00 00 81 19 00 13 02 00 FF FF 2C 01 00 00 00
============= PCIe capture [RECV] =============
0A 00 00 12 00 30 00 96 B4 1A 00 03 C2 09 0A 01
02 00 01 00 AB D0 1F 00 10 00 00 00 00 00 00 00
00 00 00 00 00 00 00 81 19 00 13 02 00 01 46 69
34 FF FE 41 7F 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

1.25追踪Scanner防抖数据命令

命令功能

设置与查询资源协作对象可视化跟踪相关能力

命令格式

tracedebounce <ObjectName> <Action>

参数说明

参数参数说明取值
objectname跟踪Scanner对象名称mctpd组件资源树上的Scanner对象
Action操作类型取值为start时开始追踪Scanner防抖数据
取值为stop时停止追踪Scanner防抖数据

使用实例

shell
# 已进入调试模式界面
% attach hwproxy 
Success 
% tracedebounce Scanner_FanBoard_Temp_0101 start
% ========================= debounce policy: Midavg =========================
scanner: Scanner_FanBoard_Temp_0101, signed: true
native value: 32, debounce resu