Source
if (ZBX_MOCK_SUCCESS != zbx_strtime_to_timespec(zbx_mock_get_parameter_string("in.maintenance.active_since"),
/*
** Zabbix
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
static zbx_timeperiod_type_t get_period_type(const char *path)
{
const char *data;
data = zbx_mock_get_parameter_string(path);
if (0 == strcmp(data, "onetime"))
return TIMEPERIOD_TYPE_ONETIME;
if (0 == strcmp(data, "daily"))
return TIMEPERIOD_TYPE_DAILY;
if (0 == strcmp(data, "weekly"))
return TIMEPERIOD_TYPE_WEEKLY;
if (0 == strcmp(data, "monthly"))
return TIMEPERIOD_TYPE_MONTHLY;
return TIMEPERIOD_TYPE_ONETIME;
}
static void get_period(zbx_dc_maintenance_period_t *period)
{
zbx_timespec_t ts;
period->type = get_period_type("in.period.type");
period->every = zbx_mock_get_parameter_uint64("in.period.every");
period->dayofweek = zbx_mock_get_parameter_uint64("in.period.dayofweek");
period->day = zbx_mock_get_parameter_uint64("in.period.day");
period->month = zbx_mock_get_parameter_uint64("in.period.month");
period->period = zbx_mock_get_parameter_uint64("in.period.period");
period->start_time = zbx_mock_get_parameter_uint64("in.period.start_time");