Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/zbxsysinfo/netbsd/memory.c')
-rw-r--r--src/libs/zbxsysinfo/netbsd/memory.c51
1 files changed, 26 insertions, 25 deletions
diff --git a/src/libs/zbxsysinfo/netbsd/memory.c b/src/libs/zbxsysinfo/netbsd/memory.c
index 12f9489097e..6bf72c4f82c 100644
--- a/src/libs/zbxsysinfo/netbsd/memory.c
+++ b/src/libs/zbxsysinfo/netbsd/memory.c
@@ -18,6 +18,7 @@
**/
#include "zbxsysinfo.h"
+#include "../sysinfo.h"
#include "log.h"
@@ -37,7 +38,7 @@ static struct uvmexp_sysctl uvm;
return SYSINFO_RET_FAIL; \
}
-static int VM_MEMORY_TOTAL(AGENT_RESULT *result)
+static int vm_memory_total(AGENT_RESULT *result)
{
ZBX_SYSCTL(uvm);
@@ -46,7 +47,7 @@ static int VM_MEMORY_TOTAL(AGENT_RESULT *result)
return SYSINFO_RET_OK;
}
-static int VM_MEMORY_ACTIVE(AGENT_RESULT *result)
+static int vm_memory_active(AGENT_RESULT *result)
{
ZBX_SYSCTL(uvm);
@@ -55,7 +56,7 @@ static int VM_MEMORY_ACTIVE(AGENT_RESULT *result)
return SYSINFO_RET_OK;
}
-static int VM_MEMORY_INACTIVE(AGENT_RESULT *result)
+static int vm_memory_inactive(AGENT_RESULT *result)
{
ZBX_SYSCTL(uvm);
@@ -64,7 +65,7 @@ static int VM_MEMORY_INACTIVE(AGENT_RESULT *result)
return SYSINFO_RET_OK;
}
-static int VM_MEMORY_WIRED(AGENT_RESULT *result)
+static int vm_memory_wired(AGENT_RESULT *result)
{
ZBX_SYSCTL(uvm);
@@ -100,7 +101,7 @@ static int VM_MEMORY_FILE(AGENT_RESULT *result)
return SYSINFO_RET_OK;
}
-static int VM_MEMORY_FREE(AGENT_RESULT *result)
+static int vm_memory_free(AGENT_RESULT *result)
{
ZBX_SYSCTL(uvm);
@@ -109,7 +110,7 @@ static int VM_MEMORY_FREE(AGENT_RESULT *result)
return SYSINFO_RET_OK;
}
-static int VM_MEMORY_USED(AGENT_RESULT *result)
+static int vm_memory_used(AGENT_RESULT *result)
{
ZBX_SYSCTL(uvm);
@@ -118,7 +119,7 @@ static int VM_MEMORY_USED(AGENT_RESULT *result)
return SYSINFO_RET_OK;
}
-static int VM_MEMORY_PUSED(AGENT_RESULT *result)
+static int vm_memory_pused(AGENT_RESULT *result)
{
ZBX_SYSCTL(uvm);
@@ -133,7 +134,7 @@ static int VM_MEMORY_PUSED(AGENT_RESULT *result)
return SYSINFO_RET_OK;
}
-static int VM_MEMORY_AVAILABLE(AGENT_RESULT *result)
+static int vm_memory_available(AGENT_RESULT *result)
{
zbx_uint64_t available;
@@ -146,7 +147,7 @@ static int VM_MEMORY_AVAILABLE(AGENT_RESULT *result)
return SYSINFO_RET_OK;
}
-static int VM_MEMORY_PAVAILABLE(AGENT_RESULT *result)
+static int vm_memory_pavailable(AGENT_RESULT *result)
{
zbx_uint64_t available;
@@ -165,7 +166,7 @@ static int VM_MEMORY_PAVAILABLE(AGENT_RESULT *result)
return SYSINFO_RET_OK;
}
-static int VM_MEMORY_BUFFERS(AGENT_RESULT *result)
+static int vm_memory_buffers(AGENT_RESULT *result)
{
int mib[] = {CTL_VM, VM_NKMEMPAGES}, pages;
@@ -176,7 +177,7 @@ static int VM_MEMORY_BUFFERS(AGENT_RESULT *result)
return SYSINFO_RET_OK;
}
-static int VM_MEMORY_CACHED(AGENT_RESULT *result)
+static int vm_memory_cached(AGENT_RESULT *result)
{
ZBX_SYSCTL(uvm);
@@ -185,7 +186,7 @@ static int VM_MEMORY_CACHED(AGENT_RESULT *result)
return SYSINFO_RET_OK;
}
-static int VM_MEMORY_SHARED(AGENT_RESULT *result)
+static int vm_memory_shared(AGENT_RESULT *result)
{
int mib[] = {CTL_VM, VM_METER};
struct vmtotal vm;
@@ -197,7 +198,7 @@ static int VM_MEMORY_SHARED(AGENT_RESULT *result)
return SYSINFO_RET_OK;
}
-int VM_MEMORY_SIZE(AGENT_REQUEST *request, AGENT_RESULT *result)
+int vm_memory_size(AGENT_REQUEST *request, AGENT_RESULT *result)
{
char *mode;
int ret = SYSINFO_RET_FAIL;
@@ -211,13 +212,13 @@ int VM_MEMORY_SIZE(AGENT_REQUEST *request, AGENT_RESULT *result)
mode = get_rparam(request, 0);
if (NULL == mode || '\0' == *mode || 0 == strcmp(mode, "total"))
- ret = VM_MEMORY_TOTAL(result);
+ ret = vm_memory_total(result);
else if (0 == strcmp(mode, "active"))
- ret = VM_MEMORY_ACTIVE(result);
+ ret = vm_memory_active(result);
else if (0 == strcmp(mode, "inactive"))
- ret = VM_MEMORY_INACTIVE(result);
+ ret = vm_memory_inactive(result);
else if (0 == strcmp(mode, "wired"))
- ret = VM_MEMORY_WIRED(result);
+ ret = vm_memory_wired(result);
else if (0 == strcmp(mode, "anon"))
ret = VM_MEMORY_ANON(result);
else if (0 == strcmp(mode, "exec"))
@@ -225,21 +226,21 @@ int VM_MEMORY_SIZE(AGENT_REQUEST *request, AGENT_RESULT *result)
else if (0 == strcmp(mode, "file"))
ret = VM_MEMORY_FILE(result);
else if (0 == strcmp(mode, "free"))
- ret = VM_MEMORY_FREE(result);
+ ret = vm_memory_free(result);
else if (0 == strcmp(mode, "used"))
- ret = VM_MEMORY_USED(result);
+ ret = vm_memory_used(result);
else if (0 == strcmp(mode, "pused"))
- ret = VM_MEMORY_PUSED(result);
+ ret = vm_memory_pused(result);
else if (0 == strcmp(mode, "available"))
- ret = VM_MEMORY_AVAILABLE(result);
+ ret = vm_memory_available(result);
else if (0 == strcmp(mode, "pavailable"))
- ret = VM_MEMORY_PAVAILABLE(result);
+ ret = vm_memory_pavailable(result);
else if (0 == strcmp(mode, "buffers"))
- ret = VM_MEMORY_BUFFERS(result);
+ ret = vm_memory_buffers(result);
else if (0 == strcmp(mode, "cached"))
- ret = VM_MEMORY_CACHED(result);
+ ret = vm_memory_cached(result);
else if (0 == strcmp(mode, "shared"))
- ret = VM_MEMORY_SHARED(result);
+ ret = vm_memory_shared(result);
else
{
SET_MSG_RESULT(result, zbx_strdup(NULL, "Invalid first parameter."));