I just upgraded from zabbix 3.2 to 3.4.11. I am using the same code to import images from a XML file. I only changed the version number in the XML file to be 3.4:
< version>3.4</version>
I put lots of messages to print request, dump, responses, etc. Here is the request (python):
with open('/etc/images.xml','r') as myfile: data = myfile.read().replace('\n',' ').replace('\r',' ') req = *\{"jsonrpc":"2.0","method":"configuration.import "," id":1,"auth":auth,"params":\{"format":"xml","rule s" :\{"images":\{"createMissing":True,"updateExisting ": True}},"source":data}}* dump = json.dumps(req)
— When I print the value of dump I see my image XML into the "dump" string, all in 1 line with 8 <image> nodes; it is supposed to create 8 images in the "images" table.
request = urllib2.Request('http://localhost/zabbix/api_jsonrpc.php',dump,\{'Content-Type': 'application/json'})
response = urllib2.urlopen(request)
res = json.load(response)
— when I print the value of res I get: {u'jsonrpc': u'2.0', u'result': True, u'id':1}
Both the req and res look correct to me according to https://www.zabbix.com/documentation...uration/import
No data is uploaded to "images" table. Why?
I tried manually to add data to this table, and run the code above again; the images table gets truncated, the data I uploaded manually is deleted.
Please I've been dealing with this issue since last week and I do not know how to solve it. I cannot find anything in the forums, is this maybe a bug of 3.4 ?
I used the same python code with Zabbix API 3.2 and it worked perfectly.
I manually loaded the images by creating a csv file in Zabbix 3.2 then load that csv into the "images" table of Zabbix 3.4.11 using psql: \copy images FROM '/etc/images.csv' delimiter ',' csv
I created the csv file from the zabbix 3.2 website when exporting a map.
Your help with this issue will be very appreciated!