diff options
| author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-11-03 16:29:43 +0000 |
|---|---|---|
| committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-11-03 16:29:43 +0000 |
| commit | d04389e9e64105f5f12f533302c5a58f9a756ab4 (patch) | |
| tree | a45f7b70e8fa59667442b7fb15b9dc1c97df43d1 /src/libs/zbxsysinfo/openbsd | |
| parent | 304ab134fad9c443887cd8597b0f192f3b5566a1 (diff) | |
| download | zabbix-d04389e9e64105f5f12f533302c5a58f9a756ab4.tar.gz zabbix-d04389e9e64105f5f12f533302c5a58f9a756ab4.tar.xz zabbix-d04389e9e64105f5f12f533302c5a58f9a756ab4.zip | |
*** empty log message ***
git-svn-id: svn://svn.zabbix.com/trunk@2263 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src/libs/zbxsysinfo/openbsd')
| -rw-r--r-- | src/libs/zbxsysinfo/openbsd/cpu.c | 18 | ||||
| -rw-r--r-- | src/libs/zbxsysinfo/openbsd/memory.c | 25 | ||||
| -rw-r--r-- | src/libs/zbxsysinfo/openbsd/net.c | 34 |
3 files changed, 40 insertions, 37 deletions
diff --git a/src/libs/zbxsysinfo/openbsd/cpu.c b/src/libs/zbxsysinfo/openbsd/cpu.c index 4ed42301..3efc2909 100644 --- a/src/libs/zbxsysinfo/openbsd/cpu.c +++ b/src/libs/zbxsysinfo/openbsd/cpu.c @@ -278,3 +278,21 @@ CPU_FNCLIST return SYSINFO_RET_FAIL; } +int SYSTEM_CPU_SWITCHES(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) +{ + assert(result); + + clean_result(result); + + return SYSINFO_RET_FAIL; +} + +int SYSTEM_CPU_INTR(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) +{ + assert(result); + + clean_result(result); + + return SYSINFO_RET_FAIL; +} + diff --git a/src/libs/zbxsysinfo/openbsd/memory.c b/src/libs/zbxsysinfo/openbsd/memory.c index 28e758e5..967490a6 100644 --- a/src/libs/zbxsysinfo/openbsd/memory.c +++ b/src/libs/zbxsysinfo/openbsd/memory.c @@ -22,30 +22,6 @@ #include "common.h" #include "sysinfo.h" -static int VM_MEMORY_SHARED(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) -{ - int mib[2]; - size_t len; - struct vmtotal v; - int ret=SYSINFO_RET_FAIL; - - assert(result); - - clean_result(result); - - len=sizeof(v); - mib[0]=CTL_VM; - mib[1]=VM_METER; - - if(0==sysctl(mib,2,&v,&len,NULL,0)) - { - result->type |= AR_DOUBLE; - result->dbl=(double)(t_vmshr * sysconf(_SC_PAGESIZE)); - ret=SYSINFO_RET_OK; - } - return ret; -} - static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { int mib[2]; @@ -106,7 +82,6 @@ MEM_FNCLIST MEM_FNCLIST fl[] = { {"free", VM_MEMORY_FREE}, - {"shared", VM_MEMORY_SHARED}, {"total", VM_MEMORY_TOTAL}, {0, 0} }; diff --git a/src/libs/zbxsysinfo/openbsd/net.c b/src/libs/zbxsysinfo/openbsd/net.c index 7fad4c51..56a709ed 100644 --- a/src/libs/zbxsysinfo/openbsd/net.c +++ b/src/libs/zbxsysinfo/openbsd/net.c @@ -31,13 +31,14 @@ static struct nlist kernel_symbols[] = #define IFNET_ID 0 -static int get_ifdata(const char *device, struct if_data *result) +static int get_ifdata(const char *device, struct ifnet *result) { struct ifnet_head head; struct ifnet *ifp; char ifname[IFNAMSIZ+1]; kvm_t *kp; + int len = 0; int ret = SYSINFO_RET_FAIL; kp = kvm_open(NULL, NULL, NULL, O_RDONLY, NULL); @@ -57,7 +58,7 @@ static int get_ifdata(const char *device, struct if_data *result) len = sizeof(struct ifnet_head); if(kvm_read(kp, kernel_symbols[IFNET_ID].n_value, &head, len) >= len) { - len = sizeof(struct if_data); + len = sizeof(struct ifnet); for(ifp = head.tqh_first; ifp; ifp = result->if_list.tqe_next) { if(kvm_read(kp, (u_long) ifp, result, len) < len) @@ -86,7 +87,7 @@ static int get_ifdata(const char *device, struct if_data *result) static int NET_IF_IN_BYTES(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { - struct if_data value; + struct ifnet value; char interface[MAX_STRING_LEN]; int ret = SYSINFO_RET_FAIL; @@ -118,7 +119,7 @@ static int NET_IF_IN_BYTES(const char *cmd, const char *param, unsigned fla static int NET_IF_IN_PACKETS(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { - struct if_data value; + struct ifnet value; char interface[MAX_STRING_LEN]; int ret = SYSINFO_RET_FAIL; @@ -150,7 +151,7 @@ static int NET_IF_IN_PACKETS(const char *cmd, const char *param, unsigned f static int NET_IF_IN_ERRORS(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { - struct if_data value; + struct ifnet value; char interface[MAX_STRING_LEN]; int ret = SYSINFO_RET_FAIL; @@ -182,7 +183,7 @@ static int NET_IF_IN_ERRORS(const char *cmd, const char *param, unsigned fl int NET_IF_IN(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { -LIST struct net_fnclist_s +#define NET_FNCLIST struct net_fnclist_s NET_FNCLIST { char *mode; @@ -238,7 +239,7 @@ NET_FNCLIST static int NET_IF_OUT_BYTES(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { - struct if_data value; + struct ifnet value; char interface[MAX_STRING_LEN]; int ret = SYSINFO_RET_FAIL; @@ -270,7 +271,7 @@ static int NET_IF_OUT_BYTES(const char *cmd, const char *param, unsigned fl static int NET_IF_OUT_PACKETS(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { - struct if_data value; + struct ifnet value; char interface[MAX_STRING_LEN]; int ret = SYSINFO_RET_FAIL; @@ -302,7 +303,7 @@ static int NET_IF_OUT_PACKETS(const char *cmd, const char *param, unsigned static int NET_IF_OUT_ERRORS(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { - struct if_data value; + struct ifnet value; char interface[MAX_STRING_LEN]; int ret = SYSINFO_RET_FAIL; @@ -334,7 +335,7 @@ static int NET_IF_OUT_ERRORS(const char *cmd, const char *param, unsigned f int NET_IF_OUT(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { -LIST struct net_fnclist_s +#define NET_FNCLIST struct net_fnclist_s NET_FNCLIST { char *mode; @@ -388,9 +389,18 @@ NET_FNCLIST return SYSINFO_RET_FAIL; } -static int NET_IF_COLLISIONS(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) +int NET_TCP_LISTEN(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { - struct if_data value; + assert(result); + + clean_result(result); + + return SYSINFO_RET_FAIL; +} + +int NET_IF_COLLISIONS(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) +{ + struct ifnet value; char interface[MAX_STRING_LEN]; int ret = SYSINFO_RET_FAIL; |
