elastizabbix icon indicating copy to clipboard operation
elastizabbix copied to clipboard

error in zabbix_agent log file

Open Trikke76 opened this issue 8 years ago • 3 comments

Hi, Nice script for zabbix in our setup it seems to work fine however in the agent log there are errors on all elasticsearch nodes

return json.load(open(cache)) File "/usr/lib/python2.7/json/init.py", line 278, in load *_kw) File "/usr/lib/python2.7/json/init.py", line 326, in loads return _default_decoder.decode(s) File "/usr/lib/python2.7/json/decoder.py", line 366, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode raise ValueError("No JSON object could be decoded") ValueError: No JSON object could be decoded Traceback (most recent call last): File "/opt/zabbix/scripts/elastizabbix.py", line 63, in stat = get_stat(api, stat) File "/opt/zabbix/scripts/elastizabbix.py", line 31, in get_stat d = get_cache(api) File "/opt/zabbix/scripts/elastizabbix.py", line 28, in get_cache return json.load(open(cache)) File "/usr/lib/python2.7/json/init.py", line 278, in load *_kw) File "/usr/lib/python2.7/json/init.py", line 326, in loads return _default_decoder.decode(s) File "/usr/lib/python2.7/json/decoder.py", line 366, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode raise ValueError("No JSON object could be decoded")

this happens on ubuntu 12.04

Trikke76 avatar Jul 22 '16 13:07 Trikke76

I'm seeing this also -- here's an example from the zabbix server log:

13966:20160916:114202.405 item "scmon-es1:elastizabbix[nodes,nodes.8r_wOHz-SvO9_bX8cmny5g.breakers.fielddata.tripped]" became not supported: Received value [Traceback (most recent call last): File "/etc/zabbix/externalscripts/elastizabbix.py", line 76, in stat = get_stat(api, stat) File "/etc/zabbix/externalscripts/elastizabbix.py", line 44, in get_stat d = get_cache(api) File "/etc/zabbix/externalscripts/elastizabbix.py", line 41, in get_cache return json.load(open(cache)) File "/usr/lib64/python2.7/json/init.py", line 290, in load **kw) File "/usr/lib64/python2.7/json/init.py", line 338, in loads return _default_decoder.decode(s) File "/usr/lib64/python2.7/json/decoder.py", line 365, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib64/python2.7/json/decoder.py", line 383, in raw_decode raise ValueError("No JSON object could be decoded") ValueError: No JSON object could be decoded] is not suitable for value type [Numeric (unsigned)] and data type [Decimal]

What's happening is that elastizabbix script is occasionally generating python errors which are being sent from zabbix agent to zabbix server as the script return value. The zabbix server is (correctly) saying that the python error output is not compatible with the data type (unsigned) expected...

Why elastizabbix is throwing errors and why zabbix agent is passing them to the server... I have not figured out yet.

zabbix-agent-2.4.4-1.el6.x86_64 on Red Hat Enterprise Linux Server release 7.0 (Maipo)

lmgray avatar Sep 16 '16 16:09 lmgray

Looks to me that you're not getting valid responses back from elasticsearch:

ValueError("No JSON object could be decoded")

It very well could be because of a timeout situation if your elasticsearch nodes are responding slow. Try adding "timeout=150" to this line: https://github.com/mkhpalm/elastizabbix/blob/master/agent/elastizabbix#L37

And make sure you increase your zabbix agent conf file's Timeout setting to match.

mkhpalm avatar Sep 18 '16 04:09 mkhpalm

If you are not using http://localhost:9200/ as backend server address. you should modify https://github.com/mkhpalm/elastizabbix/blob/master/agent/elastizabbix#L11-L16

zhujinhe avatar Mar 13 '17 10:03 zhujinhe