Skip to content

针对物理机单块CPU修改 #5

@turboren

Description

@turboren

默认使用脚本hwcheck 执行,是针对2块cpu, 在使用1块cpu的服务器上执行命令报错:
hwcheck -d
Traceback (most recent call last):
File "/usr/bin/hwcheck", line 591, in
messages = check(target=metric)
File "/usr/bin/hwcheck", line 522, in check
check_cpu()
File "/usr/bin/hwcheck", line 72, in check_cpu
model = Processor_Brand.split()[3]
IndexError: list index out of range

修改脚本第71行如下:
try:
model = Processor_Brand.split()[3]
except:
model = Processor_Brand.split()[0]

在执行方没问题。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions