Skip to content

Instantly share code, notes, and snippets.

@tomfanning
Created August 14, 2017 09:18
Show Gist options
  • Save tomfanning/2ac2ab3a015661d246d1845bca124551 to your computer and use it in GitHub Desktop.
Save tomfanning/2ac2ab3a015661d246d1845bca124551 to your computer and use it in GitHub Desktop.
curl and zabbix
curl -X POST -H 'Content-type:application/json' -d '{"jsonrpc":"2.0","method":"user.login","params":{ "user":"unamehere","password":"passwdhere"},"auth":null,"id":0}' http://zabbixserver/zabbix/api_jsonrpc.php
response: {"jsonrpc":"2.0","result":"hex-code-here","id":0}
requst:
curl -X POST -H 'Content-type:application/json' -d '{
"jsonrpc": "2.0",
"method": "problem.get",
"params": {
"output": "extend",
"selectAcknowledges": "extend",
"selectTags": "extend",
"recent": "false",
"sortfield": ["eventid"],
"sortorder": "DESC"
},
"auth": "hex-code-here",
"id": 1
}' http://zabbix.utraq.trlsoftware.com/zabbix/api_jsonrpc.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment