Source
xxxxxxxxxx
void zbx_audit_discovery_rule_update_json_add_lld_override_optemplate(int audit_context_mode, zbx_uint64_t itemid,
/*
** 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/>.
**/
int zbx_audit_item_resource_is_only_item(int resource_type)
{
return ZBX_AUDIT_RESOURCE_ITEM == resource_type;
}
int zbx_audit_item_resource_is_only_item_prototype(int resource_type)
{
return ZBX_AUDIT_RESOURCE_ITEM_PROTOTYPE == resource_type;
}
int zbx_audit_item_resource_is_only_item_and_item_prototype(int resource_type)
{
return (ZBX_AUDIT_RESOURCE_ITEM == resource_type || ZBX_AUDIT_RESOURCE_ITEM_PROTOTYPE == resource_type);
}
int zbx_audit_item_resource_is_only_lld_rule(int resource_type)
{
return ZBX_AUDIT_RESOURCE_DISCOVERY_RULE == resource_type;
}
int zbx_audit_item_flag_to_resource_type(int flag)
{
if (ZBX_FLAG_DISCOVERY_NORMAL == flag || ZBX_FLAG_DISCOVERY_CREATED == flag)
{
return ZBX_AUDIT_RESOURCE_ITEM;
}
else if (ZBX_FLAG_DISCOVERY_PROTOTYPE == flag)
{
return ZBX_AUDIT_RESOURCE_ITEM_PROTOTYPE;
}
else if (ZBX_FLAG_DISCOVERY_RULE == flag)
{
return ZBX_AUDIT_RESOURCE_DISCOVERY_RULE;
}
else
{
zabbix_log(LOG_LEVEL_CRIT, "unexpected audit detected: ->%d<-", flag);
THIS_SHOULD_NEVER_HAPPEN;
exit(EXIT_FAILURE);