-
Incident report
-
Resolution: Fixed
-
Major
-
2.0.0
-
None
I've discovered a weird behavior when creating and deleting a hostgroup. Api user is member of Zabbix administrators user group which has permission to manipulate all hostgroups.
Error can be reproduced as shown below:
- Create a new hostgroup
- request
POST /zabbix/api_jsonrpc.php HTTP/1.1
Content-Type: application/json
{
"jsonrpc":"2.0",
"method":"hostgroup.create",
"params":[
],
"auth":"780eda433f4c24b67bec89244c7976e6",
"id":3
}
- response
HTTP/1.1 200 OK
Content-Length: 53
Date: Wed, 20 Jun 2012 15:42:21 GMT
Server: Apache/2.2.16 (Debian)
X-Powered-By: PHP/5.3.3-7+squeeze8
Connection: close
Content-Type: application/json
{"jsonrpc":"2.0","result":
{"groupids":["10"]},"id":3}
- Try to destroy newly created hostgroup
- request
POST /zabbix/api_jsonrpc.php HTTP/1.1
Content-Type: application/json
{
"jsonrpc":"2.0",
"method":"hostgroup.delete",
"params":[
],
"auth":"780eda433f4c24b67bec89244c7976e6",
"id":2
}
- response
HTTP/1.1 200 OK
Content-Length: 1106
Date: Wed, 20 Jun 2012 15:43:54 GMT
Server: Apache/2.2.16 (Debian)
X-Powered-By: PHP/5.3.3-7+squeeze8
Connection: close
Content-Type: application/json
{"jsonrpc":"2.0","error":{"code":-32500,"message":"Application error.","data":"You do not have permission to perform this operation.","debug":[
{"file":"\/opt\/share\/zabbix\/frontend\/api\/classes\/CHostGroup.php","line":715,"function":"exception","class":"CZBXAPI","type":"::","args":[120,"You do not have permission to perform this operation."]},{"function":"delete","class":"CHostGroup","type":"->","args":[[
{"groupid":10}]]},{"file":"\/opt\/share\/zabbix\/frontend\/api\/rpc\/class.czbxrpc.php","line":106,"function":"call_user_func","args":[[{},"delete"],[
{"groupid":10}]]},{"file":"\/opt\/share\/zabbix\/frontend\/api\/rpc\/class.czbxrpc.php","line":64,"function":"callAPI","class":"czbxrpc","type":"::","args":["hostgroup.delete",[
{"groupid":10}]]},{"file":"\/opt\/share\/zabbix\/frontend\/api\/rpc\/class.cjsonrpc.php","line":66,"function":"call","class":"czbxrpc","type":"::","args":["hostgroup.delete",[
{"groupid":10}],"780eda433f4c24b67bec89244c7976e6"]},
{"file":"\/opt\/share\/zabbix\/frontend\/api_jsonrpc.php","line":54,"function":"execute","class":"CJSONrpc","type":"->","args":[]}]},"id":2}