diff options
Diffstat (limited to 'src/libs/zbxsysinfo')
113 files changed, 764 insertions, 760 deletions
diff --git a/src/libs/zbxsysinfo/aix/cpu.c b/src/libs/zbxsysinfo/aix/cpu.c index f45b39db..157ab650 100644 --- a/src/libs/zbxsysinfo/aix/cpu.c +++ b/src/libs/zbxsysinfo/aix/cpu.c @@ -121,7 +121,7 @@ CPU_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) { @@ -217,7 +217,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if(getloadavg(load, 3)) { @@ -235,7 +235,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if (pstat_getdynamic(&dyn, sizeof(dyn), 1, 0) == -1) { @@ -258,7 +258,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if (!kc && !(kc = kstat_open())) { @@ -279,7 +279,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if(getloadavg_kmem(loadavg,3) == FAIL) { @@ -292,7 +292,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif #endif @@ -308,7 +308,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if(getloadavg(load, 3)) { @@ -326,7 +326,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if (pstat_getdynamic(&dyn, sizeof(dyn), 1, 0) == -1) { @@ -349,7 +349,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if (!kc && !(kc = kstat_open())) { @@ -370,7 +370,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if(getloadavg_kmem(loadavg,3) == FAIL) { @@ -383,7 +383,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif #endif @@ -399,7 +399,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); if(getloadavg(load, 3)) { @@ -417,7 +417,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); if (pstat_getdynamic(&dyn, sizeof(dyn), 1, 0) == -1) { @@ -440,7 +440,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); if (!kc && !(kc = kstat_open())) { @@ -461,7 +461,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); if(getloadavg_kmem(loadavg,3) == FAIL) { @@ -474,7 +474,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif #endif @@ -507,7 +507,7 @@ CPU_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { @@ -552,7 +552,7 @@ int SYSTEM_CPU_SWITCHES(const char *cmd, const char *param, unsigned flags, { assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } @@ -561,7 +561,7 @@ int SYSTEM_CPU_INTR(const char *cmd, const char *param, unsigned flags, AGEN { assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } diff --git a/src/libs/zbxsysinfo/aix/diskio.c b/src/libs/zbxsysinfo/aix/diskio.c index 23d0c450..333b177a 100644 --- a/src/libs/zbxsysinfo/aix/diskio.c +++ b/src/libs/zbxsysinfo/aix/diskio.c @@ -159,7 +159,7 @@ DEV_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) { @@ -235,7 +235,7 @@ DEV_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) { @@ -334,7 +334,7 @@ int OLD_IO(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *res assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/aix/diskspace.c b/src/libs/zbxsysinfo/aix/diskspace.c index e2120ac6..81fd7e8e 100644 --- a/src/libs/zbxsysinfo/aix/diskspace.c +++ b/src/libs/zbxsysinfo/aix/diskspace.c @@ -66,7 +66,7 @@ static int VFS_FS_USED(const char *cmd, const char *param, unsigned flags, AGENT assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -90,7 +90,7 @@ static int VFS_FS_FREE(const char *cmd, const char *param, unsigned flags, AGENT assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -114,7 +114,7 @@ static int VFS_FS_TOTAL(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -142,7 +142,7 @@ static int VFS_FS_PFREE(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -167,7 +167,7 @@ static int VFS_FS_PUSED(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -210,7 +210,7 @@ FS_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { diff --git a/src/libs/zbxsysinfo/aix/inodes.c b/src/libs/zbxsysinfo/aix/inodes.c index 7a81d6e6..8f89286b 100644 --- a/src/libs/zbxsysinfo/aix/inodes.c +++ b/src/libs/zbxsysinfo/aix/inodes.c @@ -66,7 +66,7 @@ static int VFS_FS_INODE_USED(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -90,7 +90,7 @@ static int VFS_FS_INODE_FREE(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -114,7 +114,7 @@ static int VFS_FS_INODE_TOTAL(const char *cmd, const char *param, unsigned flags assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -141,7 +141,7 @@ static int VFS_FS_INODE_PFREE(const char *cmd, const char *param, unsigned flags assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -166,7 +166,7 @@ static int VFS_FS_INODE_PUSED(const char *cmd, const char *param, unsigned flags assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -209,7 +209,7 @@ FS_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { diff --git a/src/libs/zbxsysinfo/aix/kernel.c b/src/libs/zbxsysinfo/aix/kernel.c index 14157f22..84c5067b 100644 --- a/src/libs/zbxsysinfo/aix/kernel.c +++ b/src/libs/zbxsysinfo/aix/kernel.c @@ -30,7 +30,7 @@ int KERNEL_MAXFILES(const char *cmd, const char *param, unsigned flags, AGENT_RE assert(result); - clean_result(result); + init_result(result); mib[0]=CTL_KERN; mib[1]=KERN_MAXFILES; @@ -58,7 +58,7 @@ int KERNEL_MAXPROC(const char *cmd, const char *param, unsigned flags, AGENT_RES assert(result); - clean_result(result); + init_result(result); mib[0]=CTL_KERN; mib[1]=KERN_MAXPROC; @@ -86,7 +86,7 @@ int OLD_KERNEL(const char *cmd, const char *param, unsigned flags, AGENT_RES assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/aix/memory.c b/src/libs/zbxsysinfo/aix/memory.c index 7dc0fcbe..2feba4e8 100644 --- a/src/libs/zbxsysinfo/aix/memory.c +++ b/src/libs/zbxsysinfo/aix/memory.c @@ -36,7 +36,7 @@ static int VM_MEMORY_CACHED(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); f=fopen("/proc/meminfo","r"); if(NULL == f) @@ -61,7 +61,7 @@ static int VM_MEMORY_CACHED(const char *cmd, const char *param, unsigned flags, #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -74,7 +74,7 @@ static int VM_MEMORY_BUFFERS(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -93,7 +93,7 @@ static int VM_MEMORY_BUFFERS(const char *cmd, const char *param, unsigned flags, #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -106,7 +106,7 @@ static int VM_MEMORY_SHARED(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -128,7 +128,7 @@ static int VM_MEMORY_SHARED(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); len=sizeof(struct vmtotal); mib[0]=CTL_VM; @@ -150,7 +150,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A #ifdef HAVE_UNISTD_SYSCONF assert(result); - clean_result(result); + init_result(result); result->type |= AR_DOUBLE; result->dbl=(double)sysconf(_SC_PHYS_PAGES)*sysconf(_SC_PAGESIZE); @@ -161,7 +161,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A assert(result); - clean_result(result); + init_result(result); if(pstat_getstatic(&pst, sizeof(pst), (size_t)1, 0) == -1) { @@ -181,7 +181,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -203,7 +203,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A assert(result); - clean_result(result); + init_result(result); len=sizeof(struct vmtotal); mib[0]=CTL_VM; @@ -222,7 +222,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A assert(result); - clean_result(result); + init_result(result); len=sizeof(memory); @@ -240,7 +240,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -252,7 +252,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG #ifdef HAVE_UNISTD_SYSCONF assert(result); - clean_result(result); + init_result(result); result->type |= AR_DOUBLE; result->dbl=(double)sysconf(_SC_AVPHYS_PAGES)*sysconf(_SC_PAGESIZE); @@ -264,7 +264,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG assert(result); - clean_result(result); + init_result(result); if(pstat_getstatic(&pst, sizeof(pst), (size_t)1, 0) == -1) { @@ -304,7 +304,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -326,7 +326,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG assert(result); - clean_result(result); + init_result(result); len=sizeof(struct vmtotal); mib[0]=CTL_VM; @@ -347,7 +347,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG assert(result); - clean_result(result); + init_result(result); pagesize = 0; kret = host_page_size (mach_host_self(), &pagesize); @@ -378,7 +378,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -407,7 +407,7 @@ MEM_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/aix/net.c b/src/libs/zbxsysinfo/aix/net.c index 49867845..12b22e32 100644 --- a/src/libs/zbxsysinfo/aix/net.c +++ b/src/libs/zbxsysinfo/aix/net.c @@ -27,7 +27,7 @@ int NET_IF_IN(const char *cmd, const char *param, unsigned flags, AGENT_RESULT * assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } @@ -37,7 +37,7 @@ int NET_IF_OUT(const char *cmd, const char *param, unsigned flags, AGENT_RESULT assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } diff --git a/src/libs/zbxsysinfo/aix/proc.c b/src/libs/zbxsysinfo/aix/proc.c index 5153605c..0bcd31dc 100644 --- a/src/libs/zbxsysinfo/aix/proc.c +++ b/src/libs/zbxsysinfo/aix/proc.c @@ -59,7 +59,7 @@ int PROC_MEMORY(const char *cmd, const char *param, unsigned flags, AGENT_RE assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) { @@ -313,7 +313,7 @@ int PROC_NUM(const char *cmd, const char *param, unsigned flags, AGENT_RESUL assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) diff --git a/src/libs/zbxsysinfo/aix/sensors.c b/src/libs/zbxsysinfo/aix/sensors.c index 956ca3d1..4ef03c39 100644 --- a/src/libs/zbxsysinfo/aix/sensors.c +++ b/src/libs/zbxsysinfo/aix/sensors.c @@ -37,7 +37,7 @@ static int SENSOR_TEMP1(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); dir=opendir("/proc/sys/dev/sensors"); if(NULL == dir) @@ -92,7 +92,7 @@ static int SENSOR_TEMP2(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); dir=opendir("/proc/sys/dev/sensors"); if(NULL == dir) @@ -147,7 +147,7 @@ static int SENSOR_TEMP3(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); dir=opendir("/proc/sys/dev/sensors"); if(NULL == dir) @@ -196,7 +196,7 @@ int OLD_SENSOR(const char *cmd, const char *param, unsigned flags, AGENT_RES assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/aix/swap.c b/src/libs/zbxsysinfo/aix/swap.c index 85e0979c..ac899d88 100644 --- a/src/libs/zbxsysinfo/aix/swap.c +++ b/src/libs/zbxsysinfo/aix/swap.c @@ -98,7 +98,7 @@ static int SYSTEM_SWAP_FREE(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -121,7 +121,7 @@ static int SYSTEM_SWAP_FREE(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); get_swapinfo(&swaptotal,&swapfree); @@ -131,7 +131,7 @@ static int SYSTEM_SWAP_FREE(const char *cmd, const char *param, unsigned flags, #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -145,7 +145,7 @@ static int SYSTEM_SWAP_TOTAL(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -168,7 +168,7 @@ static int SYSTEM_SWAP_TOTAL(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); get_swapinfo(&swaptotal,&swapfree); @@ -178,7 +178,7 @@ static int SYSTEM_SWAP_TOTAL(const char *cmd, const char *param, unsigned flags, #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -208,7 +208,7 @@ SWP_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { @@ -260,7 +260,7 @@ int OLD_SWAP(const char *cmd, const char *param, unsigned flags, AGENT_RESUL assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/aix/uptime.c b/src/libs/zbxsysinfo/aix/uptime.c index a38b2bd7..f05c6ab7 100644 --- a/src/libs/zbxsysinfo/aix/uptime.c +++ b/src/libs/zbxsysinfo/aix/uptime.c @@ -29,7 +29,7 @@ int SYSTEM_UPTIME(const char *cmd, const char *param, unsigned flags, AGENT_RESU assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -49,7 +49,7 @@ int SYSTEM_UPTIME(const char *cmd, const char *param, unsigned flags, AGENT_RESU assert(result); - clean_result(result); + init_result(result); mib[0]=CTL_KERN; mib[1]=KERN_BOOTTIME; @@ -78,7 +78,7 @@ int SYSTEM_UPTIME(const char *cmd, const char *param, unsigned flags, AGENT_RESU assert(result); - clean_result(result); + init_result(result); hz = sysconf(_SC_CLK_TCK); @@ -113,7 +113,7 @@ int SYSTEM_UPTIME(const char *cmd, const char *param, unsigned flags, AGENT_RESU #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif diff --git a/src/libs/zbxsysinfo/common/common.c b/src/libs/zbxsysinfo/common/common.c index a889de79..64c54041 100644 --- a/src/libs/zbxsysinfo/common/common.c +++ b/src/libs/zbxsysinfo/common/common.c @@ -225,13 +225,17 @@ void free_result(AGENT_RESULT *result) result->msg = NULL; } free_list(&(result->list)); + + init_result(result); } -void clean_result(AGENT_RESULT *result) +void init_result(AGENT_RESULT *result) { - free_result(result); + result->str = NULL; + result->msg = NULL; result->type = 0; result->dbl = 0; + result->ui64 = 0; } int parse_command( @@ -326,7 +330,7 @@ int process(const char *in_command, unsigned flags, AGENT_RESULT *result) assert(result); - clean_result(result); + init_result(result); strncpy(usr_command, in_command, MAX_STRING_LEN); usr_command_len = strlen(usr_command); @@ -405,7 +409,7 @@ int process(const char *in_command, unsigned flags, AGENT_RESULT *result) result->type |= AR_MESSAGE; result->msg = strdup("ZBX_NOTSUPPORTED"); } - ret = FAIL; + ret = NOTSUPPORTED; } else if(err == TIMEOUT_ERROR) { @@ -414,7 +418,7 @@ int process(const char *in_command, unsigned flags, AGENT_RESULT *result) result->type |= AR_MESSAGE; result->msg = strdup("ZBX_ERROR"); } - ret = FAIL; + ret = TIMEOUT_ERROR; } return ret; @@ -438,7 +442,7 @@ int VFS_FILE_MD5SUM(const char *cmd, const char *param, unsigned flags, AGENT_RE assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { @@ -567,7 +571,7 @@ int VFS_FILE_CKSUM(const char *cmd, const char *param, unsigned flags, AGENT_RES assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { @@ -646,7 +650,7 @@ int get_stat(const char *key, unsigned flags, AGENT_RESULT *result) assert(result); - clean_result(result); + init_result(result); f=fopen("/tmp/zabbix_agentd.tmp","r"); if(f==NULL) @@ -735,7 +739,7 @@ int TCP_LISTEN(const char *cmd, const char *param, unsigned flags, AGENT_RESULT assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { @@ -787,7 +791,7 @@ int getPROC(char *file, int lineno, int fieldno, unsigned flags, AGENT_RESULT *r assert(result); - clean_result(result); + init_result(result); f=fopen(file,"r"); if(NULL == f) @@ -816,7 +820,7 @@ int AGENT_PING(const char *cmd, const char *param, unsigned flags, AGENT_RESULT { assert(result); - clean_result(result); + init_result(result); result->type |= AR_UINT64; result->ui64 = 1; @@ -830,7 +834,7 @@ int PROCCOUNT(const char *cmd, const char *param, unsigned flags, AGENT_RESULT * assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -856,7 +860,7 @@ int PROCCOUNT(const char *cmd, const char *param, unsigned flags, AGENT_RESULT * int proccount=0; assert(result); - clean_result(result); + init_result(result); dir=opendir("/proc"); if(NULL == dir) @@ -912,7 +916,7 @@ int PROCCOUNT(const char *cmd, const char *param, unsigned flags, AGENT_RESULT * assert(result); - clean_result(result); + init_result(result); dir=opendir("/proc"); if(NULL == dir) @@ -960,7 +964,7 @@ int AGENT_VERSION(const char *cmd, const char *param, unsigned flags, AGENT_RESU assert(result); - clean_result(result); + init_result(result); result->type |= AR_STRING; result->str = strdup(version); @@ -975,7 +979,7 @@ int OLD_VERSION(const char *cmd, const char *param, unsigned flags, AGENT_RE assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { @@ -1008,7 +1012,7 @@ int EXECUTE_STR(const char *cmd, const char *param, unsigned flags, AGENT_RESULT assert(result); - clean_result(result); + init_result(result); strncpy(command, param, MAX_STRING_LEN); @@ -1079,7 +1083,7 @@ int EXECUTE(const char *cmd, const char *command, unsigned flags, AGENT_RESULT * assert(result); - clean_result(result); + init_result(result); f=popen( command,"r"); if(f==0) @@ -1142,7 +1146,7 @@ int forward_request(char *proxy, char *command, int port, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); host = gethostbyname(proxy); if(host == NULL) @@ -1442,7 +1446,7 @@ int CHECK_SERVICE_PERF(const char *cmd, const char *service_and_ip_and_port, uns assert(result); - clean_result(result); + init_result(result); gettimeofday(&t1,&tz1); @@ -1567,7 +1571,7 @@ int CHECK_SERVICE(const char *cmd, const char *service_and_ip_and_port, unsigned assert(result); - clean_result(result); + init_result(result); /* Default IP address */ strscpy(ip,"127.0.0.1"); @@ -1723,7 +1727,7 @@ int CHECK_PORT(const char *cmd, const char *ip_and_port, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); c=strchr(ip_and_port,','); strscpy(ip,ip_and_port); @@ -1761,7 +1765,7 @@ int CHECK_DNS(const char *cmd, const char *ip_and_zone, unsigned flags, AGENT_RE assert(result); - clean_result(result); + init_result(result); memset(&ip, 0, MAX_STRING_LEN); memset(&zone, 0, MAX_STRING_LEN); @@ -1838,7 +1842,7 @@ int SYSTEM_UNUM(const char *cmd, const char *param, unsigned flags, AGENT_RE { assert(result); - clean_result(result); + init_result(result); return EXECUTE(cmd, "who|wc -l", flags, result); } @@ -1847,7 +1851,7 @@ int SYSTEM_UNAME(const char *cmd, const char *param, unsigned flags, AGENT_R { assert(result); - clean_result(result); + init_result(result); return EXECUTE_STR(cmd, "uname -a", flags, result); } @@ -1856,7 +1860,7 @@ int SYSTEM_HOSTNAME(const char *cmd, const char *param, unsigned flags, AGEN { assert(result); - clean_result(result); + init_result(result); return EXECUTE_STR(cmd, "hostname", flags, result); } @@ -1868,7 +1872,7 @@ int OLD_SYSTEM(const char *cmd, const char *param, unsigned flags, AGENT_RES assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/common/file.c b/src/libs/zbxsysinfo/common/file.c index d86ae2b9..8b627dcc 100644 --- a/src/libs/zbxsysinfo/common/file.c +++ b/src/libs/zbxsysinfo/common/file.c @@ -30,7 +30,7 @@ int VFS_FILE_SIZE(const char *cmd, const char *param, unsigned flags, AGENT_RESU assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { @@ -58,7 +58,7 @@ int VFS_FILE_ATIME(const char *cmd, const char *param, unsigned flags, AGENT_RES assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { @@ -86,7 +86,7 @@ int VFS_FILE_CTIME(const char *cmd, const char *param, unsigned flags, AGENT_RES assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { @@ -114,7 +114,7 @@ int VFS_FILE_MTIME(const char *cmd, const char *param, unsigned flags, AGENT_RES assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { @@ -142,7 +142,7 @@ int VFS_FILE_EXISTS(const char *cmd, const char *param, unsigned flags, AGENT_RE assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { @@ -182,7 +182,7 @@ int VFS_FILE_REGEXP(const char *cmd, const char *param, unsigned flags, AGENT_RE assert(result); - clean_result(result); + init_result(result); memset(tmp,0,MAX_STRING_LEN); @@ -270,7 +270,7 @@ int VFS_FILE_REGMATCH(const char *cmd, const char *param, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); if(get_param(param, 1, filename, MAX_STRING_LEN) != 0) { diff --git a/src/libs/zbxsysinfo/common/system.c b/src/libs/zbxsysinfo/common/system.c index 6f4c0d15..cb4227a2 100644 --- a/src/libs/zbxsysinfo/common/system.c +++ b/src/libs/zbxsysinfo/common/system.c @@ -28,7 +28,7 @@ int SYSTEM_LOCALTIME(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); result->type |= AR_UINT64; result->ui64 = (zbx_uint64_t)time(NULL); diff --git a/src/libs/zbxsysinfo/freebsd/cpu.c b/src/libs/zbxsysinfo/freebsd/cpu.c index f45b39db..157ab650 100644 --- a/src/libs/zbxsysinfo/freebsd/cpu.c +++ b/src/libs/zbxsysinfo/freebsd/cpu.c @@ -121,7 +121,7 @@ CPU_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) { @@ -217,7 +217,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if(getloadavg(load, 3)) { @@ -235,7 +235,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if (pstat_getdynamic(&dyn, sizeof(dyn), 1, 0) == -1) { @@ -258,7 +258,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if (!kc && !(kc = kstat_open())) { @@ -279,7 +279,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if(getloadavg_kmem(loadavg,3) == FAIL) { @@ -292,7 +292,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif #endif @@ -308,7 +308,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if(getloadavg(load, 3)) { @@ -326,7 +326,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if (pstat_getdynamic(&dyn, sizeof(dyn), 1, 0) == -1) { @@ -349,7 +349,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if (!kc && !(kc = kstat_open())) { @@ -370,7 +370,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if(getloadavg_kmem(loadavg,3) == FAIL) { @@ -383,7 +383,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif #endif @@ -399,7 +399,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); if(getloadavg(load, 3)) { @@ -417,7 +417,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); if (pstat_getdynamic(&dyn, sizeof(dyn), 1, 0) == -1) { @@ -440,7 +440,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); if (!kc && !(kc = kstat_open())) { @@ -461,7 +461,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); if(getloadavg_kmem(loadavg,3) == FAIL) { @@ -474,7 +474,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif #endif @@ -507,7 +507,7 @@ CPU_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { @@ -552,7 +552,7 @@ int SYSTEM_CPU_SWITCHES(const char *cmd, const char *param, unsigned flags, { assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } @@ -561,7 +561,7 @@ int SYSTEM_CPU_INTR(const char *cmd, const char *param, unsigned flags, AGEN { assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } diff --git a/src/libs/zbxsysinfo/freebsd/diskio.c b/src/libs/zbxsysinfo/freebsd/diskio.c index 23d0c450..333b177a 100644 --- a/src/libs/zbxsysinfo/freebsd/diskio.c +++ b/src/libs/zbxsysinfo/freebsd/diskio.c @@ -159,7 +159,7 @@ DEV_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) { @@ -235,7 +235,7 @@ DEV_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) { @@ -334,7 +334,7 @@ int OLD_IO(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *res assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/freebsd/diskspace.c b/src/libs/zbxsysinfo/freebsd/diskspace.c index e2120ac6..81fd7e8e 100644 --- a/src/libs/zbxsysinfo/freebsd/diskspace.c +++ b/src/libs/zbxsysinfo/freebsd/diskspace.c @@ -66,7 +66,7 @@ static int VFS_FS_USED(const char *cmd, const char *param, unsigned flags, AGENT assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -90,7 +90,7 @@ static int VFS_FS_FREE(const char *cmd, const char *param, unsigned flags, AGENT assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -114,7 +114,7 @@ static int VFS_FS_TOTAL(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -142,7 +142,7 @@ static int VFS_FS_PFREE(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -167,7 +167,7 @@ static int VFS_FS_PUSED(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -210,7 +210,7 @@ FS_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { diff --git a/src/libs/zbxsysinfo/freebsd/inodes.c b/src/libs/zbxsysinfo/freebsd/inodes.c index b1283d4c..c17c58e7 100644 --- a/src/libs/zbxsysinfo/freebsd/inodes.c +++ b/src/libs/zbxsysinfo/freebsd/inodes.c @@ -52,7 +52,7 @@ static int VFS_FS_INODE_USED(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -76,7 +76,7 @@ static int VFS_FS_INODE_FREE(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -100,7 +100,7 @@ static int VFS_FS_INODE_TOTAL(const char *cmd, const char *param, unsigned flags assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -127,7 +127,7 @@ static int VFS_FS_INODE_PFREE(const char *cmd, const char *param, unsigned flags assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -152,7 +152,7 @@ static int VFS_FS_INODE_PUSED(const char *cmd, const char *param, unsigned flags assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -195,7 +195,7 @@ FS_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { diff --git a/src/libs/zbxsysinfo/freebsd/kernel.c b/src/libs/zbxsysinfo/freebsd/kernel.c index 14157f22..84c5067b 100644 --- a/src/libs/zbxsysinfo/freebsd/kernel.c +++ b/src/libs/zbxsysinfo/freebsd/kernel.c @@ -30,7 +30,7 @@ int KERNEL_MAXFILES(const char *cmd, const char *param, unsigned flags, AGENT_RE assert(result); - clean_result(result); + init_result(result); mib[0]=CTL_KERN; mib[1]=KERN_MAXFILES; @@ -58,7 +58,7 @@ int KERNEL_MAXPROC(const char *cmd, const char *param, unsigned flags, AGENT_RES assert(result); - clean_result(result); + init_result(result); mib[0]=CTL_KERN; mib[1]=KERN_MAXPROC; @@ -86,7 +86,7 @@ int OLD_KERNEL(const char *cmd, const char *param, unsigned flags, AGENT_RES assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/freebsd/memory.c b/src/libs/zbxsysinfo/freebsd/memory.c index 7dc0fcbe..2feba4e8 100644 --- a/src/libs/zbxsysinfo/freebsd/memory.c +++ b/src/libs/zbxsysinfo/freebsd/memory.c @@ -36,7 +36,7 @@ static int VM_MEMORY_CACHED(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); f=fopen("/proc/meminfo","r"); if(NULL == f) @@ -61,7 +61,7 @@ static int VM_MEMORY_CACHED(const char *cmd, const char *param, unsigned flags, #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -74,7 +74,7 @@ static int VM_MEMORY_BUFFERS(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -93,7 +93,7 @@ static int VM_MEMORY_BUFFERS(const char *cmd, const char *param, unsigned flags, #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -106,7 +106,7 @@ static int VM_MEMORY_SHARED(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -128,7 +128,7 @@ static int VM_MEMORY_SHARED(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); len=sizeof(struct vmtotal); mib[0]=CTL_VM; @@ -150,7 +150,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A #ifdef HAVE_UNISTD_SYSCONF assert(result); - clean_result(result); + init_result(result); result->type |= AR_DOUBLE; result->dbl=(double)sysconf(_SC_PHYS_PAGES)*sysconf(_SC_PAGESIZE); @@ -161,7 +161,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A assert(result); - clean_result(result); + init_result(result); if(pstat_getstatic(&pst, sizeof(pst), (size_t)1, 0) == -1) { @@ -181,7 +181,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -203,7 +203,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A assert(result); - clean_result(result); + init_result(result); len=sizeof(struct vmtotal); mib[0]=CTL_VM; @@ -222,7 +222,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A assert(result); - clean_result(result); + init_result(result); len=sizeof(memory); @@ -240,7 +240,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -252,7 +252,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG #ifdef HAVE_UNISTD_SYSCONF assert(result); - clean_result(result); + init_result(result); result->type |= AR_DOUBLE; result->dbl=(double)sysconf(_SC_AVPHYS_PAGES)*sysconf(_SC_PAGESIZE); @@ -264,7 +264,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG assert(result); - clean_result(result); + init_result(result); if(pstat_getstatic(&pst, sizeof(pst), (size_t)1, 0) == -1) { @@ -304,7 +304,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -326,7 +326,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG assert(result); - clean_result(result); + init_result(result); len=sizeof(struct vmtotal); mib[0]=CTL_VM; @@ -347,7 +347,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG assert(result); - clean_result(result); + init_result(result); pagesize = 0; kret = host_page_size (mach_host_self(), &pagesize); @@ -378,7 +378,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -407,7 +407,7 @@ MEM_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/freebsd/net.c b/src/libs/zbxsysinfo/freebsd/net.c index 54c81126..851be786 100644 --- a/src/libs/zbxsysinfo/freebsd/net.c +++ b/src/libs/zbxsysinfo/freebsd/net.c @@ -27,7 +27,7 @@ int NET_IF_IN(const char *cmd, const char *param, unsigned flags, AGENT_RESULT * assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } @@ -37,7 +37,7 @@ int NET_IF_OUT(const char *cmd, const char *param, unsigned flags, AGENT_RESULT assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } @@ -46,7 +46,7 @@ int NET_TCP_LISTEN(const char *cmd, const char *param, unsigned flags, AGENT { assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } @@ -55,7 +55,7 @@ int NET_IF_COLLISIONS(const char *cmd, const char *param, unsigned flags, AG { assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } diff --git a/src/libs/zbxsysinfo/freebsd/proc.c b/src/libs/zbxsysinfo/freebsd/proc.c index 5153605c..0bcd31dc 100644 --- a/src/libs/zbxsysinfo/freebsd/proc.c +++ b/src/libs/zbxsysinfo/freebsd/proc.c @@ -59,7 +59,7 @@ int PROC_MEMORY(const char *cmd, const char *param, unsigned flags, AGENT_RE assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) { @@ -313,7 +313,7 @@ int PROC_NUM(const char *cmd, const char *param, unsigned flags, AGENT_RESUL assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) diff --git a/src/libs/zbxsysinfo/freebsd/sensors.c b/src/libs/zbxsysinfo/freebsd/sensors.c index 956ca3d1..4ef03c39 100644 --- a/src/libs/zbxsysinfo/freebsd/sensors.c +++ b/src/libs/zbxsysinfo/freebsd/sensors.c @@ -37,7 +37,7 @@ static int SENSOR_TEMP1(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); dir=opendir("/proc/sys/dev/sensors"); if(NULL == dir) @@ -92,7 +92,7 @@ static int SENSOR_TEMP2(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); dir=opendir("/proc/sys/dev/sensors"); if(NULL == dir) @@ -147,7 +147,7 @@ static int SENSOR_TEMP3(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); dir=opendir("/proc/sys/dev/sensors"); if(NULL == dir) @@ -196,7 +196,7 @@ int OLD_SENSOR(const char *cmd, const char *param, unsigned flags, AGENT_RES assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/freebsd/swap.c b/src/libs/zbxsysinfo/freebsd/swap.c index 85e0979c..ac899d88 100644 --- a/src/libs/zbxsysinfo/freebsd/swap.c +++ b/src/libs/zbxsysinfo/freebsd/swap.c @@ -98,7 +98,7 @@ static int SYSTEM_SWAP_FREE(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -121,7 +121,7 @@ static int SYSTEM_SWAP_FREE(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); get_swapinfo(&swaptotal,&swapfree); @@ -131,7 +131,7 @@ static int SYSTEM_SWAP_FREE(const char *cmd, const char *param, unsigned flags, #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -145,7 +145,7 @@ static int SYSTEM_SWAP_TOTAL(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -168,7 +168,7 @@ static int SYSTEM_SWAP_TOTAL(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); get_swapinfo(&swaptotal,&swapfree); @@ -178,7 +178,7 @@ static int SYSTEM_SWAP_TOTAL(const char *cmd, const char *param, unsigned flags, #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -208,7 +208,7 @@ SWP_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { @@ -260,7 +260,7 @@ int OLD_SWAP(const char *cmd, const char *param, unsigned flags, AGENT_RESUL assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/freebsd/uptime.c b/src/libs/zbxsysinfo/freebsd/uptime.c index a38b2bd7..f05c6ab7 100644 --- a/src/libs/zbxsysinfo/freebsd/uptime.c +++ b/src/libs/zbxsysinfo/freebsd/uptime.c @@ -29,7 +29,7 @@ int SYSTEM_UPTIME(const char *cmd, const char *param, unsigned flags, AGENT_RESU assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -49,7 +49,7 @@ int SYSTEM_UPTIME(const char *cmd, const char *param, unsigned flags, AGENT_RESU assert(result); - clean_result(result); + init_result(result); mib[0]=CTL_KERN; mib[1]=KERN_BOOTTIME; @@ -78,7 +78,7 @@ int SYSTEM_UPTIME(const char *cmd, const char *param, unsigned flags, AGENT_RESU assert(result); - clean_result(result); + init_result(result); hz = sysconf(_SC_CLK_TCK); @@ -113,7 +113,7 @@ int SYSTEM_UPTIME(const char *cmd, const char *param, unsigned flags, AGENT_RESU #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif diff --git a/src/libs/zbxsysinfo/hpux/cpu.c b/src/libs/zbxsysinfo/hpux/cpu.c index f45b39db..157ab650 100644 --- a/src/libs/zbxsysinfo/hpux/cpu.c +++ b/src/libs/zbxsysinfo/hpux/cpu.c @@ -121,7 +121,7 @@ CPU_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) { @@ -217,7 +217,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if(getloadavg(load, 3)) { @@ -235,7 +235,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if (pstat_getdynamic(&dyn, sizeof(dyn), 1, 0) == -1) { @@ -258,7 +258,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if (!kc && !(kc = kstat_open())) { @@ -279,7 +279,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if(getloadavg_kmem(loadavg,3) == FAIL) { @@ -292,7 +292,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif #endif @@ -308,7 +308,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if(getloadavg(load, 3)) { @@ -326,7 +326,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if (pstat_getdynamic(&dyn, sizeof(dyn), 1, 0) == -1) { @@ -349,7 +349,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if (!kc && !(kc = kstat_open())) { @@ -370,7 +370,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if(getloadavg_kmem(loadavg,3) == FAIL) { @@ -383,7 +383,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif #endif @@ -399,7 +399,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); if(getloadavg(load, 3)) { @@ -417,7 +417,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); if (pstat_getdynamic(&dyn, sizeof(dyn), 1, 0) == -1) { @@ -440,7 +440,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); if (!kc && !(kc = kstat_open())) { @@ -461,7 +461,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); if(getloadavg_kmem(loadavg,3) == FAIL) { @@ -474,7 +474,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif #endif @@ -507,7 +507,7 @@ CPU_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { @@ -552,7 +552,7 @@ int SYSTEM_CPU_SWITCHES(const char *cmd, const char *param, unsigned flags, { assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } @@ -561,7 +561,7 @@ int SYSTEM_CPU_INTR(const char *cmd, const char *param, unsigned flags, AGEN { assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } diff --git a/src/libs/zbxsysinfo/hpux/diskio.c b/src/libs/zbxsysinfo/hpux/diskio.c index 23d0c450..333b177a 100644 --- a/src/libs/zbxsysinfo/hpux/diskio.c +++ b/src/libs/zbxsysinfo/hpux/diskio.c @@ -159,7 +159,7 @@ DEV_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) { @@ -235,7 +235,7 @@ DEV_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) { @@ -334,7 +334,7 @@ int OLD_IO(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *res assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/hpux/diskspace.c b/src/libs/zbxsysinfo/hpux/diskspace.c index e2120ac6..81fd7e8e 100644 --- a/src/libs/zbxsysinfo/hpux/diskspace.c +++ b/src/libs/zbxsysinfo/hpux/diskspace.c @@ -66,7 +66,7 @@ static int VFS_FS_USED(const char *cmd, const char *param, unsigned flags, AGENT assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -90,7 +90,7 @@ static int VFS_FS_FREE(const char *cmd, const char *param, unsigned flags, AGENT assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -114,7 +114,7 @@ static int VFS_FS_TOTAL(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -142,7 +142,7 @@ static int VFS_FS_PFREE(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -167,7 +167,7 @@ static int VFS_FS_PUSED(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -210,7 +210,7 @@ FS_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { diff --git a/src/libs/zbxsysinfo/hpux/inodes.c b/src/libs/zbxsysinfo/hpux/inodes.c index 7a81d6e6..8f89286b 100644 --- a/src/libs/zbxsysinfo/hpux/inodes.c +++ b/src/libs/zbxsysinfo/hpux/inodes.c @@ -66,7 +66,7 @@ static int VFS_FS_INODE_USED(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -90,7 +90,7 @@ static int VFS_FS_INODE_FREE(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -114,7 +114,7 @@ static int VFS_FS_INODE_TOTAL(const char *cmd, const char *param, unsigned flags assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -141,7 +141,7 @@ static int VFS_FS_INODE_PFREE(const char *cmd, const char *param, unsigned flags assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -166,7 +166,7 @@ static int VFS_FS_INODE_PUSED(const char *cmd, const char *param, unsigned flags assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -209,7 +209,7 @@ FS_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { diff --git a/src/libs/zbxsysinfo/hpux/kernel.c b/src/libs/zbxsysinfo/hpux/kernel.c index 14157f22..84c5067b 100644 --- a/src/libs/zbxsysinfo/hpux/kernel.c +++ b/src/libs/zbxsysinfo/hpux/kernel.c @@ -30,7 +30,7 @@ int KERNEL_MAXFILES(const char *cmd, const char *param, unsigned flags, AGENT_RE assert(result); - clean_result(result); + init_result(result); mib[0]=CTL_KERN; mib[1]=KERN_MAXFILES; @@ -58,7 +58,7 @@ int KERNEL_MAXPROC(const char *cmd, const char *param, unsigned flags, AGENT_RES assert(result); - clean_result(result); + init_result(result); mib[0]=CTL_KERN; mib[1]=KERN_MAXPROC; @@ -86,7 +86,7 @@ int OLD_KERNEL(const char *cmd, const char *param, unsigned flags, AGENT_RES assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/hpux/memory.c b/src/libs/zbxsysinfo/hpux/memory.c index 7dc0fcbe..2feba4e8 100644 --- a/src/libs/zbxsysinfo/hpux/memory.c +++ b/src/libs/zbxsysinfo/hpux/memory.c @@ -36,7 +36,7 @@ static int VM_MEMORY_CACHED(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); f=fopen("/proc/meminfo","r"); if(NULL == f) @@ -61,7 +61,7 @@ static int VM_MEMORY_CACHED(const char *cmd, const char *param, unsigned flags, #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -74,7 +74,7 @@ static int VM_MEMORY_BUFFERS(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -93,7 +93,7 @@ static int VM_MEMORY_BUFFERS(const char *cmd, const char *param, unsigned flags, #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -106,7 +106,7 @@ static int VM_MEMORY_SHARED(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -128,7 +128,7 @@ static int VM_MEMORY_SHARED(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); len=sizeof(struct vmtotal); mib[0]=CTL_VM; @@ -150,7 +150,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A #ifdef HAVE_UNISTD_SYSCONF assert(result); - clean_result(result); + init_result(result); result->type |= AR_DOUBLE; result->dbl=(double)sysconf(_SC_PHYS_PAGES)*sysconf(_SC_PAGESIZE); @@ -161,7 +161,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A assert(result); - clean_result(result); + init_result(result); if(pstat_getstatic(&pst, sizeof(pst), (size_t)1, 0) == -1) { @@ -181,7 +181,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -203,7 +203,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A assert(result); - clean_result(result); + init_result(result); len=sizeof(struct vmtotal); mib[0]=CTL_VM; @@ -222,7 +222,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A assert(result); - clean_result(result); + init_result(result); len=sizeof(memory); @@ -240,7 +240,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -252,7 +252,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG #ifdef HAVE_UNISTD_SYSCONF assert(result); - clean_result(result); + init_result(result); result->type |= AR_DOUBLE; result->dbl=(double)sysconf(_SC_AVPHYS_PAGES)*sysconf(_SC_PAGESIZE); @@ -264,7 +264,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG assert(result); - clean_result(result); + init_result(result); if(pstat_getstatic(&pst, sizeof(pst), (size_t)1, 0) == -1) { @@ -304,7 +304,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -326,7 +326,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG assert(result); - clean_result(result); + init_result(result); len=sizeof(struct vmtotal); mib[0]=CTL_VM; @@ -347,7 +347,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG assert(result); - clean_result(result); + init_result(result); pagesize = 0; kret = host_page_size (mach_host_self(), &pagesize); @@ -378,7 +378,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -407,7 +407,7 @@ MEM_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/hpux/net.c b/src/libs/zbxsysinfo/hpux/net.c index 54c81126..851be786 100644 --- a/src/libs/zbxsysinfo/hpux/net.c +++ b/src/libs/zbxsysinfo/hpux/net.c @@ -27,7 +27,7 @@ int NET_IF_IN(const char *cmd, const char *param, unsigned flags, AGENT_RESULT * assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } @@ -37,7 +37,7 @@ int NET_IF_OUT(const char *cmd, const char *param, unsigned flags, AGENT_RESULT assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } @@ -46,7 +46,7 @@ int NET_TCP_LISTEN(const char *cmd, const char *param, unsigned flags, AGENT { assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } @@ -55,7 +55,7 @@ int NET_IF_COLLISIONS(const char *cmd, const char *param, unsigned flags, AG { assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } diff --git a/src/libs/zbxsysinfo/hpux/proc.c b/src/libs/zbxsysinfo/hpux/proc.c index 5153605c..0bcd31dc 100644 --- a/src/libs/zbxsysinfo/hpux/proc.c +++ b/src/libs/zbxsysinfo/hpux/proc.c @@ -59,7 +59,7 @@ int PROC_MEMORY(const char *cmd, const char *param, unsigned flags, AGENT_RE assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) { @@ -313,7 +313,7 @@ int PROC_NUM(const char *cmd, const char *param, unsigned flags, AGENT_RESUL assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) diff --git a/src/libs/zbxsysinfo/hpux/sensors.c b/src/libs/zbxsysinfo/hpux/sensors.c index 956ca3d1..4ef03c39 100644 --- a/src/libs/zbxsysinfo/hpux/sensors.c +++ b/src/libs/zbxsysinfo/hpux/sensors.c @@ -37,7 +37,7 @@ static int SENSOR_TEMP1(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); dir=opendir("/proc/sys/dev/sensors"); if(NULL == dir) @@ -92,7 +92,7 @@ static int SENSOR_TEMP2(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); dir=opendir("/proc/sys/dev/sensors"); if(NULL == dir) @@ -147,7 +147,7 @@ static int SENSOR_TEMP3(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); dir=opendir("/proc/sys/dev/sensors"); if(NULL == dir) @@ -196,7 +196,7 @@ int OLD_SENSOR(const char *cmd, const char *param, unsigned flags, AGENT_RES assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/hpux/swap.c b/src/libs/zbxsysinfo/hpux/swap.c index 85e0979c..ac899d88 100644 --- a/src/libs/zbxsysinfo/hpux/swap.c +++ b/src/libs/zbxsysinfo/hpux/swap.c @@ -98,7 +98,7 @@ static int SYSTEM_SWAP_FREE(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -121,7 +121,7 @@ static int SYSTEM_SWAP_FREE(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); get_swapinfo(&swaptotal,&swapfree); @@ -131,7 +131,7 @@ static int SYSTEM_SWAP_FREE(const char *cmd, const char *param, unsigned flags, #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -145,7 +145,7 @@ static int SYSTEM_SWAP_TOTAL(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -168,7 +168,7 @@ static int SYSTEM_SWAP_TOTAL(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); get_swapinfo(&swaptotal,&swapfree); @@ -178,7 +178,7 @@ static int SYSTEM_SWAP_TOTAL(const char *cmd, const char *param, unsigned flags, #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -208,7 +208,7 @@ SWP_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { @@ -260,7 +260,7 @@ int OLD_SWAP(const char *cmd, const char *param, unsigned flags, AGENT_RESUL assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/hpux/uptime.c b/src/libs/zbxsysinfo/hpux/uptime.c index a38b2bd7..f05c6ab7 100644 --- a/src/libs/zbxsysinfo/hpux/uptime.c +++ b/src/libs/zbxsysinfo/hpux/uptime.c @@ -29,7 +29,7 @@ int SYSTEM_UPTIME(const char *cmd, const char *param, unsigned flags, AGENT_RESU assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -49,7 +49,7 @@ int SYSTEM_UPTIME(const char *cmd, const char *param, unsigned flags, AGENT_RESU assert(result); - clean_result(result); + init_result(result); mib[0]=CTL_KERN; mib[1]=KERN_BOOTTIME; @@ -78,7 +78,7 @@ int SYSTEM_UPTIME(const char *cmd, const char *param, unsigned flags, AGENT_RESU assert(result); - clean_result(result); + init_result(result); hz = sysconf(_SC_CLK_TCK); @@ -113,7 +113,7 @@ int SYSTEM_UPTIME(const char *cmd, const char *param, unsigned flags, AGENT_RESU #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif diff --git a/src/libs/zbxsysinfo/linux/cpu.c b/src/libs/zbxsysinfo/linux/cpu.c index 213e7f03..34a2e261 100644 --- a/src/libs/zbxsysinfo/linux/cpu.c +++ b/src/libs/zbxsysinfo/linux/cpu.c @@ -121,7 +121,7 @@ CPU_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) { @@ -217,7 +217,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if(getloadavg(load, 3)) { @@ -235,7 +235,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if (pstat_getdynamic(&dyn, sizeof(dyn), 1, 0) == -1) { @@ -258,7 +258,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if (!kc && !(kc = kstat_open())) { @@ -279,7 +279,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if(getloadavg_kmem(loadavg,3) == FAIL) { @@ -292,7 +292,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif #endif @@ -308,7 +308,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if(getloadavg(load, 3)) { @@ -326,7 +326,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if (pstat_getdynamic(&dyn, sizeof(dyn), 1, 0) == -1) { @@ -349,7 +349,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if (!kc && !(kc = kstat_open())) { @@ -370,7 +370,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if(getloadavg_kmem(loadavg,3) == FAIL) { @@ -383,7 +383,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif #endif @@ -399,7 +399,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); if(getloadavg(load, 3)) { @@ -417,7 +417,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); if (pstat_getdynamic(&dyn, sizeof(dyn), 1, 0) == -1) { @@ -440,7 +440,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); if (!kc && !(kc = kstat_open())) { @@ -461,7 +461,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); if(getloadavg_kmem(loadavg,3) == FAIL) { @@ -474,7 +474,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif #endif @@ -507,7 +507,7 @@ CPU_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { @@ -552,7 +552,7 @@ int SYSTEM_CPU_SWITCHES(const char *cmd, const char *param, unsigned flags, { assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } @@ -569,7 +569,7 @@ int SYSTEM_CPU_INTR(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); f=fopen("/proc/stat","r"); if(f) diff --git a/src/libs/zbxsysinfo/linux/diskio.c b/src/libs/zbxsysinfo/linux/diskio.c index 3b8aed74..ffa65063 100644 --- a/src/libs/zbxsysinfo/linux/diskio.c +++ b/src/libs/zbxsysinfo/linux/diskio.c @@ -130,7 +130,7 @@ int VFS_DEV_WRITE(const char *cmd, const char *param, unsigned flags, AGENT_RESU assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { @@ -187,7 +187,7 @@ int VFS_DEV_READ(const char *cmd, const char *param, unsigned flags, AGENT_RESUL assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { @@ -287,7 +287,7 @@ int OLD_IO(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *res assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/linux/diskspace.c b/src/libs/zbxsysinfo/linux/diskspace.c index ce308cf9..a062e283 100644 --- a/src/libs/zbxsysinfo/linux/diskspace.c +++ b/src/libs/zbxsysinfo/linux/diskspace.c @@ -66,7 +66,7 @@ static int VFS_FS_USED(const char *cmd, const char *param, unsigned flags, AGENT assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -90,7 +90,7 @@ static int VFS_FS_FREE(const char *cmd, const char *param, unsigned flags, AGENT assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -114,7 +114,7 @@ static int VFS_FS_TOTAL(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -142,7 +142,7 @@ static int VFS_FS_PFREE(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -167,7 +167,7 @@ static int VFS_FS_PUSED(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -210,7 +210,7 @@ FS_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { diff --git a/src/libs/zbxsysinfo/linux/inodes.c b/src/libs/zbxsysinfo/linux/inodes.c index 277d573d..455ad4f5 100644 --- a/src/libs/zbxsysinfo/linux/inodes.c +++ b/src/libs/zbxsysinfo/linux/inodes.c @@ -66,7 +66,7 @@ static int VFS_FS_INODE_USED(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -90,7 +90,7 @@ static int VFS_FS_INODE_FREE(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -114,7 +114,7 @@ static int VFS_FS_INODE_TOTAL(const char *cmd, const char *param, unsigned flags assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -141,7 +141,7 @@ static int VFS_FS_INODE_PFREE(const char *cmd, const char *param, unsigned flags assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -166,7 +166,7 @@ static int VFS_FS_INODE_PUSED(const char *cmd, const char *param, unsigned flags assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -209,7 +209,7 @@ FS_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { diff --git a/src/libs/zbxsysinfo/linux/kernel.c b/src/libs/zbxsysinfo/linux/kernel.c index c6dc6f00..9f08a74f 100644 --- a/src/libs/zbxsysinfo/linux/kernel.c +++ b/src/libs/zbxsysinfo/linux/kernel.c @@ -33,7 +33,7 @@ int KERNEL_MAXFILES(const char *cmd, const char *param, unsigned flags, AGENT_RE assert(result); - clean_result(result); + init_result(result); f=fopen("/proc/sys/fs/file-max","r"); if(f) @@ -61,7 +61,7 @@ int KERNEL_MAXPROC(const char *cmd, const char *param, unsigned flags, AGENT_RES assert(result); - clean_result(result); + init_result(result); mib[0]=CTL_KERN; mib[1]=KERN_MAXPROC; @@ -89,7 +89,7 @@ int OLD_KERNEL(const char *cmd, const char *param, unsigned flags, AGENT_RES assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/linux/memory.c b/src/libs/zbxsysinfo/linux/memory.c index aa9cb8a5..8513c09b 100644 --- a/src/libs/zbxsysinfo/linux/memory.c +++ b/src/libs/zbxsysinfo/linux/memory.c @@ -35,7 +35,7 @@ static int VM_MEMORY_CACHED(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); f=fopen("/proc/meminfo","r"); if(NULL == f) @@ -66,7 +66,7 @@ static int VM_MEMORY_BUFFERS(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -85,7 +85,7 @@ static int VM_MEMORY_BUFFERS(const char *cmd, const char *param, unsigned flags, #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -98,7 +98,7 @@ static int VM_MEMORY_SHARED(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -120,7 +120,7 @@ static int VM_MEMORY_SHARED(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); len=sizeof(struct vmtotal); mib[0]=CTL_VM; @@ -142,7 +142,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A #ifdef HAVE_UNISTD_SYSCONF assert(result); - clean_result(result); + init_result(result); result->type |= AR_DOUBLE; result->dbl=(double)sysconf(_SC_PHYS_PAGES)*sysconf(_SC_PAGESIZE); @@ -153,7 +153,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A assert(result); - clean_result(result); + init_result(result); if(pstat_getstatic(&pst, sizeof(pst), (size_t)1, 0) == -1) { @@ -173,7 +173,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -195,7 +195,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A assert(result); - clean_result(result); + init_result(result); len=sizeof(struct vmtotal); mib[0]=CTL_VM; @@ -209,7 +209,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -222,7 +222,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -241,7 +241,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -270,7 +270,7 @@ MEM_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/linux/net.c b/src/libs/zbxsysinfo/linux/net.c index 26b343bb..6946a892 100644 --- a/src/libs/zbxsysinfo/linux/net.c +++ b/src/libs/zbxsysinfo/linux/net.c @@ -107,7 +107,7 @@ int NET_IF_IN(const char *cmd, const char *param, unsigned flags, AGENT_RESULT * assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { @@ -174,7 +174,7 @@ int NET_IF_OUT(const char *cmd, const char *param, unsigned flags, AGENT_RESULT assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { @@ -234,7 +234,7 @@ int NET_TCP_LISTEN(const char *cmd, const char *param, unsigned flags, AGENT { assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } @@ -249,7 +249,7 @@ int NET_IF_COLLISIONS(const char *cmd, const char *param, unsigned flags, AG assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/linux/proc.c b/src/libs/zbxsysinfo/linux/proc.c index 89c4c107..6129f1c5 100644 --- a/src/libs/zbxsysinfo/linux/proc.c +++ b/src/libs/zbxsysinfo/linux/proc.c @@ -59,7 +59,7 @@ int PROC_MEMORY(const char *cmd, const char *param, unsigned flags, AGENT_RE assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) { @@ -317,7 +317,7 @@ int PROC_NUM(const char *cmd, const char *param, unsigned flags, AGENT_RESUL assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) diff --git a/src/libs/zbxsysinfo/linux/sensors.c b/src/libs/zbxsysinfo/linux/sensors.c index 956ca3d1..4ef03c39 100644 --- a/src/libs/zbxsysinfo/linux/sensors.c +++ b/src/libs/zbxsysinfo/linux/sensors.c @@ -37,7 +37,7 @@ static int SENSOR_TEMP1(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); dir=opendir("/proc/sys/dev/sensors"); if(NULL == dir) @@ -92,7 +92,7 @@ static int SENSOR_TEMP2(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); dir=opendir("/proc/sys/dev/sensors"); if(NULL == dir) @@ -147,7 +147,7 @@ static int SENSOR_TEMP3(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); dir=opendir("/proc/sys/dev/sensors"); if(NULL == dir) @@ -196,7 +196,7 @@ int OLD_SENSOR(const char *cmd, const char *param, unsigned flags, AGENT_RES assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/linux/swap.c b/src/libs/zbxsysinfo/linux/swap.c index 6d8d5458..5a7f8a70 100644 --- a/src/libs/zbxsysinfo/linux/swap.c +++ b/src/libs/zbxsysinfo/linux/swap.c @@ -30,7 +30,7 @@ static int SYSTEM_SWAP_FREE(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -54,7 +54,7 @@ static int SYSTEM_SWAP_TOTAL(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -95,7 +95,7 @@ SWP_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { @@ -147,7 +147,7 @@ int OLD_SWAP(const char *cmd, const char *param, unsigned flags, AGENT_RESUL assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/linux/uptime.c b/src/libs/zbxsysinfo/linux/uptime.c index e748f906..d4710d0c 100644 --- a/src/libs/zbxsysinfo/linux/uptime.c +++ b/src/libs/zbxsysinfo/linux/uptime.c @@ -28,7 +28,7 @@ int SYSTEM_UPTIME(const char *cmd, const char *param, unsigned flags, AGENT_RESU assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { diff --git a/src/libs/zbxsysinfo/netbsd/cpu.c b/src/libs/zbxsysinfo/netbsd/cpu.c index f45b39db..157ab650 100644 --- a/src/libs/zbxsysinfo/netbsd/cpu.c +++ b/src/libs/zbxsysinfo/netbsd/cpu.c @@ -121,7 +121,7 @@ CPU_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) { @@ -217,7 +217,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if(getloadavg(load, 3)) { @@ -235,7 +235,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if (pstat_getdynamic(&dyn, sizeof(dyn), 1, 0) == -1) { @@ -258,7 +258,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if (!kc && !(kc = kstat_open())) { @@ -279,7 +279,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if(getloadavg_kmem(loadavg,3) == FAIL) { @@ -292,7 +292,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif #endif @@ -308,7 +308,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if(getloadavg(load, 3)) { @@ -326,7 +326,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if (pstat_getdynamic(&dyn, sizeof(dyn), 1, 0) == -1) { @@ -349,7 +349,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if (!kc && !(kc = kstat_open())) { @@ -370,7 +370,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if(getloadavg_kmem(loadavg,3) == FAIL) { @@ -383,7 +383,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif #endif @@ -399,7 +399,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); if(getloadavg(load, 3)) { @@ -417,7 +417,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); if (pstat_getdynamic(&dyn, sizeof(dyn), 1, 0) == -1) { @@ -440,7 +440,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); if (!kc && !(kc = kstat_open())) { @@ -461,7 +461,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); if(getloadavg_kmem(loadavg,3) == FAIL) { @@ -474,7 +474,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif #endif @@ -507,7 +507,7 @@ CPU_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { @@ -552,7 +552,7 @@ int SYSTEM_CPU_SWITCHES(const char *cmd, const char *param, unsigned flags, { assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } @@ -561,7 +561,7 @@ int SYSTEM_CPU_INTR(const char *cmd, const char *param, unsigned flags, AGEN { assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } diff --git a/src/libs/zbxsysinfo/netbsd/diskio.c b/src/libs/zbxsysinfo/netbsd/diskio.c index 23d0c450..333b177a 100644 --- a/src/libs/zbxsysinfo/netbsd/diskio.c +++ b/src/libs/zbxsysinfo/netbsd/diskio.c @@ -159,7 +159,7 @@ DEV_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) { @@ -235,7 +235,7 @@ DEV_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) { @@ -334,7 +334,7 @@ int OLD_IO(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *res assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/netbsd/diskspace.c b/src/libs/zbxsysinfo/netbsd/diskspace.c index e2120ac6..81fd7e8e 100644 --- a/src/libs/zbxsysinfo/netbsd/diskspace.c +++ b/src/libs/zbxsysinfo/netbsd/diskspace.c @@ -66,7 +66,7 @@ static int VFS_FS_USED(const char *cmd, const char *param, unsigned flags, AGENT assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -90,7 +90,7 @@ static int VFS_FS_FREE(const char *cmd, const char *param, unsigned flags, AGENT assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -114,7 +114,7 @@ static int VFS_FS_TOTAL(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -142,7 +142,7 @@ static int VFS_FS_PFREE(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -167,7 +167,7 @@ static int VFS_FS_PUSED(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -210,7 +210,7 @@ FS_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { diff --git a/src/libs/zbxsysinfo/netbsd/inodes.c b/src/libs/zbxsysinfo/netbsd/inodes.c index 54bfd500..16966cde 100644 --- a/src/libs/zbxsysinfo/netbsd/inodes.c +++ b/src/libs/zbxsysinfo/netbsd/inodes.c @@ -52,7 +52,7 @@ static int VFS_FS_INODE_USED(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -76,7 +76,7 @@ static int VFS_FS_INODE_FREE(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -100,7 +100,7 @@ static int VFS_FS_INODE_TOTAL(const char *cmd, const char *param, unsigned flags assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -127,7 +127,7 @@ static int VFS_FS_INODE_PFREE(const char *cmd, const char *param, unsigned flags assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -152,7 +152,7 @@ static int VFS_FS_INODE_PUSED(const char *cmd, const char *param, unsigned flags assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -195,7 +195,7 @@ FS_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { diff --git a/src/libs/zbxsysinfo/netbsd/kernel.c b/src/libs/zbxsysinfo/netbsd/kernel.c index 14157f22..84c5067b 100644 --- a/src/libs/zbxsysinfo/netbsd/kernel.c +++ b/src/libs/zbxsysinfo/netbsd/kernel.c @@ -30,7 +30,7 @@ int KERNEL_MAXFILES(const char *cmd, const char *param, unsigned flags, AGENT_RE assert(result); - clean_result(result); + init_result(result); mib[0]=CTL_KERN; mib[1]=KERN_MAXFILES; @@ -58,7 +58,7 @@ int KERNEL_MAXPROC(const char *cmd, const char *param, unsigned flags, AGENT_RES assert(result); - clean_result(result); + init_result(result); mib[0]=CTL_KERN; mib[1]=KERN_MAXPROC; @@ -86,7 +86,7 @@ int OLD_KERNEL(const char *cmd, const char *param, unsigned flags, AGENT_RES assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/netbsd/memory.c b/src/libs/zbxsysinfo/netbsd/memory.c index 7dc0fcbe..2feba4e8 100644 --- a/src/libs/zbxsysinfo/netbsd/memory.c +++ b/src/libs/zbxsysinfo/netbsd/memory.c @@ -36,7 +36,7 @@ static int VM_MEMORY_CACHED(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); f=fopen("/proc/meminfo","r"); if(NULL == f) @@ -61,7 +61,7 @@ static int VM_MEMORY_CACHED(const char *cmd, const char *param, unsigned flags, #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -74,7 +74,7 @@ static int VM_MEMORY_BUFFERS(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -93,7 +93,7 @@ static int VM_MEMORY_BUFFERS(const char *cmd, const char *param, unsigned flags, #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -106,7 +106,7 @@ static int VM_MEMORY_SHARED(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -128,7 +128,7 @@ static int VM_MEMORY_SHARED(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); len=sizeof(struct vmtotal); mib[0]=CTL_VM; @@ -150,7 +150,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A #ifdef HAVE_UNISTD_SYSCONF assert(result); - clean_result(result); + init_result(result); result->type |= AR_DOUBLE; result->dbl=(double)sysconf(_SC_PHYS_PAGES)*sysconf(_SC_PAGESIZE); @@ -161,7 +161,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A assert(result); - clean_result(result); + init_result(result); if(pstat_getstatic(&pst, sizeof(pst), (size_t)1, 0) == -1) { @@ -181,7 +181,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -203,7 +203,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A assert(result); - clean_result(result); + init_result(result); len=sizeof(struct vmtotal); mib[0]=CTL_VM; @@ -222,7 +222,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A assert(result); - clean_result(result); + init_result(result); len=sizeof(memory); @@ -240,7 +240,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -252,7 +252,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG #ifdef HAVE_UNISTD_SYSCONF assert(result); - clean_result(result); + init_result(result); result->type |= AR_DOUBLE; result->dbl=(double)sysconf(_SC_AVPHYS_PAGES)*sysconf(_SC_PAGESIZE); @@ -264,7 +264,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG assert(result); - clean_result(result); + init_result(result); if(pstat_getstatic(&pst, sizeof(pst), (size_t)1, 0) == -1) { @@ -304,7 +304,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -326,7 +326,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG assert(result); - clean_result(result); + init_result(result); len=sizeof(struct vmtotal); mib[0]=CTL_VM; @@ -347,7 +347,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG assert(result); - clean_result(result); + init_result(result); pagesize = 0; kret = host_page_size (mach_host_self(), &pagesize); @@ -378,7 +378,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -407,7 +407,7 @@ MEM_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/netbsd/net.c b/src/libs/zbxsysinfo/netbsd/net.c index 54c81126..851be786 100644 --- a/src/libs/zbxsysinfo/netbsd/net.c +++ b/src/libs/zbxsysinfo/netbsd/net.c @@ -27,7 +27,7 @@ int NET_IF_IN(const char *cmd, const char *param, unsigned flags, AGENT_RESULT * assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } @@ -37,7 +37,7 @@ int NET_IF_OUT(const char *cmd, const char *param, unsigned flags, AGENT_RESULT assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } @@ -46,7 +46,7 @@ int NET_TCP_LISTEN(const char *cmd, const char *param, unsigned flags, AGENT { assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } @@ -55,7 +55,7 @@ int NET_IF_COLLISIONS(const char *cmd, const char *param, unsigned flags, AG { assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } diff --git a/src/libs/zbxsysinfo/netbsd/proc.c b/src/libs/zbxsysinfo/netbsd/proc.c index 5153605c..0bcd31dc 100644 --- a/src/libs/zbxsysinfo/netbsd/proc.c +++ b/src/libs/zbxsysinfo/netbsd/proc.c @@ -59,7 +59,7 @@ int PROC_MEMORY(const char *cmd, const char *param, unsigned flags, AGENT_RE assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) { @@ -313,7 +313,7 @@ int PROC_NUM(const char *cmd, const char *param, unsigned flags, AGENT_RESUL assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) diff --git a/src/libs/zbxsysinfo/netbsd/sensors.c b/src/libs/zbxsysinfo/netbsd/sensors.c index 956ca3d1..4ef03c39 100644 --- a/src/libs/zbxsysinfo/netbsd/sensors.c +++ b/src/libs/zbxsysinfo/netbsd/sensors.c @@ -37,7 +37,7 @@ static int SENSOR_TEMP1(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); dir=opendir("/proc/sys/dev/sensors"); if(NULL == dir) @@ -92,7 +92,7 @@ static int SENSOR_TEMP2(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); dir=opendir("/proc/sys/dev/sensors"); if(NULL == dir) @@ -147,7 +147,7 @@ static int SENSOR_TEMP3(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); dir=opendir("/proc/sys/dev/sensors"); if(NULL == dir) @@ -196,7 +196,7 @@ int OLD_SENSOR(const char *cmd, const char *param, unsigned flags, AGENT_RES assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/netbsd/swap.c b/src/libs/zbxsysinfo/netbsd/swap.c index 85e0979c..ac899d88 100644 --- a/src/libs/zbxsysinfo/netbsd/swap.c +++ b/src/libs/zbxsysinfo/netbsd/swap.c @@ -98,7 +98,7 @@ static int SYSTEM_SWAP_FREE(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -121,7 +121,7 @@ static int SYSTEM_SWAP_FREE(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); get_swapinfo(&swaptotal,&swapfree); @@ -131,7 +131,7 @@ static int SYSTEM_SWAP_FREE(const char *cmd, const char *param, unsigned flags, #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -145,7 +145,7 @@ static int SYSTEM_SWAP_TOTAL(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -168,7 +168,7 @@ static int SYSTEM_SWAP_TOTAL(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); get_swapinfo(&swaptotal,&swapfree); @@ -178,7 +178,7 @@ static int SYSTEM_SWAP_TOTAL(const char *cmd, const char *param, unsigned flags, #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -208,7 +208,7 @@ SWP_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { @@ -260,7 +260,7 @@ int OLD_SWAP(const char *cmd, const char *param, unsigned flags, AGENT_RESUL assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/netbsd/uptime.c b/src/libs/zbxsysinfo/netbsd/uptime.c index a38b2bd7..f05c6ab7 100644 --- a/src/libs/zbxsysinfo/netbsd/uptime.c +++ b/src/libs/zbxsysinfo/netbsd/uptime.c @@ -29,7 +29,7 @@ int SYSTEM_UPTIME(const char *cmd, const char *param, unsigned flags, AGENT_RESU assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -49,7 +49,7 @@ int SYSTEM_UPTIME(const char *cmd, const char *param, unsigned flags, AGENT_RESU assert(result); - clean_result(result); + init_result(result); mib[0]=CTL_KERN; mib[1]=KERN_BOOTTIME; @@ -78,7 +78,7 @@ int SYSTEM_UPTIME(const char *cmd, const char *param, unsigned flags, AGENT_RESU assert(result); - clean_result(result); + init_result(result); hz = sysconf(_SC_CLK_TCK); @@ -113,7 +113,7 @@ int SYSTEM_UPTIME(const char *cmd, const char *param, unsigned flags, AGENT_RESU #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif diff --git a/src/libs/zbxsysinfo/openbsd/cpu.c b/src/libs/zbxsysinfo/openbsd/cpu.c index 3efc2909..55150ee6 100644 --- a/src/libs/zbxsysinfo/openbsd/cpu.c +++ b/src/libs/zbxsysinfo/openbsd/cpu.c @@ -163,7 +163,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if(getloadavg(load, 3)) { @@ -182,7 +182,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if(getloadavg(load, 3)) { @@ -201,7 +201,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); if(getloadavg(load, 3)) { @@ -237,7 +237,7 @@ CPU_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { @@ -282,7 +282,7 @@ int SYSTEM_CPU_SWITCHES(const char *cmd, const char *param, unsigned flags, { assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } @@ -291,7 +291,7 @@ int SYSTEM_CPU_INTR(const char *cmd, const char *param, unsigned flags, AGEN { assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } diff --git a/src/libs/zbxsysinfo/openbsd/diskio.c b/src/libs/zbxsysinfo/openbsd/diskio.c index f08e9f46..0135e100 100644 --- a/src/libs/zbxsysinfo/openbsd/diskio.c +++ b/src/libs/zbxsysinfo/openbsd/diskio.c @@ -74,7 +74,7 @@ static int VFS_DEV_READ_BYTES(const char *cmd, const char *param, unsigned flags assert(result); - clean_result(result); + init_result(result); /* if(num_param(param) > 1) { @@ -104,7 +104,7 @@ static int VFS_DEV_READ_OPERATIONS(const char *cmd, const char *param, unsigned assert(result); - clean_result(result); + init_result(result); /* if(num_param(param) > 1) { @@ -134,7 +134,7 @@ static int VFS_DEV_WRITE_BYTES(const char *cmd, const char *param, unsigned flag assert(result); - clean_result(result); + init_result(result); /* if(num_param(param) > 1) { @@ -164,7 +164,7 @@ static int VFS_DEV_WRITE_OPERATIONS(const char *cmd, const char *param, unsigned /* assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { @@ -209,7 +209,7 @@ DEV_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) { @@ -266,7 +266,7 @@ DEV_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) { @@ -352,7 +352,7 @@ int OLD_IO(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *res assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/openbsd/diskspace.c b/src/libs/zbxsysinfo/openbsd/diskspace.c index e2120ac6..81fd7e8e 100644 --- a/src/libs/zbxsysinfo/openbsd/diskspace.c +++ b/src/libs/zbxsysinfo/openbsd/diskspace.c @@ -66,7 +66,7 @@ static int VFS_FS_USED(const char *cmd, const char *param, unsigned flags, AGENT assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -90,7 +90,7 @@ static int VFS_FS_FREE(const char *cmd, const char *param, unsigned flags, AGENT assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -114,7 +114,7 @@ static int VFS_FS_TOTAL(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -142,7 +142,7 @@ static int VFS_FS_PFREE(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -167,7 +167,7 @@ static int VFS_FS_PUSED(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -210,7 +210,7 @@ FS_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { diff --git a/src/libs/zbxsysinfo/openbsd/inodes.c b/src/libs/zbxsysinfo/openbsd/inodes.c index 54bfd500..16966cde 100644 --- a/src/libs/zbxsysinfo/openbsd/inodes.c +++ b/src/libs/zbxsysinfo/openbsd/inodes.c @@ -52,7 +52,7 @@ static int VFS_FS_INODE_USED(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -76,7 +76,7 @@ static int VFS_FS_INODE_FREE(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -100,7 +100,7 @@ static int VFS_FS_INODE_TOTAL(const char *cmd, const char *param, unsigned flags assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -127,7 +127,7 @@ static int VFS_FS_INODE_PFREE(const char *cmd, const char *param, unsigned flags assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -152,7 +152,7 @@ static int VFS_FS_INODE_PUSED(const char *cmd, const char *param, unsigned flags assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -195,7 +195,7 @@ FS_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { diff --git a/src/libs/zbxsysinfo/openbsd/kernel.c b/src/libs/zbxsysinfo/openbsd/kernel.c index 2e122ed6..a680d121 100644 --- a/src/libs/zbxsysinfo/openbsd/kernel.c +++ b/src/libs/zbxsysinfo/openbsd/kernel.c @@ -29,7 +29,7 @@ int KERNEL_MAXFILES(const char *cmd, const char *param, unsigned flags, AGENT_RE assert(result); - clean_result(result); + init_result(result); mib[0]=CTL_KERN; mib[1]=KERN_MAXFILES; @@ -53,7 +53,7 @@ int KERNEL_MAXPROC(const char *cmd, const char *param, unsigned flags, AGENT_RES assert(result); - clean_result(result); + init_result(result); mib[0]=CTL_KERN; mib[1]=KERN_MAXPROC; @@ -78,7 +78,7 @@ int OLD_KERNEL(const char *cmd, const char *param, unsigned flags, AGENT_RES assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/openbsd/memory.c b/src/libs/zbxsysinfo/openbsd/memory.c index 967490a6..6bc3931b 100644 --- a/src/libs/zbxsysinfo/openbsd/memory.c +++ b/src/libs/zbxsysinfo/openbsd/memory.c @@ -31,7 +31,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A assert(result); - clean_result(result); + init_result(result); len=sizeof(v); mib[0]=CTL_VM; @@ -55,7 +55,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG assert(result); - clean_result(result); + init_result(result); len=sizeof(v); mib[0]=CTL_VM; @@ -91,7 +91,7 @@ MEM_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/openbsd/net.c b/src/libs/zbxsysinfo/openbsd/net.c index 56a709ed..bfb96ad3 100644 --- a/src/libs/zbxsysinfo/openbsd/net.c +++ b/src/libs/zbxsysinfo/openbsd/net.c @@ -93,7 +93,7 @@ static int NET_IF_IN_BYTES(const char *cmd, const char *param, unsigned fla assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { @@ -125,7 +125,7 @@ static int NET_IF_IN_PACKETS(const char *cmd, const char *param, unsigned f assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { @@ -157,7 +157,7 @@ static int NET_IF_IN_ERRORS(const char *cmd, const char *param, unsigned fl assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { @@ -204,7 +204,7 @@ NET_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { @@ -245,7 +245,7 @@ static int NET_IF_OUT_BYTES(const char *cmd, const char *param, unsigned fl assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { @@ -277,7 +277,7 @@ static int NET_IF_OUT_PACKETS(const char *cmd, const char *param, unsigned assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { @@ -309,7 +309,7 @@ static int NET_IF_OUT_ERRORS(const char *cmd, const char *param, unsigned f assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { @@ -356,7 +356,7 @@ NET_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { @@ -393,7 +393,7 @@ int NET_TCP_LISTEN(const char *cmd, const char *param, unsigned flags, AGENT { assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } @@ -406,7 +406,7 @@ int NET_IF_COLLISIONS(const char *cmd, const char *param, unsigned flags, AG assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/openbsd/proc.c b/src/libs/zbxsysinfo/openbsd/proc.c index 6ed89421..ba158c1b 100644 --- a/src/libs/zbxsysinfo/openbsd/proc.c +++ b/src/libs/zbxsysinfo/openbsd/proc.c @@ -54,7 +54,7 @@ int PROC_MEMORY(const char *cmd, const char *param, unsigned flags, AGENT_RE assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) @@ -227,7 +227,7 @@ int PROC_NUM(const char *cmd, const char *param, unsigned flags, AGENT_RESUL assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) diff --git a/src/libs/zbxsysinfo/openbsd/sensors.c b/src/libs/zbxsysinfo/openbsd/sensors.c index 956ca3d1..4ef03c39 100644 --- a/src/libs/zbxsysinfo/openbsd/sensors.c +++ b/src/libs/zbxsysinfo/openbsd/sensors.c @@ -37,7 +37,7 @@ static int SENSOR_TEMP1(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); dir=opendir("/proc/sys/dev/sensors"); if(NULL == dir) @@ -92,7 +92,7 @@ static int SENSOR_TEMP2(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); dir=opendir("/proc/sys/dev/sensors"); if(NULL == dir) @@ -147,7 +147,7 @@ static int SENSOR_TEMP3(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); dir=opendir("/proc/sys/dev/sensors"); if(NULL == dir) @@ -196,7 +196,7 @@ int OLD_SENSOR(const char *cmd, const char *param, unsigned flags, AGENT_RES assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/openbsd/swap.c b/src/libs/zbxsysinfo/openbsd/swap.c index d2c68cde..2d0533ec 100644 --- a/src/libs/zbxsysinfo/openbsd/swap.c +++ b/src/libs/zbxsysinfo/openbsd/swap.c @@ -65,7 +65,7 @@ static int SYSTEM_SWAP_FREE(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); ret = get_swap_size(NULL, &value); @@ -84,7 +84,7 @@ static int SYSTEM_SWAP_TOTAL(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); ret = get_swap_size(&value, NULL); @@ -119,7 +119,7 @@ SWP_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { @@ -171,7 +171,7 @@ int OLD_SWAP(const char *cmd, const char *param, unsigned flags, AGENT_RESUL assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { @@ -248,7 +248,7 @@ int SYSTEM_SWAP_IN(const char *cmd, const char *param, unsigned flags, AGENT_RES assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { @@ -306,7 +306,7 @@ int SYSTEM_SWAP_OUT(const char *cmd, const char *param, unsigned flags, AGENT_RE assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { diff --git a/src/libs/zbxsysinfo/openbsd/uptime.c b/src/libs/zbxsysinfo/openbsd/uptime.c index 7492af1e..1c0f609e 100644 --- a/src/libs/zbxsysinfo/openbsd/uptime.c +++ b/src/libs/zbxsysinfo/openbsd/uptime.c @@ -31,7 +31,7 @@ int SYSTEM_UPTIME(const char *cmd, const char *param, unsigned flags, AGENT_RESU int ret = SYSINFO_RET_FAIL; assert(result); - clean_result(result); + init_result(result); mib[0]=CTL_KERN; mib[1]=KERN_BOOTTIME; diff --git a/src/libs/zbxsysinfo/osf/cpu.c b/src/libs/zbxsysinfo/osf/cpu.c index f45b39db..157ab650 100644 --- a/src/libs/zbxsysinfo/osf/cpu.c +++ b/src/libs/zbxsysinfo/osf/cpu.c @@ -121,7 +121,7 @@ CPU_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) { @@ -217,7 +217,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if(getloadavg(load, 3)) { @@ -235,7 +235,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if (pstat_getdynamic(&dyn, sizeof(dyn), 1, 0) == -1) { @@ -258,7 +258,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if (!kc && !(kc = kstat_open())) { @@ -279,7 +279,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if(getloadavg_kmem(loadavg,3) == FAIL) { @@ -292,7 +292,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif #endif @@ -308,7 +308,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if(getloadavg(load, 3)) { @@ -326,7 +326,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if (pstat_getdynamic(&dyn, sizeof(dyn), 1, 0) == -1) { @@ -349,7 +349,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if (!kc && !(kc = kstat_open())) { @@ -370,7 +370,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if(getloadavg_kmem(loadavg,3) == FAIL) { @@ -383,7 +383,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif #endif @@ -399,7 +399,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); if(getloadavg(load, 3)) { @@ -417,7 +417,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); if (pstat_getdynamic(&dyn, sizeof(dyn), 1, 0) == -1) { @@ -440,7 +440,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); if (!kc && !(kc = kstat_open())) { @@ -461,7 +461,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); if(getloadavg_kmem(loadavg,3) == FAIL) { @@ -474,7 +474,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif #endif @@ -507,7 +507,7 @@ CPU_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { @@ -552,7 +552,7 @@ int SYSTEM_CPU_SWITCHES(const char *cmd, const char *param, unsigned flags, { assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } @@ -561,7 +561,7 @@ int SYSTEM_CPU_INTR(const char *cmd, const char *param, unsigned flags, AGEN { assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } diff --git a/src/libs/zbxsysinfo/osf/diskio.c b/src/libs/zbxsysinfo/osf/diskio.c index 23d0c450..333b177a 100644 --- a/src/libs/zbxsysinfo/osf/diskio.c +++ b/src/libs/zbxsysinfo/osf/diskio.c @@ -159,7 +159,7 @@ DEV_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) { @@ -235,7 +235,7 @@ DEV_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) { @@ -334,7 +334,7 @@ int OLD_IO(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *res assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/osf/diskspace.c b/src/libs/zbxsysinfo/osf/diskspace.c index e2120ac6..81fd7e8e 100644 --- a/src/libs/zbxsysinfo/osf/diskspace.c +++ b/src/libs/zbxsysinfo/osf/diskspace.c @@ -66,7 +66,7 @@ static int VFS_FS_USED(const char *cmd, const char *param, unsigned flags, AGENT assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -90,7 +90,7 @@ static int VFS_FS_FREE(const char *cmd, const char *param, unsigned flags, AGENT assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -114,7 +114,7 @@ static int VFS_FS_TOTAL(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -142,7 +142,7 @@ static int VFS_FS_PFREE(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -167,7 +167,7 @@ static int VFS_FS_PUSED(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -210,7 +210,7 @@ FS_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { diff --git a/src/libs/zbxsysinfo/osf/inodes.c b/src/libs/zbxsysinfo/osf/inodes.c index 7a81d6e6..8f89286b 100644 --- a/src/libs/zbxsysinfo/osf/inodes.c +++ b/src/libs/zbxsysinfo/osf/inodes.c @@ -66,7 +66,7 @@ static int VFS_FS_INODE_USED(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -90,7 +90,7 @@ static int VFS_FS_INODE_FREE(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -114,7 +114,7 @@ static int VFS_FS_INODE_TOTAL(const char *cmd, const char *param, unsigned flags assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -141,7 +141,7 @@ static int VFS_FS_INODE_PFREE(const char *cmd, const char *param, unsigned flags assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -166,7 +166,7 @@ static int VFS_FS_INODE_PUSED(const char *cmd, const char *param, unsigned flags assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -209,7 +209,7 @@ FS_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { diff --git a/src/libs/zbxsysinfo/osf/kernel.c b/src/libs/zbxsysinfo/osf/kernel.c index 14157f22..84c5067b 100644 --- a/src/libs/zbxsysinfo/osf/kernel.c +++ b/src/libs/zbxsysinfo/osf/kernel.c @@ -30,7 +30,7 @@ int KERNEL_MAXFILES(const char *cmd, const char *param, unsigned flags, AGENT_RE assert(result); - clean_result(result); + init_result(result); mib[0]=CTL_KERN; mib[1]=KERN_MAXFILES; @@ -58,7 +58,7 @@ int KERNEL_MAXPROC(const char *cmd, const char *param, unsigned flags, AGENT_RES assert(result); - clean_result(result); + init_result(result); mib[0]=CTL_KERN; mib[1]=KERN_MAXPROC; @@ -86,7 +86,7 @@ int OLD_KERNEL(const char *cmd, const char *param, unsigned flags, AGENT_RES assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/osf/memory.c b/src/libs/zbxsysinfo/osf/memory.c index 7dc0fcbe..2feba4e8 100644 --- a/src/libs/zbxsysinfo/osf/memory.c +++ b/src/libs/zbxsysinfo/osf/memory.c @@ -36,7 +36,7 @@ static int VM_MEMORY_CACHED(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); f=fopen("/proc/meminfo","r"); if(NULL == f) @@ -61,7 +61,7 @@ static int VM_MEMORY_CACHED(const char *cmd, const char *param, unsigned flags, #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -74,7 +74,7 @@ static int VM_MEMORY_BUFFERS(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -93,7 +93,7 @@ static int VM_MEMORY_BUFFERS(const char *cmd, const char *param, unsigned flags, #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -106,7 +106,7 @@ static int VM_MEMORY_SHARED(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -128,7 +128,7 @@ static int VM_MEMORY_SHARED(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); len=sizeof(struct vmtotal); mib[0]=CTL_VM; @@ -150,7 +150,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A #ifdef HAVE_UNISTD_SYSCONF assert(result); - clean_result(result); + init_result(result); result->type |= AR_DOUBLE; result->dbl=(double)sysconf(_SC_PHYS_PAGES)*sysconf(_SC_PAGESIZE); @@ -161,7 +161,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A assert(result); - clean_result(result); + init_result(result); if(pstat_getstatic(&pst, sizeof(pst), (size_t)1, 0) == -1) { @@ -181,7 +181,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -203,7 +203,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A assert(result); - clean_result(result); + init_result(result); len=sizeof(struct vmtotal); mib[0]=CTL_VM; @@ -222,7 +222,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A assert(result); - clean_result(result); + init_result(result); len=sizeof(memory); @@ -240,7 +240,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -252,7 +252,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG #ifdef HAVE_UNISTD_SYSCONF assert(result); - clean_result(result); + init_result(result); result->type |= AR_DOUBLE; result->dbl=(double)sysconf(_SC_AVPHYS_PAGES)*sysconf(_SC_PAGESIZE); @@ -264,7 +264,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG assert(result); - clean_result(result); + init_result(result); if(pstat_getstatic(&pst, sizeof(pst), (size_t)1, 0) == -1) { @@ -304,7 +304,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -326,7 +326,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG assert(result); - clean_result(result); + init_result(result); len=sizeof(struct vmtotal); mib[0]=CTL_VM; @@ -347,7 +347,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG assert(result); - clean_result(result); + init_result(result); pagesize = 0; kret = host_page_size (mach_host_self(), &pagesize); @@ -378,7 +378,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -407,7 +407,7 @@ MEM_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/osf/net.c b/src/libs/zbxsysinfo/osf/net.c index 54c81126..851be786 100644 --- a/src/libs/zbxsysinfo/osf/net.c +++ b/src/libs/zbxsysinfo/osf/net.c @@ -27,7 +27,7 @@ int NET_IF_IN(const char *cmd, const char *param, unsigned flags, AGENT_RESULT * assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } @@ -37,7 +37,7 @@ int NET_IF_OUT(const char *cmd, const char *param, unsigned flags, AGENT_RESULT assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } @@ -46,7 +46,7 @@ int NET_TCP_LISTEN(const char *cmd, const char *param, unsigned flags, AGENT { assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } @@ -55,7 +55,7 @@ int NET_IF_COLLISIONS(const char *cmd, const char *param, unsigned flags, AG { assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } diff --git a/src/libs/zbxsysinfo/osf/proc.c b/src/libs/zbxsysinfo/osf/proc.c index 5153605c..0bcd31dc 100644 --- a/src/libs/zbxsysinfo/osf/proc.c +++ b/src/libs/zbxsysinfo/osf/proc.c @@ -59,7 +59,7 @@ int PROC_MEMORY(const char *cmd, const char *param, unsigned flags, AGENT_RE assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) { @@ -313,7 +313,7 @@ int PROC_NUM(const char *cmd, const char *param, unsigned flags, AGENT_RESUL assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) diff --git a/src/libs/zbxsysinfo/osf/sensors.c b/src/libs/zbxsysinfo/osf/sensors.c index 956ca3d1..4ef03c39 100644 --- a/src/libs/zbxsysinfo/osf/sensors.c +++ b/src/libs/zbxsysinfo/osf/sensors.c @@ -37,7 +37,7 @@ static int SENSOR_TEMP1(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); dir=opendir("/proc/sys/dev/sensors"); if(NULL == dir) @@ -92,7 +92,7 @@ static int SENSOR_TEMP2(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); dir=opendir("/proc/sys/dev/sensors"); if(NULL == dir) @@ -147,7 +147,7 @@ static int SENSOR_TEMP3(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); dir=opendir("/proc/sys/dev/sensors"); if(NULL == dir) @@ -196,7 +196,7 @@ int OLD_SENSOR(const char *cmd, const char *param, unsigned flags, AGENT_RES assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/osf/swap.c b/src/libs/zbxsysinfo/osf/swap.c index 85e0979c..ac899d88 100644 --- a/src/libs/zbxsysinfo/osf/swap.c +++ b/src/libs/zbxsysinfo/osf/swap.c @@ -98,7 +98,7 @@ static int SYSTEM_SWAP_FREE(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -121,7 +121,7 @@ static int SYSTEM_SWAP_FREE(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); get_swapinfo(&swaptotal,&swapfree); @@ -131,7 +131,7 @@ static int SYSTEM_SWAP_FREE(const char *cmd, const char *param, unsigned flags, #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -145,7 +145,7 @@ static int SYSTEM_SWAP_TOTAL(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -168,7 +168,7 @@ static int SYSTEM_SWAP_TOTAL(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); get_swapinfo(&swaptotal,&swapfree); @@ -178,7 +178,7 @@ static int SYSTEM_SWAP_TOTAL(const char *cmd, const char *param, unsigned flags, #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -208,7 +208,7 @@ SWP_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { @@ -260,7 +260,7 @@ int OLD_SWAP(const char *cmd, const char *param, unsigned flags, AGENT_RESUL assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/osf/uptime.c b/src/libs/zbxsysinfo/osf/uptime.c index a38b2bd7..f05c6ab7 100644 --- a/src/libs/zbxsysinfo/osf/uptime.c +++ b/src/libs/zbxsysinfo/osf/uptime.c @@ -29,7 +29,7 @@ int SYSTEM_UPTIME(const char *cmd, const char *param, unsigned flags, AGENT_RESU assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -49,7 +49,7 @@ int SYSTEM_UPTIME(const char *cmd, const char *param, unsigned flags, AGENT_RESU assert(result); - clean_result(result); + init_result(result); mib[0]=CTL_KERN; mib[1]=KERN_BOOTTIME; @@ -78,7 +78,7 @@ int SYSTEM_UPTIME(const char *cmd, const char *param, unsigned flags, AGENT_RESU assert(result); - clean_result(result); + init_result(result); hz = sysconf(_SC_CLK_TCK); @@ -113,7 +113,7 @@ int SYSTEM_UPTIME(const char *cmd, const char *param, unsigned flags, AGENT_RESU #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif diff --git a/src/libs/zbxsysinfo/osx/cpu.c b/src/libs/zbxsysinfo/osx/cpu.c index f45b39db..157ab650 100644 --- a/src/libs/zbxsysinfo/osx/cpu.c +++ b/src/libs/zbxsysinfo/osx/cpu.c @@ -121,7 +121,7 @@ CPU_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) { @@ -217,7 +217,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if(getloadavg(load, 3)) { @@ -235,7 +235,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if (pstat_getdynamic(&dyn, sizeof(dyn), 1, 0) == -1) { @@ -258,7 +258,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if (!kc && !(kc = kstat_open())) { @@ -279,7 +279,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if(getloadavg_kmem(loadavg,3) == FAIL) { @@ -292,7 +292,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif #endif @@ -308,7 +308,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if(getloadavg(load, 3)) { @@ -326,7 +326,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if (pstat_getdynamic(&dyn, sizeof(dyn), 1, 0) == -1) { @@ -349,7 +349,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if (!kc && !(kc = kstat_open())) { @@ -370,7 +370,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if(getloadavg_kmem(loadavg,3) == FAIL) { @@ -383,7 +383,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif #endif @@ -399,7 +399,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); if(getloadavg(load, 3)) { @@ -417,7 +417,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); if (pstat_getdynamic(&dyn, sizeof(dyn), 1, 0) == -1) { @@ -440,7 +440,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); if (!kc && !(kc = kstat_open())) { @@ -461,7 +461,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); if(getloadavg_kmem(loadavg,3) == FAIL) { @@ -474,7 +474,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif #endif @@ -507,7 +507,7 @@ CPU_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { @@ -552,7 +552,7 @@ int SYSTEM_CPU_SWITCHES(const char *cmd, const char *param, unsigned flags, { assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } @@ -561,7 +561,7 @@ int SYSTEM_CPU_INTR(const char *cmd, const char *param, unsigned flags, AGEN { assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } diff --git a/src/libs/zbxsysinfo/osx/diskio.c b/src/libs/zbxsysinfo/osx/diskio.c index 23d0c450..333b177a 100644 --- a/src/libs/zbxsysinfo/osx/diskio.c +++ b/src/libs/zbxsysinfo/osx/diskio.c @@ -159,7 +159,7 @@ DEV_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) { @@ -235,7 +235,7 @@ DEV_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) { @@ -334,7 +334,7 @@ int OLD_IO(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *res assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/osx/diskspace.c b/src/libs/zbxsysinfo/osx/diskspace.c index e2120ac6..81fd7e8e 100644 --- a/src/libs/zbxsysinfo/osx/diskspace.c +++ b/src/libs/zbxsysinfo/osx/diskspace.c @@ -66,7 +66,7 @@ static int VFS_FS_USED(const char *cmd, const char *param, unsigned flags, AGENT assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -90,7 +90,7 @@ static int VFS_FS_FREE(const char *cmd, const char *param, unsigned flags, AGENT assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -114,7 +114,7 @@ static int VFS_FS_TOTAL(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -142,7 +142,7 @@ static int VFS_FS_PFREE(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -167,7 +167,7 @@ static int VFS_FS_PUSED(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -210,7 +210,7 @@ FS_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { diff --git a/src/libs/zbxsysinfo/osx/inodes.c b/src/libs/zbxsysinfo/osx/inodes.c index 7a81d6e6..8f89286b 100644 --- a/src/libs/zbxsysinfo/osx/inodes.c +++ b/src/libs/zbxsysinfo/osx/inodes.c @@ -66,7 +66,7 @@ static int VFS_FS_INODE_USED(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -90,7 +90,7 @@ static int VFS_FS_INODE_FREE(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -114,7 +114,7 @@ static int VFS_FS_INODE_TOTAL(const char *cmd, const char *param, unsigned flags assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -141,7 +141,7 @@ static int VFS_FS_INODE_PFREE(const char *cmd, const char *param, unsigned flags assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -166,7 +166,7 @@ static int VFS_FS_INODE_PUSED(const char *cmd, const char *param, unsigned flags assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -209,7 +209,7 @@ FS_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { diff --git a/src/libs/zbxsysinfo/osx/kernel.c b/src/libs/zbxsysinfo/osx/kernel.c index 14157f22..84c5067b 100644 --- a/src/libs/zbxsysinfo/osx/kernel.c +++ b/src/libs/zbxsysinfo/osx/kernel.c @@ -30,7 +30,7 @@ int KERNEL_MAXFILES(const char *cmd, const char *param, unsigned flags, AGENT_RE assert(result); - clean_result(result); + init_result(result); mib[0]=CTL_KERN; mib[1]=KERN_MAXFILES; @@ -58,7 +58,7 @@ int KERNEL_MAXPROC(const char *cmd, const char *param, unsigned flags, AGENT_RES assert(result); - clean_result(result); + init_result(result); mib[0]=CTL_KERN; mib[1]=KERN_MAXPROC; @@ -86,7 +86,7 @@ int OLD_KERNEL(const char *cmd, const char *param, unsigned flags, AGENT_RES assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/osx/memory.c b/src/libs/zbxsysinfo/osx/memory.c index 7dc0fcbe..2feba4e8 100644 --- a/src/libs/zbxsysinfo/osx/memory.c +++ b/src/libs/zbxsysinfo/osx/memory.c @@ -36,7 +36,7 @@ static int VM_MEMORY_CACHED(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); f=fopen("/proc/meminfo","r"); if(NULL == f) @@ -61,7 +61,7 @@ static int VM_MEMORY_CACHED(const char *cmd, const char *param, unsigned flags, #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -74,7 +74,7 @@ static int VM_MEMORY_BUFFERS(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -93,7 +93,7 @@ static int VM_MEMORY_BUFFERS(const char *cmd, const char *param, unsigned flags, #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -106,7 +106,7 @@ static int VM_MEMORY_SHARED(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -128,7 +128,7 @@ static int VM_MEMORY_SHARED(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); len=sizeof(struct vmtotal); mib[0]=CTL_VM; @@ -150,7 +150,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A #ifdef HAVE_UNISTD_SYSCONF assert(result); - clean_result(result); + init_result(result); result->type |= AR_DOUBLE; result->dbl=(double)sysconf(_SC_PHYS_PAGES)*sysconf(_SC_PAGESIZE); @@ -161,7 +161,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A assert(result); - clean_result(result); + init_result(result); if(pstat_getstatic(&pst, sizeof(pst), (size_t)1, 0) == -1) { @@ -181,7 +181,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -203,7 +203,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A assert(result); - clean_result(result); + init_result(result); len=sizeof(struct vmtotal); mib[0]=CTL_VM; @@ -222,7 +222,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A assert(result); - clean_result(result); + init_result(result); len=sizeof(memory); @@ -240,7 +240,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -252,7 +252,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG #ifdef HAVE_UNISTD_SYSCONF assert(result); - clean_result(result); + init_result(result); result->type |= AR_DOUBLE; result->dbl=(double)sysconf(_SC_AVPHYS_PAGES)*sysconf(_SC_PAGESIZE); @@ -264,7 +264,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG assert(result); - clean_result(result); + init_result(result); if(pstat_getstatic(&pst, sizeof(pst), (size_t)1, 0) == -1) { @@ -304,7 +304,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -326,7 +326,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG assert(result); - clean_result(result); + init_result(result); len=sizeof(struct vmtotal); mib[0]=CTL_VM; @@ -347,7 +347,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG assert(result); - clean_result(result); + init_result(result); pagesize = 0; kret = host_page_size (mach_host_self(), &pagesize); @@ -378,7 +378,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -407,7 +407,7 @@ MEM_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/osx/net.c b/src/libs/zbxsysinfo/osx/net.c index 54c81126..851be786 100644 --- a/src/libs/zbxsysinfo/osx/net.c +++ b/src/libs/zbxsysinfo/osx/net.c @@ -27,7 +27,7 @@ int NET_IF_IN(const char *cmd, const char *param, unsigned flags, AGENT_RESULT * assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } @@ -37,7 +37,7 @@ int NET_IF_OUT(const char *cmd, const char *param, unsigned flags, AGENT_RESULT assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } @@ -46,7 +46,7 @@ int NET_TCP_LISTEN(const char *cmd, const char *param, unsigned flags, AGENT { assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } @@ -55,7 +55,7 @@ int NET_IF_COLLISIONS(const char *cmd, const char *param, unsigned flags, AG { assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } diff --git a/src/libs/zbxsysinfo/osx/proc.c b/src/libs/zbxsysinfo/osx/proc.c index 5153605c..0bcd31dc 100644 --- a/src/libs/zbxsysinfo/osx/proc.c +++ b/src/libs/zbxsysinfo/osx/proc.c @@ -59,7 +59,7 @@ int PROC_MEMORY(const char *cmd, const char *param, unsigned flags, AGENT_RE assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) { @@ -313,7 +313,7 @@ int PROC_NUM(const char *cmd, const char *param, unsigned flags, AGENT_RESUL assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) diff --git a/src/libs/zbxsysinfo/osx/sensors.c b/src/libs/zbxsysinfo/osx/sensors.c index 956ca3d1..4ef03c39 100644 --- a/src/libs/zbxsysinfo/osx/sensors.c +++ b/src/libs/zbxsysinfo/osx/sensors.c @@ -37,7 +37,7 @@ static int SENSOR_TEMP1(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); dir=opendir("/proc/sys/dev/sensors"); if(NULL == dir) @@ -92,7 +92,7 @@ static int SENSOR_TEMP2(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); dir=opendir("/proc/sys/dev/sensors"); if(NULL == dir) @@ -147,7 +147,7 @@ static int SENSOR_TEMP3(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); dir=opendir("/proc/sys/dev/sensors"); if(NULL == dir) @@ -196,7 +196,7 @@ int OLD_SENSOR(const char *cmd, const char *param, unsigned flags, AGENT_RES assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/osx/swap.c b/src/libs/zbxsysinfo/osx/swap.c index 85e0979c..ac899d88 100644 --- a/src/libs/zbxsysinfo/osx/swap.c +++ b/src/libs/zbxsysinfo/osx/swap.c @@ -98,7 +98,7 @@ static int SYSTEM_SWAP_FREE(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -121,7 +121,7 @@ static int SYSTEM_SWAP_FREE(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); get_swapinfo(&swaptotal,&swapfree); @@ -131,7 +131,7 @@ static int SYSTEM_SWAP_FREE(const char *cmd, const char *param, unsigned flags, #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -145,7 +145,7 @@ static int SYSTEM_SWAP_TOTAL(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -168,7 +168,7 @@ static int SYSTEM_SWAP_TOTAL(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); get_swapinfo(&swaptotal,&swapfree); @@ -178,7 +178,7 @@ static int SYSTEM_SWAP_TOTAL(const char *cmd, const char *param, unsigned flags, #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -208,7 +208,7 @@ SWP_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { @@ -260,7 +260,7 @@ int OLD_SWAP(const char *cmd, const char *param, unsigned flags, AGENT_RESUL assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/osx/uptime.c b/src/libs/zbxsysinfo/osx/uptime.c index a38b2bd7..f05c6ab7 100644 --- a/src/libs/zbxsysinfo/osx/uptime.c +++ b/src/libs/zbxsysinfo/osx/uptime.c @@ -29,7 +29,7 @@ int SYSTEM_UPTIME(const char *cmd, const char *param, unsigned flags, AGENT_RESU assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -49,7 +49,7 @@ int SYSTEM_UPTIME(const char *cmd, const char *param, unsigned flags, AGENT_RESU assert(result); - clean_result(result); + init_result(result); mib[0]=CTL_KERN; mib[1]=KERN_BOOTTIME; @@ -78,7 +78,7 @@ int SYSTEM_UPTIME(const char *cmd, const char *param, unsigned flags, AGENT_RESU assert(result); - clean_result(result); + init_result(result); hz = sysconf(_SC_CLK_TCK); @@ -113,7 +113,7 @@ int SYSTEM_UPTIME(const char *cmd, const char *param, unsigned flags, AGENT_RESU #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif diff --git a/src/libs/zbxsysinfo/solaris/cpu.c b/src/libs/zbxsysinfo/solaris/cpu.c index 74b63dd5..ff4ca89b 100644 --- a/src/libs/zbxsysinfo/solaris/cpu.c +++ b/src/libs/zbxsysinfo/solaris/cpu.c @@ -159,7 +159,7 @@ static int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if(getloadavg(load, 3)) { @@ -183,7 +183,7 @@ static int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if(getloadavg(load, 3)) { @@ -207,7 +207,7 @@ static int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if(getloadavg(load, 3)) { @@ -248,7 +248,7 @@ CPU_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { @@ -300,7 +300,7 @@ int SYSTEM_CPU_SWITCHES(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); kc = kstat_open(); @@ -343,7 +343,7 @@ int SYSTEM_CPU_INTR(const char *cmd, const char *param, unsigned flags, AGENT_RE assert(result); - clean_result(result); + init_result(result); kc = kstat_open(); diff --git a/src/libs/zbxsysinfo/solaris/diskio.c b/src/libs/zbxsysinfo/solaris/diskio.c index 63fc0322..bdbbc36f 100644 --- a/src/libs/zbxsysinfo/solaris/diskio.c +++ b/src/libs/zbxsysinfo/solaris/diskio.c @@ -355,7 +355,7 @@ DEV_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { @@ -411,7 +411,7 @@ DEV_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { @@ -494,7 +494,7 @@ int OLD_IO(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *res assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/solaris/diskspace.c b/src/libs/zbxsysinfo/solaris/diskspace.c index 364514e7..4d1a6034 100644 --- a/src/libs/zbxsysinfo/solaris/diskspace.c +++ b/src/libs/zbxsysinfo/solaris/diskspace.c @@ -66,7 +66,7 @@ int VFS_FS_USED(const char *cmd, const char *param, unsigned flags, AGENT_RESULT assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -90,7 +90,7 @@ int VFS_FS_FREE(const char *cmd, const char *param, unsigned flags, AGENT_RESULT assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -114,7 +114,7 @@ int VFS_FS_TOTAL(const char *cmd, const char *param, unsigned flags, AGENT_RESUL assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -142,7 +142,7 @@ int VFS_FS_PFREE(const char *cmd, const char *param, unsigned flags, AGENT_RESUL assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -167,7 +167,7 @@ int VFS_FS_PUSED(const char *cmd, const char *param, unsigned flags, AGENT_RESUL assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -210,7 +210,7 @@ FS_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { diff --git a/src/libs/zbxsysinfo/solaris/inodes.c b/src/libs/zbxsysinfo/solaris/inodes.c index 08cce5b0..949da6c2 100644 --- a/src/libs/zbxsysinfo/solaris/inodes.c +++ b/src/libs/zbxsysinfo/solaris/inodes.c @@ -66,7 +66,7 @@ int VFS_FS_INODE_USED(const char *cmd, const char *param, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -90,7 +90,7 @@ int VFS_FS_INODE_FREE(const char *cmd, const char *param, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -114,7 +114,7 @@ int VFS_FS_INODE_TOTAL(const char *cmd, const char *param, unsigned flags, AGENT assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -141,7 +141,7 @@ int VFS_FS_INODE_PFREE(const char *cmd, const char *param, unsigned flags, AGENT assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -166,7 +166,7 @@ int VFS_FS_INODE_PUSED(const char *cmd, const char *param, unsigned flags, AGENT assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -209,7 +209,7 @@ FS_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { diff --git a/src/libs/zbxsysinfo/solaris/kernel.c b/src/libs/zbxsysinfo/solaris/kernel.c index df1d2199..16e96add 100644 --- a/src/libs/zbxsysinfo/solaris/kernel.c +++ b/src/libs/zbxsysinfo/solaris/kernel.c @@ -32,7 +32,7 @@ int KERNEL_MAXPROC(const char *cmd, const char *param, unsigned flags, AGENT_RES assert(result); - clean_result(result); + init_result(result); kc = kstat_open(); if(kc) @@ -65,7 +65,7 @@ int KERNEL_MAXFILES(const char *cmd, const char *param, unsigned flags, AGENT_RE assert(result); - clean_result(result); + init_result(result); mib[0]=CTL_KERN; mib[1]=KERN_MAXFILES; @@ -92,7 +92,7 @@ int OLD_KERNEL(const char *cmd, const char *param, unsigned flags, AGENT_RES assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/solaris/memory.c b/src/libs/zbxsysinfo/solaris/memory.c index 385ece4a..689d0a78 100644 --- a/src/libs/zbxsysinfo/solaris/memory.c +++ b/src/libs/zbxsysinfo/solaris/memory.c @@ -45,7 +45,7 @@ MEM_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { @@ -79,7 +79,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A #ifdef HAVE_UNISTD_SYSCONF assert(result); - clean_result(result); + init_result(result); result->type |= AR_DOUBLE; result->dbl=(double)sysconf(_SC_PHYS_PAGES)*sysconf(_SC_PAGESIZE); @@ -87,7 +87,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -98,7 +98,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG #ifdef HAVE_UNISTD_SYSCONF assert(result); - clean_result(result); + init_result(result); result->type |= AR_DOUBLE; result->dbl=(double)sysconf(_SC_AVPHYS_PAGES)*sysconf(_SC_PAGESIZE); @@ -106,7 +106,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif diff --git a/src/libs/zbxsysinfo/solaris/net.c b/src/libs/zbxsysinfo/solaris/net.c index fccea695..dc5aa7b7 100644 --- a/src/libs/zbxsysinfo/solaris/net.c +++ b/src/libs/zbxsysinfo/solaris/net.c @@ -60,7 +60,7 @@ static int NET_IF_IN_BYTES(const char *cmd, const char *param, unsigned flags, A assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { @@ -96,7 +96,7 @@ static int NET_IF_IN_PACKETS(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { @@ -132,7 +132,7 @@ static int NET_IF_IN_ERRORS(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { @@ -160,7 +160,7 @@ static int NET_IF_OUT_BYTES(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { @@ -196,7 +196,7 @@ static int NET_IF_OUT_PACKETS(const char *cmd, const char *param, unsigned flags assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { @@ -232,7 +232,7 @@ static int NET_IF_OUT_ERRORS(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { @@ -260,7 +260,7 @@ int NET_IF_COLLISIONS(const char *cmd, const char *param, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { @@ -289,7 +289,7 @@ int NET_TCP_LISTEN(const char *cmd, const char *param, unsigned flags, AGENT_RES assert(result); - clean_result(result); + init_result(result); memset(command, '\0', sizeof(command)); @@ -322,7 +322,7 @@ NET_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { @@ -378,7 +378,7 @@ NET_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { diff --git a/src/libs/zbxsysinfo/solaris/proc.c b/src/libs/zbxsysinfo/solaris/proc.c index e28bdef1..4eda46dc 100644 --- a/src/libs/zbxsysinfo/solaris/proc.c +++ b/src/libs/zbxsysinfo/solaris/proc.c @@ -55,7 +55,7 @@ int PROC_MEMORY(const char *cmd, const char *param, unsigned flags, AGENT_RESULT assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) { @@ -225,7 +225,7 @@ int PROC_MEMORY(const char *cmd, const char *param, unsigned flags, AGENT_RESULT #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -259,7 +259,7 @@ int PROC_NUM(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *r assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) { @@ -411,7 +411,7 @@ int PROC_NUM(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *r #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif diff --git a/src/libs/zbxsysinfo/solaris/sensors.c b/src/libs/zbxsysinfo/solaris/sensors.c index 8620f12d..28dd6f74 100644 --- a/src/libs/zbxsysinfo/solaris/sensors.c +++ b/src/libs/zbxsysinfo/solaris/sensors.c @@ -37,7 +37,7 @@ int SENSOR_TEMP1(const char *cmd, const char *param, unsigned flags, AGENT_RESUL assert(result); - clean_result(result); + init_result(result); dir=opendir("/proc/sys/dev/sensors"); if(NULL == dir) @@ -92,7 +92,7 @@ int SENSOR_TEMP2(const char *cmd, const char *param, unsigned flags, AGENT_RESUL assert(result); - clean_result(result); + init_result(result); dir=opendir("/proc/sys/dev/sensors"); if(NULL == dir) @@ -147,7 +147,7 @@ int SENSOR_TEMP3(const char *cmd, const char *param, unsigned flags, AGENT_RESUL assert(result); - clean_result(result); + init_result(result); dir=opendir("/proc/sys/dev/sensors"); if(NULL == dir) @@ -196,7 +196,7 @@ int OLD_SENSOR(const char *cmd, const char *param, unsigned flags, AGENT_RES assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/solaris/swap.c b/src/libs/zbxsysinfo/solaris/swap.c index d95cfe3b..ed13352a 100644 --- a/src/libs/zbxsysinfo/solaris/swap.c +++ b/src/libs/zbxsysinfo/solaris/swap.c @@ -98,7 +98,7 @@ int SYSTEM_SWAP_FREE(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -121,7 +121,7 @@ int SYSTEM_SWAP_FREE(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); get_swapinfo(&swaptotal,&swapfree); @@ -131,7 +131,7 @@ int SYSTEM_SWAP_FREE(const char *cmd, const char *param, unsigned flags, AGENT_R #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -145,7 +145,7 @@ int SYSTEM_SWAP_TOTAL(const char *cmd, const char *param, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -168,7 +168,7 @@ int SYSTEM_SWAP_TOTAL(const char *cmd, const char *param, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); get_swapinfo(&swaptotal,&swapfree); @@ -178,7 +178,7 @@ int SYSTEM_SWAP_TOTAL(const char *cmd, const char *param, unsigned flags, AGENT_ #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -208,7 +208,7 @@ SWP_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { @@ -260,7 +260,7 @@ int OLD_SWAP(const char *cmd, const char *param, unsigned flags, AGENT_RESUL assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { @@ -356,7 +356,7 @@ int SYSTEM_SWAP_IN(const char *cmd, const char *param, unsigned flags, AGENT_RES assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { @@ -414,7 +414,7 @@ int SYSTEM_SWAP_OUT(const char *cmd, const char *param, unsigned flags, AGENT_RE assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { diff --git a/src/libs/zbxsysinfo/solaris/uptime.c b/src/libs/zbxsysinfo/solaris/uptime.c index 814ad97d..3cbfbe33 100644 --- a/src/libs/zbxsysinfo/solaris/uptime.c +++ b/src/libs/zbxsysinfo/solaris/uptime.c @@ -35,7 +35,7 @@ int SYSTEM_UPTIME(const char *cmd, const char *param, unsigned flags, AGENT_RESU assert(result); - clean_result(result); + init_result(result); kc = kstat_open(); @@ -64,7 +64,7 @@ int SYSTEM_UPTIME(const char *cmd, const char *param, unsigned flags, AGENT_RESU assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -84,7 +84,7 @@ int SYSTEM_UPTIME(const char *cmd, const char *param, unsigned flags, AGENT_RESU assert(result); - clean_result(result); + init_result(result); mib[0]=CTL_KERN; mib[1]=KERN_BOOTTIME; @@ -113,7 +113,7 @@ int SYSTEM_UPTIME(const char *cmd, const char *param, unsigned flags, AGENT_RESU assert(result); - clean_result(result); + init_result(result); hz = sysconf(_SC_CLK_TCK); @@ -148,7 +148,7 @@ int SYSTEM_UPTIME(const char *cmd, const char *param, unsigned flags, AGENT_RESU #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif diff --git a/src/libs/zbxsysinfo/unknown/cpu.c b/src/libs/zbxsysinfo/unknown/cpu.c index f45b39db..157ab650 100644 --- a/src/libs/zbxsysinfo/unknown/cpu.c +++ b/src/libs/zbxsysinfo/unknown/cpu.c @@ -121,7 +121,7 @@ CPU_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) { @@ -217,7 +217,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if(getloadavg(load, 3)) { @@ -235,7 +235,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if (pstat_getdynamic(&dyn, sizeof(dyn), 1, 0) == -1) { @@ -258,7 +258,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if (!kc && !(kc = kstat_open())) { @@ -279,7 +279,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if(getloadavg_kmem(loadavg,3) == FAIL) { @@ -292,7 +292,7 @@ int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_R #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif #endif @@ -308,7 +308,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if(getloadavg(load, 3)) { @@ -326,7 +326,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if (pstat_getdynamic(&dyn, sizeof(dyn), 1, 0) == -1) { @@ -349,7 +349,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if (!kc && !(kc = kstat_open())) { @@ -370,7 +370,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R assert(result); - clean_result(result); + init_result(result); if(getloadavg_kmem(loadavg,3) == FAIL) { @@ -383,7 +383,7 @@ int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_R #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif #endif @@ -399,7 +399,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); if(getloadavg(load, 3)) { @@ -417,7 +417,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); if (pstat_getdynamic(&dyn, sizeof(dyn), 1, 0) == -1) { @@ -440,7 +440,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); if (!kc && !(kc = kstat_open())) { @@ -461,7 +461,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ assert(result); - clean_result(result); + init_result(result); if(getloadavg_kmem(loadavg,3) == FAIL) { @@ -474,7 +474,7 @@ int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_ #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif #endif @@ -507,7 +507,7 @@ CPU_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { @@ -552,7 +552,7 @@ int SYSTEM_CPU_SWITCHES(const char *cmd, const char *param, unsigned flags, { assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } @@ -561,7 +561,7 @@ int SYSTEM_CPU_INTR(const char *cmd, const char *param, unsigned flags, AGEN { assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } diff --git a/src/libs/zbxsysinfo/unknown/diskio.c b/src/libs/zbxsysinfo/unknown/diskio.c index 23d0c450..333b177a 100644 --- a/src/libs/zbxsysinfo/unknown/diskio.c +++ b/src/libs/zbxsysinfo/unknown/diskio.c @@ -159,7 +159,7 @@ DEV_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) { @@ -235,7 +235,7 @@ DEV_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) { @@ -334,7 +334,7 @@ int OLD_IO(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *res assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/unknown/diskspace.c b/src/libs/zbxsysinfo/unknown/diskspace.c index e2120ac6..81fd7e8e 100644 --- a/src/libs/zbxsysinfo/unknown/diskspace.c +++ b/src/libs/zbxsysinfo/unknown/diskspace.c @@ -66,7 +66,7 @@ static int VFS_FS_USED(const char *cmd, const char *param, unsigned flags, AGENT assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -90,7 +90,7 @@ static int VFS_FS_FREE(const char *cmd, const char *param, unsigned flags, AGENT assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -114,7 +114,7 @@ static int VFS_FS_TOTAL(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -142,7 +142,7 @@ static int VFS_FS_PFREE(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -167,7 +167,7 @@ static int VFS_FS_PUSED(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -210,7 +210,7 @@ FS_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { diff --git a/src/libs/zbxsysinfo/unknown/inodes.c b/src/libs/zbxsysinfo/unknown/inodes.c index 7a81d6e6..8f89286b 100644 --- a/src/libs/zbxsysinfo/unknown/inodes.c +++ b/src/libs/zbxsysinfo/unknown/inodes.c @@ -66,7 +66,7 @@ static int VFS_FS_INODE_USED(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -90,7 +90,7 @@ static int VFS_FS_INODE_FREE(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -114,7 +114,7 @@ static int VFS_FS_INODE_TOTAL(const char *cmd, const char *param, unsigned flags assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -141,7 +141,7 @@ static int VFS_FS_INODE_PFREE(const char *cmd, const char *param, unsigned flags assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -166,7 +166,7 @@ static int VFS_FS_INODE_PUSED(const char *cmd, const char *param, unsigned flags assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) return SYSINFO_RET_FAIL; @@ -209,7 +209,7 @@ FS_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { diff --git a/src/libs/zbxsysinfo/unknown/kernel.c b/src/libs/zbxsysinfo/unknown/kernel.c index 14157f22..84c5067b 100644 --- a/src/libs/zbxsysinfo/unknown/kernel.c +++ b/src/libs/zbxsysinfo/unknown/kernel.c @@ -30,7 +30,7 @@ int KERNEL_MAXFILES(const char *cmd, const char *param, unsigned flags, AGENT_RE assert(result); - clean_result(result); + init_result(result); mib[0]=CTL_KERN; mib[1]=KERN_MAXFILES; @@ -58,7 +58,7 @@ int KERNEL_MAXPROC(const char *cmd, const char *param, unsigned flags, AGENT_RES assert(result); - clean_result(result); + init_result(result); mib[0]=CTL_KERN; mib[1]=KERN_MAXPROC; @@ -86,7 +86,7 @@ int OLD_KERNEL(const char *cmd, const char *param, unsigned flags, AGENT_RES assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/unknown/memory.c b/src/libs/zbxsysinfo/unknown/memory.c index 7dc0fcbe..2feba4e8 100644 --- a/src/libs/zbxsysinfo/unknown/memory.c +++ b/src/libs/zbxsysinfo/unknown/memory.c @@ -36,7 +36,7 @@ static int VM_MEMORY_CACHED(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); f=fopen("/proc/meminfo","r"); if(NULL == f) @@ -61,7 +61,7 @@ static int VM_MEMORY_CACHED(const char *cmd, const char *param, unsigned flags, #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -74,7 +74,7 @@ static int VM_MEMORY_BUFFERS(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -93,7 +93,7 @@ static int VM_MEMORY_BUFFERS(const char *cmd, const char *param, unsigned flags, #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -106,7 +106,7 @@ static int VM_MEMORY_SHARED(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -128,7 +128,7 @@ static int VM_MEMORY_SHARED(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); len=sizeof(struct vmtotal); mib[0]=CTL_VM; @@ -150,7 +150,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A #ifdef HAVE_UNISTD_SYSCONF assert(result); - clean_result(result); + init_result(result); result->type |= AR_DOUBLE; result->dbl=(double)sysconf(_SC_PHYS_PAGES)*sysconf(_SC_PAGESIZE); @@ -161,7 +161,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A assert(result); - clean_result(result); + init_result(result); if(pstat_getstatic(&pst, sizeof(pst), (size_t)1, 0) == -1) { @@ -181,7 +181,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -203,7 +203,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A assert(result); - clean_result(result); + init_result(result); len=sizeof(struct vmtotal); mib[0]=CTL_VM; @@ -222,7 +222,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A assert(result); - clean_result(result); + init_result(result); len=sizeof(memory); @@ -240,7 +240,7 @@ static int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, A #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -252,7 +252,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG #ifdef HAVE_UNISTD_SYSCONF assert(result); - clean_result(result); + init_result(result); result->type |= AR_DOUBLE; result->dbl=(double)sysconf(_SC_AVPHYS_PAGES)*sysconf(_SC_PAGESIZE); @@ -264,7 +264,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG assert(result); - clean_result(result); + init_result(result); if(pstat_getstatic(&pst, sizeof(pst), (size_t)1, 0) == -1) { @@ -304,7 +304,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -326,7 +326,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG assert(result); - clean_result(result); + init_result(result); len=sizeof(struct vmtotal); mib[0]=CTL_VM; @@ -347,7 +347,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG assert(result); - clean_result(result); + init_result(result); pagesize = 0; kret = host_page_size (mach_host_self(), &pagesize); @@ -378,7 +378,7 @@ static int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AG #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -407,7 +407,7 @@ MEM_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/unknown/net.c b/src/libs/zbxsysinfo/unknown/net.c index 54c81126..851be786 100644 --- a/src/libs/zbxsysinfo/unknown/net.c +++ b/src/libs/zbxsysinfo/unknown/net.c @@ -27,7 +27,7 @@ int NET_IF_IN(const char *cmd, const char *param, unsigned flags, AGENT_RESULT * assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } @@ -37,7 +37,7 @@ int NET_IF_OUT(const char *cmd, const char *param, unsigned flags, AGENT_RESULT assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } @@ -46,7 +46,7 @@ int NET_TCP_LISTEN(const char *cmd, const char *param, unsigned flags, AGENT { assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } @@ -55,7 +55,7 @@ int NET_IF_COLLISIONS(const char *cmd, const char *param, unsigned flags, AG { assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; } diff --git a/src/libs/zbxsysinfo/unknown/proc.c b/src/libs/zbxsysinfo/unknown/proc.c index 5153605c..0bcd31dc 100644 --- a/src/libs/zbxsysinfo/unknown/proc.c +++ b/src/libs/zbxsysinfo/unknown/proc.c @@ -59,7 +59,7 @@ int PROC_MEMORY(const char *cmd, const char *param, unsigned flags, AGENT_RE assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) { @@ -313,7 +313,7 @@ int PROC_NUM(const char *cmd, const char *param, unsigned flags, AGENT_RESUL assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 3) diff --git a/src/libs/zbxsysinfo/unknown/sensors.c b/src/libs/zbxsysinfo/unknown/sensors.c index 956ca3d1..4ef03c39 100644 --- a/src/libs/zbxsysinfo/unknown/sensors.c +++ b/src/libs/zbxsysinfo/unknown/sensors.c @@ -37,7 +37,7 @@ static int SENSOR_TEMP1(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); dir=opendir("/proc/sys/dev/sensors"); if(NULL == dir) @@ -92,7 +92,7 @@ static int SENSOR_TEMP2(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); dir=opendir("/proc/sys/dev/sensors"); if(NULL == dir) @@ -147,7 +147,7 @@ static int SENSOR_TEMP3(const char *cmd, const char *param, unsigned flags, AGEN assert(result); - clean_result(result); + init_result(result); dir=opendir("/proc/sys/dev/sensors"); if(NULL == dir) @@ -196,7 +196,7 @@ int OLD_SENSOR(const char *cmd, const char *param, unsigned flags, AGENT_RES assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/unknown/swap.c b/src/libs/zbxsysinfo/unknown/swap.c index 85e0979c..ac899d88 100644 --- a/src/libs/zbxsysinfo/unknown/swap.c +++ b/src/libs/zbxsysinfo/unknown/swap.c @@ -98,7 +98,7 @@ static int SYSTEM_SWAP_FREE(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -121,7 +121,7 @@ static int SYSTEM_SWAP_FREE(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); get_swapinfo(&swaptotal,&swapfree); @@ -131,7 +131,7 @@ static int SYSTEM_SWAP_FREE(const char *cmd, const char *param, unsigned flags, #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -145,7 +145,7 @@ static int SYSTEM_SWAP_TOTAL(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -168,7 +168,7 @@ static int SYSTEM_SWAP_TOTAL(const char *cmd, const char *param, unsigned flags, assert(result); - clean_result(result); + init_result(result); get_swapinfo(&swaptotal,&swapfree); @@ -178,7 +178,7 @@ static int SYSTEM_SWAP_TOTAL(const char *cmd, const char *param, unsigned flags, #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif @@ -208,7 +208,7 @@ SWP_FNCLIST assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 2) { @@ -260,7 +260,7 @@ int OLD_SWAP(const char *cmd, const char *param, unsigned flags, AGENT_RESUL assert(result); - clean_result(result); + init_result(result); if(num_param(param) > 1) { diff --git a/src/libs/zbxsysinfo/unknown/uptime.c b/src/libs/zbxsysinfo/unknown/uptime.c index a38b2bd7..f05c6ab7 100644 --- a/src/libs/zbxsysinfo/unknown/uptime.c +++ b/src/libs/zbxsysinfo/unknown/uptime.c @@ -29,7 +29,7 @@ int SYSTEM_UPTIME(const char *cmd, const char *param, unsigned flags, AGENT_RESU assert(result); - clean_result(result); + init_result(result); if( 0 == sysinfo(&info)) { @@ -49,7 +49,7 @@ int SYSTEM_UPTIME(const char *cmd, const char *param, unsigned flags, AGENT_RESU assert(result); - clean_result(result); + init_result(result); mib[0]=CTL_KERN; mib[1]=KERN_BOOTTIME; @@ -78,7 +78,7 @@ int SYSTEM_UPTIME(const char *cmd, const char *param, unsigned flags, AGENT_RESU assert(result); - clean_result(result); + init_result(result); hz = sysconf(_SC_CLK_TCK); @@ -113,7 +113,7 @@ int SYSTEM_UPTIME(const char *cmd, const char *param, unsigned flags, AGENT_RESU #else assert(result); - clean_result(result); + init_result(result); return SYSINFO_RET_FAIL; #endif |