Zabbix Documentation 1.8

2.23.04.0 (current)In development:4.2 (devel)Unsupported:1.82.02.43.23.4

User Tools

Site Tools


Sidebar

api:host

Host

Methods

Class containing methods for operations with Hosts.

MethodsDescription
get() Get host details
exists() Check if host exists
create() Create hosts
update() Update host details
delete() Delete hosts
massAdd() Mass add template linkage, macros, host groups
massUpdate() Mass update host details, link templates, add host groups
massRemove() Mass remove template linkage, macros, host groups

Object details

The table contains complete list of Host attributes.

ParameterTypeDescriptionDetails
hostidintHost ID
hoststringHost name.
portintPort number.
statusintHost Status.
useipintUse IP.
dnsstringDNS.
ipstringIP.
proxy_hostidintProxy Host ID.
useipmiintUse IPMI.
ipmi_ipstringIPMAI IP.
ipmi_portintIPMI port.
ipmi_authtypeintIPMI authentication type.
ipmi_privilegeintIPMI privilege.
ipmi_usernamestringIPMI username.
ipmi_passwordstringIPMI password.

Common tasks

The table contains list of common host-related tasks and possible implementation using Zabbix API

TaskHOWTO
Add a host Use method host.create
Add a bunch of new hosts Use method host.create with array of Host objects
Enable a host Use method host.update, set “status”:0
Disable a host Use method host.update, set “status”:1
Retrieve host details by Host IDs Use method host.get with parameter hostids
Retrieve host details by Host name Use method host.get with parameter filter, specify “host”:“<your host>“