Cloudinsight Agent 在 4.7.0 版本,将 Agent 名称从 oneapm-ci-agent 更换至 cloudinsight-agent。若您在使用过程中,出现无法正常工作的情况,请加入售后群:433349863
X

emitter.py 报错 Unable to post payload

探针安装后启动成功,但 web 上没有数据,此时可以查看探针的 log ,在 /var/log/cloudinsight-agent 目录下面有 collector.logforwarder.log 2个文件,看看里面报 error 的段落,如图:

2015-12-25 11:40:54 CST | ERROR | ci.collector | checks.collector(emitter.py:69) | Unable to post payload.
Traceback (most recent call last):
  File "/opt/cloudinsight-agent/agent/emitter.py", line 61, in http_emitter
    r = requests.post(url, data=zipped, timeout=5, headers=headers)
  File "/opt/cloudinsight-agent/embedded/lib/python2.7/site-packages/requests/api.py", line 108, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/opt/cloudinsight-agent/embedded/lib/python2.7/site-packages/requests/api.py", line 50, in request
    response = session.request(method=method, url=url, **kwargs)
  File "/opt/cloudinsight-agent/embedded/lib/python2.7/site-packages/requests/sessions.py", line 464, in request
    resp = self.send(prep, **send_kwargs)
  File "/opt/cloudinsight-agent/embedded/lib/python2.7/site-packages/requests/sessions.py", line 576, in send
    r = adapter.send(request, **kwargs)
  File "/opt/cloudinsight-agent/embedded/lib/python2.7/site-packages/requests/adapters.py", line 415, in send
    raise ConnectionError(err, request=request)
ConnectionError: ('Connection aborted.', error(97, 'Address family not supported by protocol'))

如果有以上 Unable to post payload 的问题,可以修改 /etc/cloudinsight-agent/cloudinsight-agent.conf 文件,在里面添加如下内容:

bind_host: 127.0.0.1

之后重启探针,在 web 上看看是否已经有数据。

service cloudinsight-agent restart

这是因为探针默认会读取 localhost 的数据,如果本机没有把 localhost 解析成 127.0.0.1 ,就会报这个错误,所以可以对本机进行解析,也可以在 Cloudinsight 配置文件里面绑定 127.0.0.1。


如果您对 Cloudinsight 感兴趣,可以选择试用我们的产品,只需要点击下面的按钮免费注册即可。


立即注册 Cloudinsight