-
Type:
Incident report
-
Resolution: Fixed
-
Priority:
Major
-
None
-
Affects Version/s: None
-
Component/s: API (A)
-
None
Let's say I have a screen with id 7, and a graph with id 390.
I add (using python lib for the API) the graph to the screen at position x=0,y=1 , the trace :
20: url: http://10.2.23.10/zabbix/api_jsonrpc.php
10: Trying to login with 'api':'md5(8a5da52ed126447d359e70c05721a8aa)'
10: json_obj: {'params':
, 'jsonrpc': '2.0', 'method': 'user.authenticate', 'auth': '', 'id': 0}
10: Connection object <httplib.HTTPConnection instance at 0x1a09a70>
20: Sending: {"params":
, "jsonrpc": "2.0", "method": "user.authenticate", "auth": "", "id": 0}
10: Sending headers:
20: Response Code: 200 OK
10: Response Body:
10: json_obj: {'params': {}, 'jsonrpc': '2.0', 'method': 'APIInfo.version', 'auth': 'a1d06d59703117af287be229ddbddc4f', 'id': 1}
10: Connection object <httplib.HTTPConnection instance at 0x1a09cb0>
20: Sending: {"params": {}, "jsonrpc": "2.0", "method": "APIInfo.version", "auth": "a1d06d59703117af287be229ddbddc4f", "id": 1}
10: Sending headers:
20: Response Code: 200 OK
10: Response Body:
Zabbix API Version: 1.2
10: json_obj: {'params':
, 'jsonrpc': '2.0', 'method': 'user.checkAuthentication', 'auth': 'a1d06d59703117af287be229ddbddc4f', 'id': 2}
10: Connection object <httplib.HTTPConnection instance at 0x1a09dd0>
20: Sending: {"params":
, "jsonrpc": "2.0", "method": "user.checkAuthentication", "auth": "a1d06d59703117af287be229ddbddc4f", "id": 2}
10: Sending headers:
20: Response Code: 200 OK
10: Response Body:
Logged in: True
10: json_obj: {'params': {'screenitems': [
], 'screenids': ['7']}, 'jsonrpc': '2.0', 'method': 'screen.addItems', 'auth': 'a1d06d59703117af287be229ddbddc4f', 'id': 3}
10: Connection object <httplib.HTTPConnection instance at 0x1a09d88>
20: Sending: {"params": {"screenitems": [
], "screenids": ["7"]}, "jsonrpc": "2.0", "method": "screen.addItems", "auth": "a1d06d59703117af287be229ddbddc4f", "id": 3}
10: Sending headers:
20: Response Code: 200 OK
10: Response Body:
I execute it many times, then if I try to get the screen_items they are all here. Even with sql :
mysql> select count
from screens_items where resourceid=390 and x=0 and y=1 and screenid=7;
-------------
| count |
-------------
| 9 |
-------------
I think that when you add a new screen_item to some position, the previous item should be deleted from the table.