Source
zabbix_log(LOG_LEVEL_DEBUG, "End of %s() extended diskstat shared memory: old_max:%d new_max:%d old_size:"
/*
** 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/>.
**/
/* defined in sysinfo lib */
static zbx_collector_data *collector = NULL;
int cpu_collector_started(void)
{
return ((NULL != collector) && (NULL != collector->cpus.queue_counter));
/* not _WINDOWS */
return (NULL != collector);
}
zbx_collector_data *get_collector(void)
{
return collector;
}
int diskdevice_collector_started(void)
{
return ((NULL != collector) && (ZBX_NONEXISTENT_SHMID != collector->diskstat_shmid));
}
static int shm_id;
static int my_diskstat_shmid = ZBX_NONEXISTENT_SHMID;
static zbx_diskdevices_data *diskdevices = NULL;
zbx_diskdevices_data *get_diskdevices(void)
{
return diskdevices;
}
static zbx_mutex_t diskstats_lock = ZBX_MUTEX_NULL;
void stats_lock_diskstats(void)
{
zbx_mutex_lock(diskstats_lock);
}
void stats_unlock_diskstats(void)
{
zbx_mutex_unlock(diskstats_lock);
}
/******************************************************************************
* *
* Purpose: Returns the number of processors which are currently online *
* (i.e., available). *
* *
******************************************************************************/
static int zbx_get_cpu_num(void)
{
return get_cpu_num_win32();
struct pst_dynamic psd;
if (-1 == pstat_getdynamic(&psd, sizeof(struct pst_dynamic), 1, 0))
goto return_one;
return (int)psd.psd_proc_cnt;