[ZBX-22388] Maintenance not apply to hosts created during maintenance Created: 2023 Feb 21  Updated: 2023 Mar 14  Resolved: 2023 Mar 14

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 6.2.7
Fix Version/s: None

Type: Problem report Priority: Trivial
Reporter: Yurii Polenok Assignee: Aigars Kadikis
Resolution: Won't fix Votes: 0
Labels: api, host, hostgroup, macro, maintenance, tags
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File image-2023-02-21-15-20-22-642.png     PNG File image-2023-02-21-15-30-48-544.png     File zbx_export_hosts.yaml     File zbx_export_templates.yaml    

 Description   

Steps to reproduce:

  1. Create maintenance using hostgroup and tag.
  2. Create a host with a macro value that should fire a trigger using this macro.

Result:

  1. Host created.
  2. Event triggered.
  3. Message sent (but should not, it should be suppressed by maintenance).

Expected:
Suppression events by tags should work for all hosts in host groups used in maintenance, regardless of whether the hosts were created before or after the maintenance was created.



 Comments   
Comment by Aigars Kadikis [ 2023 Feb 22 ]

Thank you for contacting.

Did you wait till the "Maintenance" icon on the host displays and only then generated event?

In real-life situation there is a delay in how fast the maintenance windows are kicking in. Delay is described:

CacheUpdateFrequency= /etc/zabbix/zabbix_server.conf

And also how long it takes to sync:

ps auxww | grep -o "[s]ynced.*"

Let us know.

Comment by Yurii Polenok [ 2023 Feb 23 ]
CacheUpdateFrequency=20
[root@zabbix-02 ~]# ps auxww | grep -o "[s]ynced.*"
synced 0 service updates, idle 5.004871 sec during 5.004921 sec]
synced configuration in 2.958846 sec, syncing configuration]
[root@zabbix-02 ~]# ps auxww | grep -o "[s]ynced.*"
synced 0 service updates, idle 5.004984 sec during 5.005046 sec]
synced configuration in 2.925869 sec, idle 20 sec]
[root@zabbix-02 ~]# ps auxww | grep -o "[s]ynced.*"
synced 0 service updates, idle 5.004950 sec during 5.005002 sec]
synced configuration in 2.907437 sec, idle 20 sec]

We can't wait for the "Maintenance" icon to appear on the host and then create an event, we need it as soon as possible.
As long as Zabbix does not support receiving events from third-party systems, we are forced to generate them on our own by creating a problematic host through the API.
I am attaching an example of a template and a host.

Comment by Yurii Polenok [ 2023 Mar 13 ]

Same problem in 6.4.0 with CacheUpdateFrequency=1.

Comment by Aigars Kadikis [ 2023 Mar 14 ]

Thanks for upgrading to latest stable release and testing it out.

Maintenance mode does rely on sequence:

  1. CacheUpdateFrequency
  2. How long it takes. 5s in your example
  3. Maintenance window can be started only at the start of each minute.

At the worst-case scenario, if you create a maintenance at 11:34:56, then 11:35:01 the configuration syncer will complete the task and we need to wait another 59 seconds. Only then the maintenance window will start. The process who is responsible for putting a host object in maintenance mode is called "timer":

watch -n1 "ps auxww | grep -Eo 'zabbix_server:[ ]timer.*'"

Sorry, but this is not a bug. It works by design, till the version 6.4 (including).

Generated at Sat Dec 13 22:05:55 EET 2025 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.