Ad Widget

Collapse

API access for Usergroups

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chubz
    Junior Member
    • Jul 2012
    • 11

    #1

    API access for Usergroups

    I'm following steps for this...
    http://www.zabbix.com/documentation/...etting_started
    So I'm trying authenticate my user. And I get an error, and like the documentation said,
    In order to use API with the given user, you need to set “API access” to “Enabled” for the user group of that user or place that user into a predefined “API access” group.
    But I'm totally lost on how to do that. I'm looking at the documentation for usergroup methods in the API, but I don't see how I can enable API access..

    Any help would be great.
  • Stephen Wood
    Member
    • Feb 2012
    • 43

    #2
    Click on "administration" > "Users" > the group you want to grant API access

    Then, fron the dropdown for "API Access", grant away.

    Comment

    • tchjts1
      Senior Member
      • May 2008
      • 1605

      #3
      Depends on what version of Zabbix you are using.

      Version 2.0 and later:

      5.5.8 API access changes

      User group access property “API access” has been removed. Starting with Zabbix 2.0, all users have full access to the API.

      Comment

      • ckozler_mcc
        Junior Member
        • Nov 2014
        • 3

        #4
        Hey guys -

        Signed up just to post this since I really wanted to use this. If you're using the latest zabbix (2.4 at the time of this writing) the reason why you are returning no output is because authentication is failing since they changed user.authentication to user.login. See here when I ran the curl command that it executes

        Code:
        {"jsonrpc":"2.0","error":{"code":-32602,"message":"Invalid params.","data":"Incorrect method \"user.authenticate\"."},"id":0}
        And checking the example I saw on the zabbix blog http://blog.zabbix.com/getting-start...bbix-api/1381/

        You can see how its using user.login

        Solution
        Go to the directory where all these scripts are and then ..
        Code:
        sed -i 's,user.authenticate,user.login,g' *
        And you will get output

        Also ensure you are using perl-JSON if on RedHat 6/7

        Comment

        • tchjts1
          Senior Member
          • May 2008
          • 1605

          #5
          Good info. Thanks for the follow-up.

          Comment

          • ckozler_mcc
            Junior Member
            • Nov 2014
            • 3

            #6
            Posted this in the wrong thread :-/ lol. Its still applicable here though

            Comment

            Working...