Ad Widget

Collapse

Problem Creating Host with API

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • thepilot21
    Junior Member
    • Jul 2014
    • 2

    #1

    Problem Creating Host with API

    I am using ZabbixPHPApi with Zabbix 2.2 and trying to Create a Host. The code emitted looks like this :-

    {"jsonrpc":"2.0","method":"host.create","params":{ "host":"abcdef","interfaces":{"useip":1,"ip":"192. 168.1.1","port":"10050"},"groups":{"groupid":9}}," auth":"f9df263591bad7164a1aa2a4b9bcbce1","id":"140 57696552381"}

    This results in :-

    API error -32500: No permissions to referred object or it does not exist

    I am using Admin account to do this so should have full permissions. I suspect a problem with groups but groupid 9 definitely exists.

    Any help to understand the problem much appreciated because nothing I tired worked so far.
  • thepilot21
    Junior Member
    • Jul 2014
    • 2

    #2
    Answering my own question

    I had two errors in the ZabbixPHPApi code.

    1. groups should be an array
    2. I had a parameter missing

    Mike

    Comment

    Working...