#define ZBX_PSTAT_GETSTATIC() \
if (-1 == pstat_getstatic(&pst, sizeof(pst), 1, 0)) \
SET_MSG_RESULT(result, zbx_dsprintf(NULL, "Cannot obtain static system information: %s", \
return SYSINFO_RET_FAIL; \
#define ZBX_PSTAT_GETDYNAMIC() \
if (-1 == pstat_getdynamic(&pdy, sizeof(pdy), 1, 0)) \
SET_MSG_RESULT(result, zbx_dsprintf(NULL, "Cannot obtain dynamic system information: %s", \
return SYSINFO_RET_FAIL; \
static int vm_memory_total(AGENT_RESULT *result)
SET_UI64_RESULT(result, (zbx_uint64_t)pst.physical_memory * pst.page_size);
static int vm_memory_free(AGENT_RESULT *result)
SET_UI64_RESULT(result, (zbx_uint64_t)pdy.psd_free * pst.page_size);
static int vm_memory_active(AGENT_RESULT *result)
SET_UI64_RESULT(result, (zbx_uint64_t)pdy.psd_arm * pst.page_size);