python-diamond / Diamond

Diamond is a python daemon that collects system metrics and publishes them to Graphite (and others). It is capable of collecting cpu, memory, network, i/o, load and disk metrics. Additionally, it features an API for implementing custom collectors for gathering metrics from almost any source.
http://diamond.readthedocs.org/
MIT License
1.74k stars 600 forks source link

JolokiaCollector is not working #729

Closed Lilili2019 closed 2 years ago

Lilili2019 commented 5 years ago

Having trouble to get the JolokiaCollector to work. So first I followed the doc https://diamond.readthedocs.io/en/latest/Getting-Started/Configuration/ to setup the JolokiaCollector: diamond-setup -C JolokiaCollector

But after restarted Diamond, the diamond.log shows some issue. Any thoughts why i am getting below ERROR?

[2019-02-01 10:52:52,779] [INFO] [MainThread:MainProcess] Changed UID: 0 () GID: 0 (). [2019-02-01 10:52:52,779] [INFO] [MainThread:MainProcess] Detaching Process. [2019-02-01 10:52:52,968] [ERROR] [MainThread:MainProcess] Failed to import module: collectd_network. Traceback (most recent call last): File "/usr/lib/python2.6/site-packages/diamond/utils/classes.py", line 159, in load_collectors_from_paths mod = imp.load_module(modname, fp, pathname, description) File "/usr/share/diamond/collectors/jcollectd/collectd_network.py", line 33, in if sys.version_info.major == 2: AttributeError: 'tuple' object has no attribute 'major'

[2019-02-01 10:52:52,970] [ERROR] [MainThread:MainProcess] Failed to import module: jcollectd. Traceback (most recent call last): File "/usr/lib/python2.6/site-packages/diamond/utils/classes.py", line 159, in load_collectors_from_paths mod = imp.load_module(modname, fp, pathname, description) File "/usr/share/diamond/collectors/jcollectd/jcollectd.py", line 33, in import collectd_network File "/usr/share/diamond/collectors/jcollectd/collectd_network.py", line 33, in if sys.version_info.major == 2: AttributeError: 'tuple' object has no attribute 'major'

[2019-02-01 10:52:55,200] [ERROR] [MainThread:JolokiaCollector] Collector failed! Traceback (most recent call last): File "/usr/lib/python2.6/site-packages/diamond/utils/scheduler.py", line 77, in collector_process collector._run() File "/usr/lib/python2.6/site-packages/diamond/collector.py", line 477, in _run self.collect() File "/usr/share/diamond/collectors/jolokia/jolokia.py", line 195, in collect self._get_domains() File "/usr/share/diamond/collectors/jolokia/jolokia.py", line 169, in _get_domains listing = self._list_request() File "/usr/share/diamond/collectors/jolokia/jolokia.py", line 234, in _list_request timeout=timeout)) as response: File "/usr/lib64/python2.6/urllib2.py", line 126, in urlopen return _opener.open(url, data, timeout) File "/usr/lib64/python2.6/urllib2.py", line 391, in open response = self._open(req, data) File "/usr/lib64/python2.6/urllib2.py", line 409, in _open '_open', req) File "/usr/lib64/python2.6/urllib2.py", line 369, in _call_chain result = func(*args) File "/usr/lib64/python2.6/urllib2.py", line 1190, in http_open return self.do_open(httplib.HTTPConnection, req) File "/usr/lib64/python2.6/urllib2.py", line 1165, in do_open raise URLError(err) URLError: <urlopen error [Errno 111] Connection refused>

shortdudey123 commented 2 years ago

Python2.6 support was dropped 11 months before this issue was created. If you still see this with master under 2.7, reopen and please include current collector config and logs. Closing . . .