Skip to content

Instantly share code, notes, and snippets.

@double-p
Created October 17, 2019 21:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save double-p/c3de66a64e61c20d6290626441f2f555 to your computer and use it in GitHub Desktop.
Save double-p/c3de66a64e61c20d6290626441f2f555 to your computer and use it in GitHub Desktop.
jo -p -- -s jsonrpc=2.0 id=1 method=user.login auth= params[user]=Admin params[password]=zabbix | curl -H "Content-Type: application/json" -X POST -s -d @- -o- http://10.211.55.101:9595/api_jsonrpc.php |jq .result | tr -d \" > token
jo -p -- -s jsonrpc=2.0 id=1 method=user.get params[output]=extend auth=`cat token` | curl -H "Content-Type: application/json" -X POST -s -d @- -o- http://10.211.55.101:9595/api_jsonrpc.php | jq .
# jo: https://github.com/jpmens/jo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment