Ad Widget

Collapse

zabbix 2.0.5 api host.create does not do anything

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • globe
    Member
    • Apr 2006
    • 40

    #1

    zabbix 2.0.5 api host.create does not do anything

    Hi @all,

    i got some weird behavior on Zabbix in a distributed setup where i like to add on a node via api a new host. Which works OK if i see the results on the JSON (get the next hostid correctly) but on the GUI, neither in the DB it's visible.

    anybody facing the same issue?

    here's the JSON:
    Code:
    {
     "jsonrpc": "2.0",
         "method": "host.create",
         "params": {
             "host": "testrouter.com",
             "name":"testrouter",
             "proxy_hostid":"0",
             "interfaces": [
                 {
                     "type": 2,
                     "main": 1,
                     "useip": 0,
                     "ip": "192.168.3.1",
                     "dns": "testrouter.com",
                     "port": "161"
                 }
             ],
             "groups": [
                 {
                     "groupid": "200200000000014"
                 }
             ],
             "templates": [
                 {
                     "templateid": "200200000010086"
                 }
             ],
             "macros": [
                 {
                     "macro": "{$SNMP_COMMUNITY}",
                     "value": "public"
                 }
             ],
             "inventory": {
                 "macaddress_a": "01234",
                 "macaddress_b": "56768"
             }
         },
         "auth": "95c673430adb1644fdc6734e602988ec",
         "id": 1
     }
    JSON return:

    Code:
    curl --noproxy 127.0.0.1 -i -X POST -H 'Content-Type: application/json' -d @./JSON.txt http://127.0.0.1/zabbix/api_jsonrpc.php
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
      0    65    0    65    0   975     35    530 --:--:--  0:00:01 --:--:--     0
    + HOSTID_TMP='HTTP/1.1 200 OK
    Date: Tue, 28 May 2013 13:52:03 GMT
    Server: Apache/2.2.12 (Linux/SUSE)
    X-Powered-By: PHP/5.3.22
    Content-Length: 65
    Content-Type: application/json
    
    {"jsonrpc":"2.0","result":{"hostids":["200200000010791"]},"id":1}'
Working...