This is the documentation page for an unsupported version of Zabbix.
Is this not what you were looking for? Switch to the current version or choose one from the drop-down menu.

hostinterface.create

Leírás

object hostinterface.create(object/array hostInterfaces)

Ez a módszer lehetővé teszi új gazdagép interfészek létrehozását.

Ez a módszer csak az Admin és a Kiemelt rendszergazda számára érhető el felhasználói típusok. A metódus meghívására vonatkozó engedélyek felhasználói szerepkörben visszavonhatók beállítások. Lásd: User roles további információért.

Paraméterek

`(objektum/tömb) Létrehozandó gazdagép interfészek. A metódus fogadja a gazdagépet interfészek a standard host interface tulajdonságok.

Visszatérési értékek

(object) Egy objektumot ad vissza, amely tartalmazza a létrehozott gazdagép azonosítóit interfészeket az interfaceids tulajdonság alatt. A visszaküldés sorrendje Az azonosítók megegyeznek az átadott gazdagép interfészek sorrendjével.

Példák

Create a new interface

Create a secondary IP agent interface on host "30052."

Request:

{  "jsonrpc": "2.0",  "method": "hostinterface.create",  "params": {  "hostid": "30052",  "main": "0",  "type": "1",  "useip": "1",  "ip": "127.0.0.1",  "dns": "",  "port": "10050",  },  "auth": "038e1d7b1735c6a5436ee9eae095879e",  "id": 1 }

Response:

{  "jsonrpc": "2.0",  "result": {  "interfaceids": [  "30062"  ]  },  "id": 1 }

Create an interface with SNMP details

Request:

{  "jsonrpc": "2.0",  "method": "hostinterface.create",  "params": {  "hostid": "10456",  "main": "0",  "type": "2",  "useip": "1",  "ip": "127.0.0.1",  "dns": "",  "port": "1601",  "details": {  "version": "2",  "bulk": "1",  "community": "{$SNMP_COMMUNITY}"  }  },  "auth": "038e1d7b1735c6a5436ee9eae095879e",  "id": 1 }

Response:

{  "jsonrpc": "2.0",  "result": {  "interfaceids": [  "30063"  ]  },  "id": 1 }

Lásd még

Forrás

CHostInterface::create() in ui/include/classes/api/services/CHostInterface.php.