|
From: Yao, Y. <yao...@cn...> - 2019-04-22 07:32:24
|
Hi Zabbix developers,
In zabbix 4.x, maintenance function does not act at 0 seconds of every minute and executes every minute according to the start time of
the timer process.
To deal with this problem, we have made the following amendments.
Index: timer.c
===================================================================
--- timer.c (revision 16)
+++ timer.c (revision 17)
@@ -700,8 +700,11 @@
if (1 == process_num)
{
+ /* Is it more than 0 seconds per minute */
+ unsigned char time_past_0 = (int)sec % ZBX_TIMER_DELAY <= (int)maintenance_time % ZBX_TIMER_DELAY || sec - maintenance_time > ZBX_TIMER_DELAY;
+
/* start update process only when all timers have finished their updates */
- if (sec - maintenance_time >= ZBX_TIMER_DELAY && FAIL == zbx_dc_maintenance_check_update_flags())
+ if ((0 == maintenance_time || 0 == (int)sec % ZBX_TIMER_DELAY || time_past_0 ) && FAIL == zbx_dc_maintenance_check_update_flags())
{
zbx_setproctitle("%s #%d [%s, processing maintenances]",
get_process_type_string(process_type), process_num, info);
if there is change about maintenance of zabbix4.x , please modify the Zabbix Documentation(https://www.zabbix.com/documentation/4.0/manual/maintenance) as following:
-------------------------------------------------------------------------------------------------------------
Timer processes are responsible for switching host status to/from maintenance at 0 seconds of every minute.
⇒Timer processes are responsible for switching host status to/from maintenance every minute since server is start.
Thanks & Best Regards,
Yanxu , yao
|