2022 Zabbix中国峰会
2022 Zabbix中国峰会

> Maintenance object 维护模式对象

The following objects are directly related to the maintenance API. 如下对象与maintenanceAPI关联。

Maintenance 维护模式

The maintenance object has the following properties. 维护模式对象有如下属性。

Property Type Description
maintenanceid string (readonly) ID of the maintenance. 维护模式的ID。
name
(required)
string Name of the maintenance. 维护模式的名称。
active_since
(required)
timestamp Time when the maintenance becomes active. 维护模式生效的时刻。
active_till
(required)
timestamp Time when the maintenance stops being active. 维护模式失效的时刻。
description string Description of the maintenance. 维护模式说明。
maintenance_type integer Type of maintenance. 维护模式类型。

Possible values: 可能的值:
0 - (default) with data collection;
1 - without data collection.

Time period 时间周期

The time period object is used to define periods when the maintenance must come into effect. It has the following properties. 时间周期对象用于定义维护模式生效的时间周期。它有如下属性。

Property Type Description
timeperiodid string (readonly) ID of the maintenance. 维护模式ID。
day integer Day of the month when the maintenance must come into effect. 维护模式生效的月份天次。

Required only for monthly time periods. 月份时间周期要求。
dayofweek integer Days of the week when the maintenance must come into effect. 维护模式生效的周次。

Days are stored in binary form with each bit representing the corresponding day. For example, 4 equals 100 in binary and means, that maintenance will be enabled on Wednesday. 日期以二进制形式存储,每个比特代表对应的一天。例如,4在二进制中等于100,意味着星期三将启用维护。

Used for weekly and monthly time periods. Required only for weekly time periods. 用于周或月时间周期。仅周时间周期要求。
every integer For daily and weekly periods every defines day or week intervals at which the maintenance must come into effect. 对于天或者周的周期every定义维护模式生效的天或者周间隔。

For monthly periods every defines the week of the month when the maintenance must come into effect. 对于月周期every定义该月维护模式生效的周次。
Possible values: 可能的值:
1 - first week;
2 - second week;
3 - third week;
4 - fourth week;
5 - last week.
month integer Months when the maintenance must come into effect. 维护模式必须生效的月份。

Months are stored in binary form with each bit representing the corresponding month. For example, 5 equals 101 in binary and means, that maintenance will be enabled in January and March. 月份以二进制形式存储,每个位代表相应月份。例如,5在二进制中等于101,意味着维护将在一月和3月启用。

Required only for monthly time periods. 只有月时间周期要求。
period integer Time of day when the maintenance starts in seconds. 维护模式周期的时间(秒)。

Default: 3600.
start_date timestamp Date when the maintenance period must come into effect. 维护模式必须生效的日期。

Required only for one time periods.

Default: current date.
start_time integer Time of day when the maintenance starts in seconds. 一天内维护模式开始的时刻。

Required for daily, weekly and monthly periods.天、周、月周期要求。
timeperiod_type integer Type of time period. 时间周期类型。

Possible values: 可能的值:
0 - (default) one time only;
2 - daily;
3 - weekly;
4 - monthly.