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/freebsd/memory.c')
-rw-r--r--src/libs/zbxsysinfo/freebsd/memory.c51
1 files changed, 26 insertions, 25 deletions
diff --git a/src/libs/zbxsysinfo/freebsd/memory.c b/src/libs/zbxsysinfo/freebsd/memory.c
index 8e85fba6cf5..f03850ee0f5 100644
--- a/src/libs/zbxsysinfo/freebsd/memory.c
+++ b/src/libs/zbxsysinfo/freebsd/memory.c
@@ -18,6 +18,7 @@
**/
#include "zbxsysinfo.h"
+#include "../sysinfo.h"
#include "log.h"
@@ -33,7 +34,7 @@ static u_int pagesize = 0;
return SYSINFO_RET_FAIL; \
}
-static int VM_MEMORY_TOTAL(AGENT_RESULT *result)
+static int vm_memory_total(AGENT_RESULT *result)
{
unsigned long totalbytes;
size_t len;
@@ -45,7 +46,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)
{
u_int activepages;
size_t len;
@@ -57,7 +58,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)
{
u_int inactivepages;
size_t len;
@@ -69,7 +70,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)
{
u_int wiredpages;
size_t len;
@@ -81,7 +82,7 @@ static int VM_MEMORY_WIRED(AGENT_RESULT *result)
return SYSINFO_RET_OK;
}
-static int VM_MEMORY_CACHED(AGENT_RESULT *result)
+static int vm_memory_cached(AGENT_RESULT *result)
{
u_int cachedpages;
size_t len;
@@ -93,7 +94,7 @@ static int VM_MEMORY_CACHED(AGENT_RESULT *result)
return SYSINFO_RET_OK;
}
-static int VM_MEMORY_FREE(AGENT_RESULT *result)
+static int vm_memory_free(AGENT_RESULT *result)
{
u_int freepages;
size_t len;
@@ -105,7 +106,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)
{
u_int activepages, wiredpages, cachedpages;
size_t len;
@@ -119,7 +120,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)
{
u_int activepages, wiredpages, cachedpages, totalpages;
size_t len;
@@ -141,7 +142,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)
{
u_int inactivepages, cachedpages, freepages;
size_t len;
@@ -155,7 +156,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)
{
u_int inactivepages, cachedpages, freepages, totalpages;
size_t len;
@@ -177,7 +178,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)
{
u_int bufspace;
size_t len;
@@ -189,7 +190,7 @@ static int VM_MEMORY_BUFFERS(AGENT_RESULT *result)
return SYSINFO_RET_OK;
}
-static int VM_MEMORY_SHARED(AGENT_RESULT *result)
+static int vm_memory_shared(AGENT_RESULT *result)
{
struct vmtotal vm;
size_t len = sizeof(vm);
@@ -206,7 +207,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;
@@ -227,29 +228,29 @@ 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, "cached"))
- ret = VM_MEMORY_CACHED(result);
+ ret = vm_memory_cached(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, "shared"))
- ret = VM_MEMORY_SHARED(result);
+ ret = vm_memory_shared(result);
else
{
SET_MSG_RESULT(result, zbx_strdup(NULL, "Invalid first parameter."));