美文网首页
zabbix-api 创建host-2018-09-20

zabbix-api 创建host-2018-09-20

作者: 那个_夏天 | 来源:发表于2018-09-26 16:22 被阅读0次

    curl -s -X POST -H 'Content-Type:application/json' -d '

    {

    "jsonrpc": "2.0",

    "method": "user.login",

    "params": {

    "user": "Admin",

    "password": "zabbix"

    },

    "id": 1

    }' http://10.10.2.125:8088/api_jsonrpc.php | python -mjson.tool

    返回值

    e0d717af31c72fd9c68c3266b6710705

    创建主机

    curl -s -X POST -H 'Content-Type:application/json' -d '

    {

    "jsonrpc": "2.0",

    "method": "host.create",

    "params": {

    "host": "slaver.test.com",

    "interfaces": [

    {

    "type": 1,

    "main": 1,

    "useip": 1,

    "ip": "10.12.1.20",

    "dns": "",

    "port": "10050"

    }

    ],

    "groups": [

    {

    "groupid": "2"

    }

    ],

    "templates": [

    {

    "templateid": "10001"

    }

    ]

    },

    "auth": "823f3366437fd53cff5ae266ba998451",

    "id": 1

    }' http://10.10.2.125:8088/api_jsonrpc.php | python -mjson.tool

    相关文章

      网友评论

          本文标题:zabbix-api 创建host-2018-09-20

          本文链接:https://www.haomeiwen.com/subject/fnvgnftx.html