Ad Widget

Collapse

Unable to authenticate & create proxy using zabbix api

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • divneet
    Junior Member
    • Dec 2018
    • 1

    #1

    Unable to authenticate & create proxy using zabbix api

    Here is this gist of the api call that I'm trying to run .

    curl -X POST -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","method":"user.login","params" :{ "user": "Admin","password": "zabbix"}, "id": 1}' http://zabbix-server.hellohaptik.com...pi_jsonrpc.php > /mnt/result.json
    chown ubuntu: /mnt/result.json

    AuthToken=$(cat /mnt/result.json | jq -r '.result')


    curl -i -X POST -H 'Content-Type: application/json' -d '{"jsonrpc" : "2.0" , "method" : "proxy.create" , "params" : {"host": "zabbix-proxy", "status": "5", "hosts": [{"hostid": "10279" }]}, "auth":"'"$${AuthToken}"'", "id": 1 }' http://zabbix-server.hellohaptik.com...pi_jsonrpc.php


    the error I am getting ```{"jsonrpc":"2.0","error":{"code":-32602,"message":"Invalid params.","data":"Session terminated, re-login, please."},"id":1}ubuntu@zabbix-proxy:~$ ```


    Is there something I'm missing out on ?

    Any assistance is appreciated ?
Working...