默认使用脚本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]
在执行方没问题。
默认使用脚本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]
在执行方没问题。