Source
/* Negative values can occur when a counter rolls over. By default, this value entry does not appear */
/*
** Zabbix
** Copyright (C) 2001-2024 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.
**/
struct object_name_ref
{
char *eng_name;
wchar_t *loc_name;
};
typedef struct
{
zbx_perf_counter_data_t *pPerfCounterList;
PDH_HQUERY pdh_query;
time_t lastrefresh_objects; /* last refresh time of object cache */
time_t lastupdate_names; /* last update time of object names */
}
ZBX_PERF_STAT_DATA;
static ZBX_PERF_STAT_DATA ppsd;
static zbx_mutex_t perfstat_access = ZBX_MUTEX_NULL;
static struct object_name_ref *object_names = NULL;
static int object_num = 0;
static int perf_collector_started(void)
{
return (NULL != ppsd.pdh_query ? SUCCEED : FAIL);
}
/******************************************************************************
* *
* Comments: counter failed or disappeared, dismiss all previous values *
* *