Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save beingsane/d916d9f5efd5d9759481dd752b095f77 to your computer and use it in GitHub Desktop.
Save beingsane/d916d9f5efd5d9759481dd752b095f77 to your computer and use it in GitHub Desktop.
Curl post to zabbix api (api_jsonrpc.php)
curl -i -X POST -H 'Content-type:application/json' -d '{"jsonrpc":"2.0","method":"user.login","params":{ "user":"myUserName","password":"myPassword"},"auth":null,"id":0}' https://zabbix.server/api_jsonrpc.php
curl -i -X POST -H 'Content-type:application/json' -d '{"jsonrpc":"2.0","method":"host.get","params":{"output": ["hostid", "name"]},"auth":"<AUTH_KEY>","id":0}' https://zabbix.server/api_jsonrpc.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment