Hello, I upgraded from Zabbix 5.0 to Zabbix 6.0 to take advantage of the new API token functionality but I'm unable to ged the data I need through the API unless the user role is set to Super Admin
What I would like to do is to use the API in a python script through an authentication associated to a user that can't logon to the web interface and can only use the methods included in the script.
The API is working but the problem is that unless the user associated to the token is a Super Admin, I have no access to other users' data.
This is my query:
If the user "api_user" which owns the auth token is NOT a Super Admin, this is the only thing I get back from the query:
On the other hand, if I make "api_user" a Super Admin, I get these same fields for all the users in the system.
How do I get around this?
[EDIT] I think I got it. User/Admin/Super Admin are just presets. I need to select "Super Admin" to enable all the checkboxes, then I can select the ones I need. Since I need to modify the users' media settings, I need to tick the "User" and "Media types" checkboxes an nothing else. This doesn't mean that the user is a Super Admin because everything else is disabled, especially the GUI access.
What I would like to do is to use the API in a python script through an authentication associated to a user that can't logon to the web interface and can only use the methods included in the script.
The API is working but the problem is that unless the user associated to the token is a Super Admin, I have no access to other users' data.
This is my query:
Code:
{"jsonrpc": "2.0",
"method": "user.get",
"params": {
"output" : [ "userid", "name", "surname", "username", "medias" ],
"selectMedias" : [ "mediatypeid", "sendto", "active" ] ,
"selectMediatypes" : [ "name" ] },
"auth": "**********************************",
"id": 50}
If the user "api_user" which owns the auth token is NOT a Super Admin, this is the only thing I get back from the query:
Code:
{"jsonrpc":"2.0","result":[{"userid":"13","name":"","surname":"","username":" api_user","medias":[],"mediatypes":[]}],"id":50}
How do I get around this?
[EDIT] I think I got it. User/Admin/Super Admin are just presets. I need to select "Super Admin" to enable all the checkboxes, then I can select the ones I need. Since I need to modify the users' media settings, I need to tick the "User" and "Media types" checkboxes an nothing else. This doesn't mean that the user is a Super Admin because everything else is disabled, especially the GUI access.
Comment