en	# 11 Maintenance
zh-cn	# 11. 维护期

en	#### Overview You can define maintenance periods for hosts and host groups in Zabbix. Furthermore, it is possible to define maintenance only for a single trigger (or subset of triggers) by specifying trigger tags. In this case maintenance will be activated only for those triggers; all other triggers of the host or host group will not be in maintenance. There are two maintenance types - with data collection and with no data collection. During a maintenance "with data collection" triggers are processed as usual and events are created when required. However, problem escalations are paused for hosts/triggers in maintenance, if the *Pause operations for suppressed problems* option is checked in action configuration. In this case, escalation steps that may include sending notifications or remote commands will be ignored for as long as the maintenance period lasts. Note that problem recovery and update operations are not suppressed during maintenance, only escalations. For example, if escalation steps are scheduled at 0, 30 and 60 minutes after a problem start, and there is a half-hour long maintenance lasting from 10 minutes to 40 minutes after a real problem arises, steps two and three will be executed a half-hour later, or at 60 minutes and 90 minutes (providing the problem still exists). Similarly, if a problem arises during the maintenance, the escalation will start after the maintenance. To receive problem notifications during the maintenance normally (without delay), you have to uncheck the *Pause operations for suppressed problems* option in action configuration. ::: noteclassic If at least one host (used in the trigger expression) is not in maintenance mode, Zabbix will send a problem notification. ::: Zabbix server must be running during maintenance. Maintenances are recalculated every minute or as soon as the configuration cache is reloaded if there are changes to the maintenance period. Timer processes check if host status must be changed to/from maintenance at 0 seconds of every minute. Additionally, every second the timer process checks if any maintenances must be started/stopped based on whether there are changes to the [maintenance periods] after the configuration update. Thus the speed of starting/stopping maintenance periods depends on the configuration [update interval](/manual/appendix/config/zabbix_server#cacheupdatefrequency) (10 seconds by default). Note that maintenance period changes do not include *Active since/Active till* settings. Also, if a host/host group is added to an existing active maintenance period, the changes will only be activated by the timer process at the start of next minute. Note that when a host enters maintenance, Zabbix server timer processes will read all open problems to check if it is required to suppress those. This may have a performance impact if there are many open problems. Zabbix server will also read all open problems upon startup, even if there are no maintenances configured at the time. Note that the Zabbix server (or proxy) always collects data regardless of the maintenance type (including "no data" maintenance). The data is later ignored by the server if 'no data collection' is set. When "no data" maintenance ends, triggers using nodata() function will not fire before the next check during the period they are checking. If a log item is added while a host is in maintenance and the maintenance ends, only new logfile entries since the end of the maintenance will be gathered. If a timestamped value is sent for a host that is in a “no data” maintenance type (e.g. using [Zabbix sender](/manpages/zabbix_sender)) then this value will be dropped however it is possible to send a timestamped value in for an expired maintenance period and it will be accepted. If maintenance period, hosts, groups or tags are changed by the user, the changes will only take effect after configuration cache synchronization.
zh-cn	#### 概述 在 Zabbix 中，您可以为主机组、主机以及特定的触发器或服务定义维护期。 Zabbix 提供两种维护类型 - 有数据收集（with data collection）和没有数据收集（with no data collection）。 在“有数据收集”的维护期间，触发器会像平常一样进行处理，并在需要时创建事件。然而，如果在操作配置中勾选了“暂停操作以解决被抑制的问题（Pause operations for suppressed problems）* 选项，则会暂停维护中的主机/触发器的问题升级。在此情况下，包括发送通知或远程命令的升级步骤将被忽略，维护期间持续期间内不会执行这些步骤。需要注意的是，问题的恢复和更新操作在维护期间不会被抑制，只有升级操作会被暂停。 例如，如果在问题发生后的0、30和60分钟安排了升级步骤，并且在实际问题发生后进行了30分钟的维护，那么第二步和第三步将会延迟半小时执行，即在60分钟和90分钟时执行（前提是问题仍然存在）。同样地，如果在维护期间出现了问题，升级步骤会在维护结束后开始执行。 如果要在维护期间正常接收问题通知（无延迟），需要在操作配置中取消勾选“暂停抑制问题的操作”选项。 ::: noteclassic 在触发器表达式中使用的主机，只要至少有一个主机未处于维护模式中，Zabbix 将发送问题通知。 ::: Zabbix server 在维护期间必须保持运行状态。维护期每分钟重新计算一次，或者在配置缓存重新加载时进行。如果维护期间有更改，定时器进程会在每分钟的0秒检查是否需要更改主机状态进入或退出维护模式。此外，每秒钟定时器进程会根据配置更新的间隔（默认为10秒）检查是否需要开始或停止任何维护期。因此，启动或停止维护期的速度取决于配置更新间隔。 需要注意的是，维护期更改不包括“自激活时间/自停止时间”设置。另外，如果将主机或主机组添加到现有的活动维护期中，这些更改将在下一分钟开始时由定时器进程激活。 当主机进入维护模式时，Zabbix Server定时器进程将读取所有未解决的问题以确定是否需要抑制这些问题。如果存在许多未解决的问题，这可能会对性能产生影响。此外，即使在此时没有配置维护期，Zabbix server 在启动时也会读取所有未解决的问题。 需要注意的是，Zabbix Server（或proxy）始终会收集数据，无论维护类型如何（包括“无数据”维护）。如果设置了“无数据收集”，server 会忽略后来的数据。 当“无数据”维护结束时，使用 nodata() 函数的触发器在它们检查期间不会在下一次检查之前触发。 如果在主机处于维护状态时添加了日志项，并且维护结束后，只会收集自维护结束后的新日志条目。 如果在“无数据”维护类型中为主机发送了时间戳值（例如使用[Zabbix sender](/manpages/zabbix_sender)），则该值将被丢弃。然而，可以在维护期已过期的情况下发送时间戳值，系统将接受该值。 如果用户更改了维护期、主机、主机组或标签，则这些更改只会在配置缓存同步后生效。

en	#### Configuration To configure a maintenance period: 1. Go to: *Data collection > Maintenance*. 2. Click on *Create maintenance period* (or on the name of an existing maintenance period). 3. Enter maintenance parameters in the form. ![](../../assets/en/manual/maintenance/maintenance.png){width="600"} All mandatory input fields are marked with a red asterisk. |Parameter|Description| |--|--------| |*Name*|Name of the maintenance period.| |*Maintenance type*|Two types of maintenance can be set:<br>**With data collection** - data will be collected by the server during maintenance, triggers will be processed;<br>**No data collection** - data will not be collected by the server during maintenance.<br>See [Effect of maintenance periods](/manual/web_interface/frontend_sections/reports/availability#effect-of-maintenance-periods) for how each type affects the availability report.| |*Active since*|The date and time when executing maintenance periods becomes active.<br>*Note:* Setting this time alone does not activate a maintenance period; maintenance periods must be configured in *Periods* (see below).| |*Active till*|The date and time when executing maintenance periods stops being active.| |*Periods*|This block allows you to define the exact days and hours when the maintenance takes place. Clicking on ![](../../assets/en/manual/maintenance/add_link.png) opens a popup window with a flexible *Maintenance period* form where you can define maintenance schedule. See [Maintenance periods](#maintenance_periods) for a detailed description.| |*Host groups*|Select host groups that the maintenance will be activated for. The maintenance will be activated for all hosts from the specified host group(s). This field is auto-complete, so starting to type in it will display a dropdown of all available host groups.<br>Specifying a parent host group implicitly selects all nested host groups. Thus the maintenance will also be activated on hosts from nested groups.| |*Hosts*|Select hosts that the maintenance will be activated for. This field is auto-complete, so starting to type in it will display a dropdown of all available hosts.<br>| |*Tags*|Specify tags to [suppress problems](/manual/acknowledgment/suppression) with matching tags on hosts in maintenance.<br>Several conditions can be set. Tag name matching is always case-sensitive.<br><br>There are two operators available for each condition:<br>**Contains** - include the specified tag names where the tag values contain the entered string (substring match, case-sensitive);<br>**Equals** - include the specified tag names and values (case-sensitive).<br><br>There are two calculation types for conditions:<br>**And/Or** - all conditions must be met, conditions having the same tag name will be grouped by the Or condition;<br>**Or** - enough if one condition is met.<br><br>Tags can be specified only if *With data collection* mode is selected.| |*Description*|Description of maintenance period.|
zh-cn	#### 配置 配置维护期有以下操作步骤： - 转到：*配置（Configuration） → 维护（Maintenance）* - 单击创建维护期（或现有维护期的名称） - 在表格中输入维护参数 ![](../../assets/en/manual/maintenance/maintenance.png){width="600"} 所有必填字段都标有红色星号。 | 参数 | 描述 | | -- | -------- | | *名称* | 维护期的名称。 | | *维护类型* | 可设置两种维护类型：<br>*带数据收集* - 维护期间服务器会收集数据，并处理触发器；<br>*无数据收集* - 维护期间服务器不会收集数据。 | | *生效时间* | 维护期生效的日期和时间。<br>*注意：* 单独设置此时间并不会激活维护期；必须在*时间段*中配置维护期（详见下文）。 | | *结束时间* | 维护期结束的日期和时间。 | | *时间段* | 这个部分允许您定义维护期间确切的天数和小时。点击![](../../assets/en/manual/maintenance/add_link.png)打开一个灵活的*维护期*表单弹窗，您可以在那里定义维护期的计划。详见[维护期时间段](#maintenance_periods)获取详细描述。 | | *主机组* | 选择要激活维护期的主机组。维护期将对指定主机组中的所有主机生效。此字段支持自动完成，开始输入时将显示所有可用的主机组下拉列表。<br>隐式选择父主机组会同时选择所有嵌套的主机组。因此，维护期也将在嵌套组的主机上生效。 | | *主机* | 选择要激活维护期的主机。此字段支持自动完成，开始输入时将显示所有可用的主机下拉列表。<br> | | *标签* | 如果指定了维护标签，将会激活所选主机的维护期，但只会抑制匹配标签的问题（即不会执行任何操作）。<br><br>对于多个标签，计算方法如下：<br>*And/Or* - 所有标签必须对应；但标签具有相同标签名称的情况下，按Or条件计算；<br>*Or* - 只需要一个标签对应即可。<br><br>有两种标签值匹配方式：<br>*包含* - 区分大小写的子字符串匹配（标签值包含输入的字符串）；<br>*等于* - 区分大小写的字符串匹配（标签值等于输入的字符串）。<br><br>仅在选择了*带数据收集*模式时才能指定标签。 | | *描述* | 维护期的描述。 |

en	##### Maintenance periods The maintenance period window is for scheduling time for a recurring or a one-time maintenance. The form is dynamic with available fields changing based on the *Period type* selected. ![](../../assets/en/manual/maintenance/maintenance_period.png){width="600"} |Period type|Description| |--|--------| |*One time only*|Configure a one time only maintenance period:<br>*Date* - date and time of the maintenance period;<br>*Maintenance period length* - for how long the maintenance will be active.| |*Daily*|Configure a daily maintenance period:<br>*Every day(s)* - maintenance frequency (1 - *(default)* every day, 2 - every two days, etc.);<br>*At (hour:minute)* - time of the day when maintenance starts;<br>*Maintenance period length* - for how long the maintenance will be active.<br><br>When *Every day(s)* parameter is greater than "1", the starting day is the day that the *Active since* time falls on. Examples:<br>- if *Active since* is set to "2021-01-01 12:00", *Every day(s)* is set to "2", and *At (hour:minute)* is set to "23:00", then the first maintenance period will start on January 1 at 23:00, while the second maintenance period will start on January 3 at 23:00;<br>- if *Active since* is set to "2021-01-01 12:00", *Every day(s)* is set to "2", and *At (hour:minute)* is set to "01:00", then the first maintenance period will start on January 3 at 01:00, while the second maintenance period will start on January 5 at 01:00.| |*Weekly*|Configure a weekly maintenance period:<br>*Every week(s)* - maintenance frequency (1 - *(default)* every week, 2 - every two weeks, etc.);<br>*Day of week* - on which day the maintenance should take place;<br>*At (hour:minute)* - time of the day when maintenance starts;<br>*Maintenance period length* - for how long the maintenance will be active.<br><br>When *Every week(s)* parameter is greater than "1", the starting week is the week that the *Active since* time falls on. For examples, see parameter *Daily* description above.| |*Monthly*|Configure a monthly maintenance period:<br>*Month* - select all months during which the regular maintenance is carried out;<br>*Date: **Day of month*** - select this option if the maintenance should take place on the same date each month (for example, every 1st day of the month), and then select the required day in the field *Day of month* that appears;<br>*Date: **Day of week*** - select this option if the maintenance should take place only on certain days (for example, every first Monday of the month), then select (in the drop-down) the required week of the month (first, second, third, fourth, or last), and then mark the checkboxes for maintenance day(s);<br>*At (hour:minute)* - time of the day when maintenance starts;<br>*Maintenance period length* - for how long the maintenance will be active.|
zh-cn	##### 维护期时间段 维护期时间窗口用于安排定期或一次性维护的时间。该表单是动态的，根据选择的*周期类型*不同，可用字段会发生变化。 ![](../../assets/en/manual/maintenance/maintenance_period.png){width="600"} |周期类型|描述| |--|--------| |*仅一次*|配置仅一次的维护期：<br>*日期* - 维护期开始的日期和时间；<br>*维护期长度* - 维护期持续时间。| |*每天*|配置每日维护期：<br>*每天(s)* - 维护频率（1 - *(默认)* 每天，2 - 每两天，以此类推）；<br>*在 (小时:分钟)* - 维护开始的时间；<br>*维护期长度* - 维护期持续时间。<br><br>当*每天(s)*参数大于 "1" 时，起始日期是*生效时间*所在的日期。例如：<br>- 如果*生效时间*设置为 "2021-01-01 12:00"，*每天(s)*设置为 "2"，*在 (小时:分钟)* 设置为 "23:00"，则第一个维护期将于1月1日23:00开始，第二个维护期将于1月3日23:00开始；<br>- 如果*生效时间*设置为 "2021-01-01 12:00"，*每天(s)*设置为 "2"，*在 (小时:分钟)* 设置为 "01:00"，则第一个维护期将于1月3日01:00开始，第二个维护期将于1月5日01:00开始。| |*每周*|配置每周维护期：<br>*每周(s)* - 维护频率（1 - *(默认)* 每周，2 - 每两周，以此类推）；<br>*星期几* - 维护应该在哪一天进行；<br>*在 (小时:分钟)* - 维护开始的时间；<br>*维护期长度* - 维护期持续时间。<br><br>当*每周(s)*参数大于 "1" 时，起始周是*生效时间*所在的周。详见上述*每天*参数描述中的示例。| |*每月*|配置每月维护期：<br>*月份* - 选择进行定期维护的所有月份；<br>*日期：**月中的某一天*** - 如果维护应在每月同一日期进行（例如，每月1日），然后在出现的*月中的某一天*字段中选择所需的日期；<br>*日期：**每周的某一天*** - 如果维护应仅在某些特定日子进行（例如，每月第一个星期一），然后在下拉菜单中选择所需的月份（第一、第二、第三、第四或最后一周），然后标记维护日的复选框；<br>*在 (小时:分钟)* - 维护开始的时间；<br>*维护期长度* - 维护期持续时间。|

en	::: noteimportant When creating a maintenance period, the [time zone](/manual/web_interface/time_zone) of the user who creates it is used. However, when recurring maintenance periods (*Daily*, *Weekly*, *Monthly*) are scheduled, the time zone of the Zabbix server is used. To ensure predictable behavior of recurring maintenance periods, it is required to use a common time zone for all parts of Zabbix. :::
zh-cn	::: noteimportant 在创建维护期时，使用创建者的[时区](/manual/web_interface/time_zone)。 然而，当选定维护周期（*每天*、*每周*、*每月*）时，会使用使用 Zabbix Server的时区。 为确保重复维护期内的可预测行为，需要在为Zabbix 的所有部分分配使用统一的时区设置。 :::

en	When done, press *Add* to add the maintenance period to the *Periods* block. Note that Daylight Saving Time (DST) changes do not affect how long the maintenance will be. For example, let's say that we have a two-hour maintenance configured that usually starts at 01:00 and finishes at 03:00: - if after one hour of maintenance (at 02:00) a DST change happens and current time changes from 02:00 to 03:00, the maintenance will continue for one more hour (till 04:00); - if after two hours of maintenance (at 03:00) a DST change happens and current time changes from 03:00 to 02:00, the maintenance will stop, because two hours have passed; - if a maintenance period starts during the hour that is skipped by a DST change, then the maintenance will not start. If a maintenance period is set to "1 day" (the actual period of the maintenance is 24 hours, since Zabbix calculates days in hours), starts at 00:00 and finishes at 00:00 the next day: - the maintenance will stop at 01:00 the next day if current time changes forward one hour; - the maintenance will stop at 23:00 that day if current time changes back one hour.
zh-cn	完成后，点击*添加*将维护期添加到*周期*板块。 请注意，夏令时（DST）变化不会影响维护的持续时间.例如,假设我们配置了一个两小时的维护期,通常从01:00开始,到03:00结束: - 如果在维护进行了一小时后(在02:00时),发生了夏令时变化,当前时间从02:00调整到03:00,那么维护将继续进行一小时,直到04:00; - 如果在维护进行了两小时后(在03:00时),发生了夏令时变化,当前时间从03:00调整到02:00,那么维护将停止,因为已经过了两小时; - 如果维护期开始时间落在夏令时变化时跳过的那一小时内，维护将不会开始。 如果一个维护期被设置为“1天”（实际维护期为24小时，因为Zabbix将每天按小时来计算），从00:00开始，到第二天的00:00结束： - 如果当前时间向前调整了一小时，那么维护将在第二天的01:00停止； - 如果当前时间向后调整了一小时，那么维护将在当天的23:00停止。

en	#### Display
zh-cn	#### 展示

en	##### Displaying hosts in maintenance An orange wrench icon ![](../../assets/en/manual/web_interface/frontend_sections/configuration/maintenance_wrench_icon.png) next to the host name indicates that this host is in maintenance in: - *Dashboards* - *Monitoring > Problems* - *Inventory > Hosts > Host inventory details* - *Data collection > Hosts* (See 'Status' column) ![](../../assets/en/manual/maintenance/maintenance_icon.png) Maintenance details are displayed when the mouse pointer is positioned over the icon. Additionally, hosts in maintenance get an orange background in *Monitoring > Maps*.
zh-cn	##### 显示维护中的主机 主机名旁边的橙色扳手图标 ![](../../assets/en/manual/web_interface/frontend_sections/configuration/maintenance_wrench_icon.png) 表示该主机正在维护中： - *仪表盘（Dashboard）* - *监控（Monitoring） → 问题（Problems）* - *资产清单（Inventory） → 主机（Hosts） → 主机清单详细信息（Host inventory details）* - *数据收集（Data collection ） → 主机（Hosts）*（参见“状态（status）”列） ![](../../assets/en/manual/maintenance/maintenance_icon.png) 将鼠标指针悬停在图标上时会显示维护详细信息。 此外，维护中的主机在*监控（Monitoring） → 拓扑图（Maps）*中显示为橙色背景。

en	##### Displaying suppressed problems Normally problems for hosts in maintenance are suppressed, i.e. not displayed in the frontend. However, it is also possible to configure that suppressed problems are shown, by selecting the *Show suppressed problems* option in these locations: - *Dashboards* (in *Problem hosts*, *Problems*, *Problems by severity*, *Trigger overview* widget configuration) - *Monitoring* > *Problems* (in the filter) - *Monitoring* > *Maps* (in map configuration) - Global [notifications](/manual/web_interface/user_profile/global_notifications) (in user profile configuration) When suppressed problems are displayed, the following icon is displayed: ![](../../assets/en/manual/web_interface/icon_suppressed.png). Rolling a mouse over the icon displays more details. ![](../../assets/en/manual/web_interface/info_suppressed2.png)
zh-cn	##### 显示抑制的问题 通常，维护中的主机问题会被抑制，即不会显示在前端。但是，也可以通过在以下位置选择 *显示抑制的问题* 选项来配置显示抑制的问题： - *仪表板（Dashboard）*（在*问题主机（Problem hosts）*、*问题（Problems）*、*严重性问题（Problems by severity）*、*触发器概览（Trigger overview）*小部件配置） - *监控（Monitoring）* → *问题（Problems）*（在过滤器中） - *监控（Monitoring）* → *拓扑图（Maps）*（在拓扑图配置中） - 全局 [通知](/manual/web_interface/user_profile/global_notifications)（在用户配置文件配置中） 显示抑制的问题时，会显示以下图标：![](../../assets/en/manual/web_interface/icon_suppressed.png)。将鼠标悬停在图标上会显示更多详细信息： ![](../../assets/en/manual/web_interface/info_suppressed2.png)

en	#### Calculation of queues during maintenance Queues displayed in the Zabbix frontend ([Administration > Queue](/manual/web_interface/frontend_sections/administration/queue)) are calculated by the Zabbix server. They do not include items under maintenance with no data collection—queue length is always zero for these items even when their values are delayed. Delayed items in maintenance with data collection are still counted in the queue. The Zabbix [proxy](/manual/concepts/proxy) is not aware of maintenance periods because there is no synchronization of maintenance configuration between the Zabbix server and proxy. Internal checks calculated on Zabbix proxies (for example, [`zabbix[queue,,]`](/manual/config/items/itemtypes/internal#queue) and [`zabbix[stats,,,queue,,]`](/manual/config/items/itemtypes/internal#stats.queue)) report delayed items regardless of the maintenance status on the Zabbix server. As a result, different queue lengths may be reported for the same items in maintenance with no data collection by the Zabbix frontend and by internal checks on Zabbix proxies.