> Service object服务对象

The following objects are directly related to the service API以下对象与 service API直接相关.

Service服务

The service object has the following properties服务对象具有以下属性.

Property参数 Type类型 Description说明
serviceid string (readonly只读) ID of the service服务的ID.
algorithm(required必要) integer Algorithm used to calculate the state of the service用于计算服务状态的算法. Possible values可能的值为: 0 - do not calculate不计算; 1 - problem问题, if at least one child has a problem至少有一个问题; 2 - problem问题, if all children have problems都有问题.
name(required必要) string Name of the service服务的名称.
showsla(required必要) integer Whether SLA should be calculated是否应计算SLA. Possible values可能的值为: 0 - do not calculate不计算; 1 - calculate计算.
sortorder(required必要) integer Position of the service used for sorting用于排序服务的位置.
goodsla float Minimum acceptable SLA value. If the SLA drops lower, the service is considered to be in problem state最低可接受的SLA值,如果SLA降低,则该服务被认为处于问题状态. Default: 99.9.
status integer (readonly只读) Whether the service is in OK or problem state服务是否处于OK或问题状态. If the service is in problem state, status is equal either to如果服务处于问题状态,则status等于: - the priority of the linked trigger if it is set to 2, “Warning” or higher (priorities 0, “Not classified” and 1, “Information” are ignored);链接触发器的优先级设置为2,“Warning”或更高(优先级0,“Not classified”和1,“Information”可忽略) - the highest status of a child service in problem state处于问题状态的子服务的最高状态. If the service is in OK state, status is equal to 0如果服务处于OK状态,则status等于0.
triggerid string Trigger associated with the service. Can only be set for services that don't have children. 与服务相关联的触发器,只能为无子服务设置Default: 0

Service time服务时间

The service time object defines periods, when an service is scheduled to be up or down. It has the following properties.服务时间对象定义周期,当服务被调度为向上或向下时。它具有以下属性:

Property参数 Type类型 Description说明
timeid string (readonly只读) ID of the service time服务时间的ID.
serviceid(required必要) string ID of the service服务的ID. Cannot be updated不能被更新.
ts_from(required必要) integer Time when the service time comes into effect服务时间生效的时间. For onetime downtimes ts_from must be set as a Unix timestamp一次宕机时间ts_from必须设置为Unix时间戳, for other types对于其他类型 - as a specific time in a week, in seconds, for example, 90000 for Tue, 2:00 AM.
ts_to(required必要) integer Time when the service time ends. For onetime uptimes ts_to must be set as a Unix timestamp, for other types - as a specific time in a week, in seconds, for example, 90000 for Tue, 2:00 AM.作为一周中的特定时间,以秒为单位,例如,星期二,上午2:00的90000
type(required必要) integer Service time type服务时间类型. Possible values可能的值是: 0 - planned uptime, repeated every week计划运行时间,每周重复; 1 - planned downtime, repeated every week; 计划停机,每周重复2 - one-time downtime一次性停机.
note string Additional information about the service time有关服务时间的附加信息.

Service dependency服务依赖

The service dependency object represents a dependency between services. It has the following properties服务依赖对象表示服务之间的依赖关系,它具有以下属性.

Property参数 Type类型 Description说明
linkid string (readonly只读) ID of the service dependency服务依赖关系的ID.
servicedownid(required必要) string ID of the service, that a service depends on, that is, the child service. An service can have multiple children. 服务依赖的服务ID,即子服务。 一个服务可以有多个子服务。
serviceupid(required必要) string ID of the service, that is dependent on a service, that is, the parent service. An service can have multiple parents forming a directed graph.服务的ID依赖服务,即父服务,服务可以有多个父级形成有向图
soft(required必要) integer Type of dependency between services服务之间的依赖关系类型. Possible values可能的值为: 0 - hard dependency硬依赖; 1 - soft dependency软依赖. An service can have only one hard-dependent parent. This attribute has no effect on status or SLA calculation and is only used to create a core service tree. Additional parents can be added as soft dependencies forming a graph.一个服务只能有一个强依赖的父服务。该属性对状态或SLA计算没有影响,仅用于创建核心服务树。 新增的父服务可以作为形成图形的软依赖添加 An service can not be deleted if it has hard-dependent children.如果服务有硬依赖子服务,则无法删除该服务。

Service alarm服务告警

Service alrams cannot be directly created, updated or deleted via the Zabbix API不能通过Zabbix API直接创建,更新或删除服务告警.

The service alarm objects represents an service's state change. It has the following properties服务告警对象代表服务的状态变化,它具有以下属性.

Property参数 Type类型 Description说明
servicealarmid string ID of the service alarm服务告警的ID.
serviceid string ID of the service服务的ID.
clock timestamp Time when the service state change has happened服务状态发生变化的时间.
value integer Status of the service服务状态. Refer the the service status property for a list of possible values. 请参阅service status property以获取可能的值列表.