Пример #1
0
static int	VM_MEMORY_AVAILABLE(AGENT_RESULT *result)
{
	ZBX_PERFSTAT_MEMORY_TOTAL();

	SET_UI64_RESULT(result, m.real_free << ZBX_PERFSTAT_PAGE_SHIFT);

	return SYSINFO_RET_OK;
}
Пример #2
0
static int	VM_MEMORY_USED(AGENT_RESULT *result)
{
	ZBX_PERFSTAT_MEMORY_TOTAL();

	SET_UI64_RESULT(result, m.real_inuse << ZBX_PERFSTAT_PAGE_SHIFT);	/* real memory which is in use in pages */

	return SYSINFO_RET_OK;
}
Пример #3
0
static int	VM_MEMORY_FREE(AGENT_RESULT *result)
{
	ZBX_PERFSTAT_MEMORY_TOTAL();

	SET_UI64_RESULT(result, m.real_free << ZBX_PERFSTAT_PAGE_SHIFT);	/* free real memory in pages */

	return SYSINFO_RET_OK;
}
Пример #4
0
static int	VM_MEMORY_CACHED(AGENT_RESULT *result)
{
	ZBX_PERFSTAT_MEMORY_TOTAL();

	SET_UI64_RESULT(result, m.numperm << ZBX_PERFSTAT_PAGE_SHIFT);	/* number of pages used for files */

	return SYSINFO_RET_OK;
}
Пример #5
0
static int	VM_MEMORY_PAVAILABLE(AGENT_RESULT *result)
{
	ZBX_PERFSTAT_MEMORY_TOTAL();

	if (0 == m.real_total)
		return SYSINFO_RET_FAIL;

	SET_DBL_RESULT(result, m.real_free / (double)m.real_total * 100);

	return SYSINFO_RET_OK;
}
Пример #6
0
static int	VM_MEMORY_PAVAILABLE(AGENT_RESULT *result)
{
	ZBX_PERFSTAT_MEMORY_TOTAL();

	if (0 == m.real_total)
	{
		SET_MSG_RESULT(result, zbx_strdup(NULL, "Cannot calculate percentage because total is zero."));
		return SYSINFO_RET_FAIL;
	}

	SET_DBL_RESULT(result, m.real_free / (double)m.real_total * 100);

	return SYSINFO_RET_OK;
}