#define ADD_UINT64(r, t, f) zbx_audit_update_json_append_uint64(graphid, AUDIT_GRAPH_ID, AUDIT_DETAILS_ACTION_ADD, \
#include "audit/zbxaudit_graph.h"
#include "audit/zbxaudit.h"
static int graph_flag_to_resource_type(int flag)
if (ZBX_FLAG_DISCOVERY_NORMAL == flag || ZBX_FLAG_DISCOVERY_CREATED == flag)
return AUDIT_RESOURCE_GRAPH;
else if (ZBX_FLAG_DISCOVERY_PROTOTYPE == flag)
return AUDIT_RESOURCE_GRAPH_PROTOTYPE;
zabbix_log(LOG_LEVEL_CRIT, "unexpected audit graph flag detected: ->%d<-", flag);
THIS_SHOULD_NEVER_HAPPEN;
#define GR_OR_GRP(s) (AUDIT_RESOURCE_GRAPH == resource_type) ? "graph."#s : "graphprototype."#s
void zbx_audit_graph_create_entry(int audit_action, zbx_uint64_t graphid, const char *name, int flags)
zbx_audit_entry_t local_audit_graph_entry, **found_audit_graph_entry;
zbx_audit_entry_t *local_audit_graph_entry_x = &local_audit_graph_entry;
resource_type = graph_flag_to_resource_type(flags);
local_audit_graph_entry.id = graphid;
local_audit_graph_entry.cuid = NULL;
local_audit_graph_entry.id_table = AUDIT_GRAPH_ID;
found_audit_graph_entry = (zbx_audit_entry_t**)zbx_hashset_search(zbx_get_audit_hashset(),
&(local_audit_graph_entry_x));