Source
return zbx_parse_cfg_file(config_file, cfg, ZBX_CFG_FILE_REQUIRED, ZBX_CFG_NOT_STRICT, ZBX_CFG_NO_EXIT_FAILURE);
/*
** 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 Affero General Public License as published by the Free Software Foundation, version 3.
**
** 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 Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
/******************************************************************************
* *
* Purpose: loads aliases from configuration *
* *
* Parameters: lines - [IN/OUT] aliases from configuration file *
* *
* Comments: calls zbx_add_alias() for each entry *
* *
******************************************************************************/
void load_aliases(char **lines)
{
char **pline;
for (pline = lines; NULL != *pline; pline++)
{
char *c;
const char *r = *pline;
if (SUCCEED != zbx_parse_key(&r) || ':' != *r)
{
zabbix_log(LOG_LEVEL_CRIT, "cannot add alias \"%s\": invalid character at position %d",
*pline, (int)((r - *pline) + 1));
exit(EXIT_FAILURE);
}
c = (char *)r++;
if (SUCCEED != zbx_parse_key(&r) || '\0' != *r)
{
zabbix_log(LOG_LEVEL_CRIT, "cannot add alias \"%s\": invalid character at position %d",
*pline, (int)((r - *pline) + 1));
exit(EXIT_FAILURE);
}
*c++ = '\0';
zbx_add_alias(*pline, c);
*--c = ':';
}