diff --git a/include/zbxcachehistory.h b/include/zbxcachehistory.h index ff3476abd97..ef9e781a848 100644 --- a/include/zbxcachehistory.h +++ b/include/zbxcachehistory.h @@ -89,6 +89,8 @@ int zbx_get_proxy_history_count(void); #define ZBX_STATS_HISTORY_INDEX_FREE 19 #define ZBX_STATS_HISTORY_INDEX_PUSED 20 #define ZBX_STATS_HISTORY_INDEX_PFREE 21 +#define ZBX_STATS_HISTORY_BIN_COUNTER 22 + void *zbx_dc_get_stats(int request); void zbx_dc_get_stats_all(zbx_wcache_info_t *wcache_info); diff --git a/src/libs/zbxcachehistory/dbcache.c b/src/libs/zbxcachehistory/dbcache.c index 9819e62851c..73c9fd964d3 100644 --- a/src/libs/zbxcachehistory/dbcache.c +++ b/src/libs/zbxcachehistory/dbcache.c @@ -317,6 +317,10 @@ void *zbx_dc_get_stats(int request) value_double = 100 * (double)hc_index_mem->free_size / hc_index_mem->total_size; ret = (void *)&value_double; break; + case ZBX_STATS_HISTORY_BIN_COUNTER: + value_uint = cache->stats.history_bin_counter; + ret = (void *)&value_uint; + break; default: ret = NULL; } diff --git a/src/zabbix_server/poller/checks_internal.c b/src/zabbix_server/poller/checks_internal.c index 4c5a1c3bc69..17bcb44c677 100644 --- a/src/zabbix_server/poller/checks_internal.c +++ b/src/zabbix_server/poller/checks_internal.c @@ -644,6 +644,8 @@ int get_value_internal(const zbx_dc_item_t *item, AGENT_RESULT *result, const zb SET_UI64_RESULT(result, *(zbx_uint64_t *)zbx_dc_get_stats(ZBX_STATS_HISTORY_LOG_COUNTER)); else if (0 == strcmp(tmp1, "text")) SET_UI64_RESULT(result, *(zbx_uint64_t *)zbx_dc_get_stats(ZBX_STATS_HISTORY_TEXT_COUNTER)); + else if (0 == strcmp(tmp1, "bin")) + SET_UI64_RESULT(result, *(zbx_uint64_t *)zbx_dc_get_stats(ZBX_STATS_HISTORY_BIN_COUNTER)); else if (0 == strcmp(tmp1, "not supported")) SET_UI64_RESULT(result, *(zbx_uint64_t *)zbx_dc_get_stats(ZBX_STATS_NOTSUPPORTED_COUNTER)); else