Ad Widget

Collapse

usergroup.get returns no permission info?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kevinw
    Junior Member
    • Oct 2013
    • 5

    #1

    usergroup.get returns no permission info?

    I'm using the API to dynamically add some hostgroups (via hostgroup.create) which works just fine. In order to make my new group visible, I need to add it to the list of permissions for my "Zabbix users" and "Zabbix administrators" user groups.

    That seems pretty straightforward, usergroup.update takes an array of rights objects which replaces the permissions so I would just include my new groupid in with the others and I'm done. The problem, however is that I can't see any usergroup.get call that tells me what the current array of rights are for the usergroup. If I just put my new group in there it removes all other groups and I only have the one.

    How do I pull a list of current permissions for a usergroup?

    Kevin
  • DRVTiny
    Senior Member
    • Sep 2011
    • 162

    #2
    Sorry, this is double
    Last edited by DRVTiny; 15-05-2014, 15:03.

    Comment

    • DRVTiny
      Senior Member
      • Sep 2011
      • 162

      #3
      Dear evelopers, anybody knows, how to get information about usergroup permissions using zabbix API request?
      This is very strange that such absolutely basic functionality not implemented in Zabbix API, but developers already think about ZQL and such other "cosmical" features.
      For now, include/perm.inc.php get permission matrix very unclear direct SQL request:
      Code:
       SELECT n.nodeid AS nodeid,n.name AS node_name,hg.groupid AS groupid,h.hostid,h.host,h.name AS host_name,h.status FROM hosts h LEFT JOIN hosts_groups hg ON hg.hostid=h.hostid LEFT JOIN nodes n ON n.nodeid=(h.hostid div 100000000000000) WHERE h.status in (0,1,3) AND h.flags IN ('0','4');
      IMHO this is absolutely awful

      Comment

      Working...