1.注意python和go环境依赖在root用户下安装,我在自己的账户下pip3 install numpy,切换为root后还是会显示缺少numpy模块。go环境也是一样
go环境安装: apt-get install golang-go
2. 若出现systemctl start atune-engine能运行,systemctl start atuned不能运行,
根据issue
您好,这个问题可能是由于缺少依赖引起的,可以尝试执行python3
A-Tune/analysis/app_rest.py A-Tune/misc/atuned.cnf,根据报错安装对应的python3依赖包
若出现 list out of range报错,需要修改atune-collector的源代码
第一个地方是 atune-collector/plugin/monitor/memory/topo.py,在format方法中,添加注释的两行
def format(self, info, fmt):
"""
format the result of the operation
:param info: content that needs to be converted
:param fmt: converted format
:returns output: converted result
"""
if fmt in ("json", "table", "xml"):
with open('/dev/null', 'w') as no_print:
o_json = subprocess.check_output("{cmd} -json".format(
cmd=self.__cmd).split(), stderr=no_print)
info = o_json.decode()
json_content = json.loads(info)
#if (isinstance(json_content, list)):
# json_content = {'children': json_content}
dict_datas = get_class_type(json_content, "memory", "System Memory")
if fmt == "json":
return json.dumps(dict_datas, indent=2)
if fmt == "xml":
import dict2xml
return dict2xml.dict2xml(dict_datas, "topology")
return None
return Monitor.format(self, info, fmt)
第二个地方是atune-collector/plugin/monitor/common.py中,将walk_class_type方法替换为下面的代码
def walk_class_type(father, class_type, desc, datas):
"""get key field"""
if "class" in father and father["class"] == class_type:
if "description" in father and (desc is None or father["description"].lower() == desc.lower()):
datas.append(father)
return
if "children" in father:
for i in father["children"]:
walk_class_type(i, class_type, desc, datas)
|