zabbix API用户登录代码

curl -XPOST -H 'Content-Type: application/json-rpc' -d '
{
    "jsonrpc": "2.0",
    "method": "user.login",
    "params": {
        "user": "Admin",
        "password": "zabbix"
    },
    "id": 1,
    "auth": null
}' http://10.131.171.37/zabbix/api_jsonrpc.php | python -m json.tool




[root@sh-test011 ~]# curl -XPOST -H 'Content-Type: application/json-rpc' -d '
> {
>     "jsonrpc": "2.0",
>     "method": "user.login",
>     "params": {
>         "user": "Admin",
>         "password": "zabbix"
>     },
>     "id": 1,
>     "auth": null
> }' http://10.131.171.37/zabbix/api_jsonrpc.php | python -m json.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   229  100    68  100   161   1365   3234 --:--:-- --:--:-- --:--:--  3285
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": "41cd0fd25eeabffdc5f4728305932716"
}


你可能感兴趣的:(运维)