Hi,
I have a problem with the zabbix API. Zabbix Version is 2.4.5. I'm using pyzabbix.
With the following code
I'll get this error:
Can you help me? I don't have any ideas anymore :/
I have a problem with the zabbix API. Zabbix Version is 2.4.5. I'm using pyzabbix.
With the following code
Code:
def itemaverage(itemid, minutes):
time_till = time.mktime(datetime.datetime.now().timetuple())
time_from = time_till - 60 * minutes
history = zapi.history.get({'itemid': itemid,'time_from': time_from,'time_till': time_till,'output': 'extend','limit': '50'})
values = []
for point in history:
values.append(int(point['value']))
return sum(values) / float(len(values))
itemaverage(itemid, minutes)
Code:
10: Sending headers: {'Content-Type': 'application/json-rpc', 'User-Agent': 'python/zabbix_api'}
Traceback (most recent call last):
File "zabbix2omd.py", line 55, in <module>
itemaverage(itemid, minutes)
File "zabbix2omd.py", line 49, in itemaverage
history = zapi.history.get({'itemid': itemid,'time_from': time_from,'time_till': time_till,'output': 'extend','limit': '50'})
File "/usr/local/lib/python2.7/dist-packages/zabbix_api.py", line 314, in method
return self.universal("%s.%s" % (self.data["prefix"], name), opts[0])
File "/usr/local/lib/python2.7/dist-packages/zabbix_api.py", line 71, in wrapper
return self.do_request(self.json_obj(method, opts))['result']
File "/usr/local/lib/python2.7/dist-packages/zabbix_api.py", line 321, in do_request
return self.parent.do_request(req)
File "/usr/local/lib/python2.7/dist-packages/zabbix_api.py", line 237, in do_request
raise APITimeout("SSL read timeout",)
zabbix_api.APITimeout: SSL read timeout
Comment