Ad Widget

Collapse

Zabbix 2.0 API - Item exists but is not readable

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • andybon
    Junior Member
    • Mar 2013
    • 2

    #1

    Zabbix 2.0 API - Item exists but is not readable

    I am trying to use the API to read the value of an item from the zabbix server. Using the item.exists() method returns True, but item.isreadable() is returning False. I am logging into the server (via the API) as the default admin user (which works), and I have gone into the administration GUI and changed the 'zabbix administrators' group to have read-write permissions for all defined monitoring groups. Are there any other possibilities for why this is not working?

    Thanks...
    Andy B.
  • Pavels
    Member
    • Oct 2011
    • 83

    #2
    Could you post the requests you're sending when calling item.exists and item.isreadable?

    Comment

    • andybon
      Junior Member
      • Mar 2013
      • 2

      #3
      Here are the requests/responses. I included the login portion:

      20: url: http://zabbix_srvr/zabbix/api_jsonrpc.php
      10: Trying to login with 'admin':'md5(5fce1b3e34b520afeffb37ce08c7cd66)'
      10: json_obj: {'params': {'password': 'zabbix', 'user': 'admin'}, 'jsonrpc': '2.0', 'method': 'user.authenticate', 'auth': '', 'id': 0}
      20: HTTP Auth enabled
      20: Sending: {"params": {"password": "zabbix", "user": "admin"}, "jsonrpc": "2.0", "method": "user.authenticate", "auth": " ", "id": 0}
      10: Sending headers: {'Content-Type': 'application/json-rpc', 'Authorization': 'Basic YWRtaW46emFiYml4', 'User-Agent': 'python/zabbix_api'}
      20: Response Code: 200
      10: Response Body: {u'jsonrpc': u'2.0', u'result': u'43ecd20b268b83fafb865a0ae3bba4fd', u'id': 0}

      10: json_obj: {'params': {'host': u'mss41a27', 'key_': 'host.role'}, 'jsonrpc': '2.0', 'method': 'item.exists', 'auth': u'cdaeef6d6cada9329df1c0f90e9e4ff7', 'id': 25}
      20: HTTP Auth enabled
      20: Sending: {"params": {"host": "mss41a27", "key_": "host.role"}, "jsonrpc": "2.0", "method": "item.exists", "auth": "cdaeef6d6cada9329df1c0f90e9e4ff7", "id": 25}
      10: Sending headers: {'Content-Type': 'application/json-rpc', 'Authorization': 'Basic YWRtaW46emFiYml4', 'User-Agent': 'python/zabbix_api'}
      20: Response Code: 200
      10: Response Body: {u'jsonrpc': u'2.0', u'result': True, u'id': 25}
      10: json_obj: {'params': {'host': u'mss41a27', 'key_': 'host.role'}, 'jsonrpc': '2.0', 'method': 'item.isreadable', 'auth': u'cdaeef6d6cada9329df1c0f90e9e4ff7', 'id': 26}
      20: HTTP Auth enabled
      20: Sending: {"params": {"host": "mss41a27", "key_": "host.role"}, "jsonrpc": "2.0", "method": "item.isreadable", "auth": "cdaeef6d6cada9329df1c0f90e9e4ff7", "id": 26}
      10: Sending headers: {'Content-Type': 'application/json-rpc', 'Authorization': 'Basic YWRtaW46emFiYml4', 'User-Agent': 'python/zabbix_api'}
      20: Response Code: 200
      10: Response Body: {u'jsonrpc': u'2.0', u'result': False, u'id': 26}

      Comment

      • Pavels
        Member
        • Oct 2011
        • 83

        #4
        Item.isreadable only allows to check whether items are readable by item ID. To check if an item is readable by it's key and host use the item.get method.

        See the manual for more info:

        Comment

        Working...