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

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)