diff options
author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-07-14 14:16:15 +0000 |
---|---|---|
committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-07-14 14:16:15 +0000 |
commit | 4aa414db6a76d76684970cbd3c6bda70945e99b4 (patch) | |
tree | e6f3d40193301caabef687f6b959e11a68ec4a81 | |
parent | 66dd503fd985cd589744bda91a295a7301918084 (diff) | |
download | zabbix-4aa414db6a76d76684970cbd3c6bda70945e99b4.tar.gz zabbix-4aa414db6a76d76684970cbd3c6bda70945e99b4.tar.xz zabbix-4aa414db6a76d76684970cbd3c6bda70945e99b4.zip |
Improved Win32 inegration
git-svn-id: svn://svn.zabbix.com/trunk@3046 97f52cf1-0a1b-0410-bd0e-c28be96e8082
-rwxr-xr-x | build/win32/include/config.h | 6 | ||||
-rwxr-xr-x | include/zbxtypes.h | 2 | ||||
-rw-r--r-- | src/libs/zbxdbhigh/db.c | 4 | ||||
-rwxr-xr-x | src/libs/zbxplugin/zbxplugin.c | 2 | ||||
-rw-r--r-- | src/libs/zbxsysinfo/common/common.c | 69 | ||||
-rw-r--r-- | src/libs/zbxsysinfo/common/ntp.c | 10 | ||||
-rw-r--r-- | src/libs/zbxsysinfo/common/system.c | 8 | ||||
-rwxr-xr-x | src/libs/zbxsysinfo/win32/cpu.c | 4 | ||||
-rwxr-xr-x | src/libs/zbxsysinfo/win32/diskio.c | 14 | ||||
-rwxr-xr-x | src/libs/zbxsysinfo/win32/diskspace.c | 53 | ||||
-rwxr-xr-x | src/libs/zbxsysinfo/win32/inodes.c | 2 | ||||
-rwxr-xr-x | src/libs/zbxsysinfo/win32/kernel.c | 4 | ||||
-rwxr-xr-x | src/libs/zbxsysinfo/win32/memory.c | 83 | ||||
-rwxr-xr-x | src/libs/zbxsysinfo/win32/net.c | 10 | ||||
-rwxr-xr-x | src/libs/zbxsysinfo/win32/proc.c | 2 | ||||
-rwxr-xr-x | src/libs/zbxsysinfo/win32/sensors.c | 2 | ||||
-rwxr-xr-x | src/libs/zbxsysinfo/win32/swap.c | 8 | ||||
-rwxr-xr-x | src/libs/zbxsysinfo/win32/win32.c | 36 | ||||
-rw-r--r-- | src/zabbix_agent/diskdevices.c | 2 | ||||
-rw-r--r-- | src/zabbix_agent/interfaces.c | 2 |
20 files changed, 238 insertions, 85 deletions
diff --git a/build/win32/include/config.h b/build/win32/include/config.h index 607a8103..a8ff73f6 100755 --- a/build/win32/include/config.h +++ b/build/win32/include/config.h @@ -273,6 +273,12 @@ /* Define to 1 if you have the <sys/pstat.h> header file. */ /* #undef HAVE_SYS_PSTAT_H */ +/* Define to 1 if function 'GetPerformanceInfo' exist. */ +#define HAVE_GETPERFORMANCEINFO 1 + +/* Define to 1 if function 'GlobalMemoryStatusEx' exist. */ +#define HAVE_GLOBALMEMORYSTATUSEX 1 + /* Define to 1 if function 'setpriority' exist. */ //#define HAVE_SYS_RESOURCE_SETPRIORITY 1 diff --git a/include/zbxtypes.h b/include/zbxtypes.h index ee94bf8f..9e72edd8 100755 --- a/include/zbxtypes.h +++ b/include/zbxtypes.h @@ -23,7 +23,7 @@ #if defined(WIN32) # define zbx_uint64_t __int64 -# define ZBX_FS_UI64 "%llu" +# define ZBX_FS_UI64 "%I64u" # define zbx_pid_t int diff --git a/src/libs/zbxdbhigh/db.c b/src/libs/zbxdbhigh/db.c index f4ea9d44..453b07b6 100644 --- a/src/libs/zbxdbhigh/db.c +++ b/src/libs/zbxdbhigh/db.c @@ -448,9 +448,11 @@ int DBinsert_id() zabbix_log(LOG_LEVEL_DEBUG, "In DBinsert_id()" ); return mysql_insert_id(&mysql); #endif + #ifdef HAVE_PGSQL -#error SUPPORT OF POSTGRESQL NOT IMPLEMENTED YET +# error SUPPORT OF POSTGRESQL NOT IMPLEMENTED YET #endif + #ifdef HAVE_ORACLE return FAIL; #endif diff --git a/src/libs/zbxplugin/zbxplugin.c b/src/libs/zbxplugin/zbxplugin.c index 736f433a..662ccd0a 100755 --- a/src/libs/zbxplugin/zbxplugin.c +++ b/src/libs/zbxplugin/zbxplugin.c @@ -27,7 +27,7 @@ ZBX_PLUGIN_LIST *PluginsList = NULL; int add_plugin(char *args) { #ifdef TODO -# error ADD REALIZATION!!! +# error Realize plugin functionality!!! #endif return 0; } diff --git a/src/libs/zbxsysinfo/common/common.c b/src/libs/zbxsysinfo/common/common.c index 9582f006..e8e8798c 100644 --- a/src/libs/zbxsysinfo/common/common.c +++ b/src/libs/zbxsysinfo/common/common.c @@ -557,6 +557,8 @@ int process(const char *in_command, unsigned flags, AGENT_RESULT *result) int VFS_FILE_MD5SUM(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { +#error Incorrect calculation of MD5 sum!!! + FILE *file = NULL; int i; size_t nr; @@ -566,7 +568,7 @@ int VFS_FILE_MD5SUM(const char *cmd, const char *param, unsigned flags, AGENT_RE u_char buf[16 * 1024]; unsigned char hashText[MD5_DIGEST_SIZE*2+1]; - unsigned char hash[MD5_DIGEST_SIZE]; + md5_byte_t hash[MD5_DIGEST_SIZE]; char filename[MAX_STRING_LEN]; @@ -606,19 +608,20 @@ int VFS_FILE_MD5SUM(const char *cmd, const char *param, unsigned flags, AGENT_RE { md5_append(&state,(const md5_byte_t *)buf, nr); } - md5_finish(&state,(md5_byte_t *)hash); + md5_finish(&state, hash); zbx_fclose(file); /* Convert MD5 hash to text form */ for(i=0;i<MD5_DIGEST_SIZE;i++) { - zbx_snprintf((char *)&hashText[i<<1], 2,"%02x",hash[i]); + zbx_snprintf(&hashText[i<<1], sizeof(hashText) - (i<<1), "%02x",hash[i]); } - + SET_STR_RESULT(result, strdup((char*)hashText)); return SYSINFO_RET_OK; + } /* Code for cksum is based on code from cksum.c */ @@ -1435,10 +1438,7 @@ int RUN_COMMAND(const char *cmd, const char *param, unsigned flags, AGENT_RESULT } -/***************************************/ -/***** !!! NOT USED FUNCTION !!! *******/ -/***************************************/ - +/* static int forward_request(char *proxy, char *command, int port, unsigned flags, AGENT_RESULT *result) { ZBX_SOCKET s; @@ -1512,7 +1512,7 @@ static int forward_request(char *proxy, char *command, int port, unsigned flags, return SYSINFO_RET_OK; } - +*/ /* * 0 - NOT OK @@ -2078,7 +2078,29 @@ int CHECK_PORT(const char *cmd, const char *param, unsigned flags, AGENT_RESULT int CHECK_DNS(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { -#ifdef TODO /* TODO !!! */ +#ifdef TODO + +#if !defined(PACKETSZ) +# define PACKETSZ 512 +#endif /* PACKETSZ */ + +#if !defined(C_IN) +# define C_IN ns_c_in +#endif /* C_IN */ + +#if !defined(ns_c_in) +# define ns_c_in 1 +#endif /* ns_c_in */ + +#if !defined(T_SOA) +# define T_SOA ns_t_soa +#endif /* T_SOA */ + +#if !defined(ns_t_soa) +# define ns_t_soa 6 +#endif /* ns_t_soa */ + + int res; char ip[MAX_STRING_LEN]; char zone[MAX_STRING_LEN]; @@ -2089,7 +2111,6 @@ int CHECK_DNS(const char *cmd, const char *param, unsigned flags, AGENT_RESULT * #endif struct in_addr in; - extern struct __res_state _res; /* extern char *h_errlist[]; */ assert(result); @@ -2130,35 +2151,13 @@ int CHECK_DNS(const char *cmd, const char *param, unsigned flags, AGENT_RESULT * res_init(); -/* - _res.nsaddr.sin_addr=in; - _res.nscount=1; - _res.options= (RES_INIT|RES_AAONLY) & ~RES_RECURSE; - _res.retrans=5; - _res.retry=1; -*/ - - h_errno=0; - - _res.nsaddr_list[0].sin_addr = in; - _res.nsaddr_list[0].sin_family = AF_INET; -/* _res.nsaddr_list[0].sin_port = htons(NS_DEFAULTPORT);*/ - - _res.nsaddr_list[0].sin_port = htons(53); - _res.nscount = 1; - _res.retrans=5; + res = res_query(zone, C_IN, T_SOA, (unsigned char *)respbuf, sizeof(respbuf)); -#ifdef C_IN - res=res_query(zone,C_IN,T_SOA,(unsigned char *)respbuf,sizeof(respbuf)); -#else - res=res_query(zone,ns_c_in,ns_t_soa,(unsigned char *)respbuf,sizeof(respbuf)); -#endif SET_UI64_RESULT(result, res != -1 ? 1 : 0); return SYSINFO_RET_OK; #endif /* TODO */ - return SYSINFO_RET_FAIL; } @@ -2169,7 +2168,7 @@ int SYSTEM_UNUM(const char *cmd, const char *param, unsigned flags, AGENT_RE init_result(result); #ifdef TODO -#error Realize function!!! +#error Realize function SYSTEM_UNUM!!! #endif /* todo */ return EXECUTE_INT(cmd, "who|wc -l", flags, result); diff --git a/src/libs/zbxsysinfo/common/ntp.c b/src/libs/zbxsysinfo/common/ntp.c index 502dd71f..b4baec87 100644 --- a/src/libs/zbxsysinfo/common/ntp.c +++ b/src/libs/zbxsysinfo/common/ntp.c @@ -164,6 +164,7 @@ endian problems. Note that it ignores fields irrelevant to SNTP. */ data->transmit = d / NTP_SCALE; } +/* static void display_data (ntp_data *data) { printf("sta = %d ver = %d mod = %d str = %d pol = %d dis = %.6f ref = %.6f\n", @@ -172,6 +173,7 @@ static void display_data (ntp_data *data) { printf("ori = %.6f rec = %.6f\n",data->originate, data->receive); printf("tra = %.6f cur = %.6f\n",data->transmit, data->current); } +*/ #if OFF @@ -301,9 +303,7 @@ int check_ntp(char *host, unsigned short port, int *value_int) make_packet(&data); -#if OFF - display_data(&data); -#endif /* OFF */ +/* display_data(&data); */ pack_ntp(packet, sizeof(packet), &data); @@ -344,9 +344,7 @@ int check_ntp(char *host, unsigned short port, int *value_int) zbx_sock_close(s); -#if OFF - display_data(&data); -#endif /* OFF */ +/* display_data(&data); */ /* format_time(text,sizeof(text),offset,error,0.0,-1.0);*/ diff --git a/src/libs/zbxsysinfo/common/system.c b/src/libs/zbxsysinfo/common/system.c index 339b274c..a6443822 100644 --- a/src/libs/zbxsysinfo/common/system.c +++ b/src/libs/zbxsysinfo/common/system.c @@ -43,10 +43,6 @@ int SYSTEM_UNAME(const char *cmd, const char *param, unsigned flags, AGENT_R init_result(result); -#ifdef TODO -#error Realize function!!! -#endif /* todo */ - return EXECUTE_STR(cmd, "uname -a", flags, result); } @@ -56,10 +52,6 @@ int SYSTEM_HOSTNAME(const char *cmd, const char *param, unsigned flags, AGEN init_result(result); -#ifdef TODO -#error Realize function!!! -#endif /* todo */ - return EXECUTE_STR(cmd, "hostname", flags, result); } diff --git a/src/libs/zbxsysinfo/win32/cpu.c b/src/libs/zbxsysinfo/win32/cpu.c index 6d720071..d9aebfc9 100755 --- a/src/libs/zbxsysinfo/win32/cpu.c +++ b/src/libs/zbxsysinfo/win32/cpu.c @@ -190,7 +190,7 @@ int SYSTEM_CPU_LOAD(const char *cmd, const char *param, unsigned flags, AGENT_RE int SYSTEM_CPU_SWITCHES(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { #ifdef TODO -#error Realize function!!! +#error Realize function SYSTEM_CPU_SWITCHES!!! #endif /* todo */ return SYSINFO_RET_FAIL; @@ -200,7 +200,7 @@ int SYSTEM_CPU_SWITCHES(const char *cmd, const char *param, unsigned flags, int SYSTEM_CPU_INTR(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { #ifdef TODO -#error Realize function!!! +#error Realize function SYSTEM_CPU_INTR!!! #endif /* todo */ return SYSINFO_RET_FAIL; diff --git a/src/libs/zbxsysinfo/win32/diskio.c b/src/libs/zbxsysinfo/win32/diskio.c index e15e7028..9253cecc 100755 --- a/src/libs/zbxsysinfo/win32/diskio.c +++ b/src/libs/zbxsysinfo/win32/diskio.c @@ -26,7 +26,7 @@ int VFS_DEV_WRITE(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { #ifdef TODO -#error Realize function!!! +#error Realize function VFS_DEV_WRITE!!! #endif /* todo */ return SYSINFO_RET_FAIL; @@ -35,7 +35,7 @@ int VFS_DEV_WRITE(const char *cmd, const char *param, unsigned flags, AGENT_RESU int VFS_DEV_READ(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { #ifdef TODO -#error Realize function!!! +#error Realize function VFS_DEV_READ!!! #endif /* todo */ return SYSINFO_RET_FAIL; @@ -44,7 +44,7 @@ int VFS_DEV_READ(const char *cmd, const char *param, unsigned flags, AGENT_RESUL static int DISK_IO(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { #ifdef TODO -#error Realize function!!! +#error Realize function DISK_IO!!! #endif /* todo */ return SYSINFO_RET_FAIL; @@ -53,7 +53,7 @@ static int DISK_IO(const char *cmd, const char *param, unsigned flags, AGENT_RES static int DISK_RIO(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { #ifdef TODO -#error Realize function!!! +#error Realize function DISK_RIO!!! #endif /* todo */ return SYSINFO_RET_FAIL; @@ -62,7 +62,7 @@ static int DISK_RIO(const char *cmd, const char *param, unsigned flags, AGENT_RE static int DISK_WIO(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { #ifdef TODO -#error Realize function!!! +#error Realize function DISK_WIO!!! #endif /* todo */ return SYSINFO_RET_FAIL; @@ -71,7 +71,7 @@ static int DISK_WIO(const char *cmd, const char *param, unsigned flags, AGENT_RE static int DISK_RBLK(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { #ifdef TODO -#error Realize function!!! +#error Realize function DISK_RBLK!!! #endif /* todo */ return SYSINFO_RET_FAIL; @@ -80,7 +80,7 @@ static int DISK_RBLK(const char *cmd, const char *param, unsigned flags, AGENT_R static int DISK_WBLK(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { #ifdef TODO -#error Realize function!!! +#error Realize function DISK_WBLK!!! #endif /* todo */ return SYSINFO_RET_FAIL; diff --git a/src/libs/zbxsysinfo/win32/diskspace.c b/src/libs/zbxsysinfo/win32/diskspace.c index a9946c18..ad839383 100755 --- a/src/libs/zbxsysinfo/win32/diskspace.c +++ b/src/libs/zbxsysinfo/win32/diskspace.c @@ -25,10 +25,55 @@ int VFS_FS_SIZE(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { -#ifdef TODO -#error Realize function!!! -#endif /* todo */ + + char + path[MAX_PATH], + mode[20]; - return SYSINFO_RET_FAIL; + ULARGE_INTEGER freeBytes,totalBytes; + + if(num_param(param) > 2) + { + return SYSINFO_RET_FAIL; + } + + if(get_param(param, 1, path, MAX_PATH) != 0) + { + return SYSINFO_RET_FAIL; + } + + if(get_param(param, 2, mode, 20) != 0) + { + mode[0] = '\0'; + } + if(mode[0] == '\0') + { + /* default parameter */ + sprintf(mode, "total"); + } + + if (!GetDiskFreeSpaceEx(path, &freeBytes, &totalBytes, NULL)) + { + return SYSINFO_RET_FAIL; + } + + if (strcmp(mode,"free") == 0) + { + SET_UI64_RESULT(result, freeBytes.QuadPart); + } + else if (strcmp(mode,"used") == 0) + { + SET_UI64_RESULT(result, totalBytes.QuadPart - freeBytes.QuadPart); + } + else if (strcmp(mode,"total") == 0) + { + SET_UI64_RESULT(result, totalBytes.QuadPart); + } + else + { + return SYSINFO_RET_FAIL; + } + + return SYSINFO_RET_OK; } diff --git a/src/libs/zbxsysinfo/win32/inodes.c b/src/libs/zbxsysinfo/win32/inodes.c index 074b28b3..47e31b40 100755 --- a/src/libs/zbxsysinfo/win32/inodes.c +++ b/src/libs/zbxsysinfo/win32/inodes.c @@ -27,7 +27,7 @@ int VFS_FS_INODE(const char *cmd, const char *param, unsigned flags, AGENT_RESUL { #ifdef TODO -#error Realize function!!! +#error Realize function VFS_FS_INODE!!! #endif /* todo */ return SYSINFO_RET_FAIL; diff --git a/src/libs/zbxsysinfo/win32/kernel.c b/src/libs/zbxsysinfo/win32/kernel.c index f4c1974b..23c7a7e4 100755 --- a/src/libs/zbxsysinfo/win32/kernel.c +++ b/src/libs/zbxsysinfo/win32/kernel.c @@ -25,7 +25,7 @@ int KERNEL_MAXFILES(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { #ifdef TODO -#error Realize function!!! +#error Realize function KERNEL_MAXFILES!!! #endif /* todo */ return SYSINFO_RET_FAIL; @@ -34,7 +34,7 @@ int KERNEL_MAXFILES(const char *cmd, const char *param, unsigned flags, AGENT_RE int KERNEL_MAXPROC(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { #ifdef TODO -#error Realize function!!! +#error Realize function KERNEL_MAXFILES!!! #endif /* todo */ return SYSINFO_RET_FAIL; diff --git a/src/libs/zbxsysinfo/win32/memory.c b/src/libs/zbxsysinfo/win32/memory.c index 4a778c65..1d106156 100755 --- a/src/libs/zbxsysinfo/win32/memory.c +++ b/src/libs/zbxsysinfo/win32/memory.c @@ -22,13 +22,88 @@ #include "common.h" #include "sysinfo.h" - int VM_MEMORY_SIZE(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { -#ifdef TODO -#error Realize function!!! -#endif /* todo */ + +#if defined(HAVE_GETPERFORMANCEINFO) + PERFORMANCE_INFORMATION pfi; +#endif /* HAVE_GETPERFORMANCEINFO */ + +#if defined(HAVE_GLOBALMEMORYSTATUSEX) + MEMORYSTATUSEX ms; +#else /* HAVE_GLOBALMEMORYSTATUSEX */ + MEMORYSTATUS ms; +#endif + char mode[10]; + + if(num_param(param) > 1) + { + return SYSINFO_RET_FAIL; + } + + if(get_param(param, 1, mode, sizeof(mode)) != 0) + { + mode[0] = '\0'; + } + if(mode[0] == '\0') + { + /* default parameter */ + sprintf(mode, "total"); + } + +#if defined(HAVE_GETPERFORMANCEINFO) + + if (strcmp(mode,"cached") == 0) + { + + GetPerformanceInfo(&pfi,sizeof(PERFORMANCE_INFORMATION)); + + SET_UI64_RESULT(result, (zbx_uint64_t)pfi.SystemCache * (zbx_uint64_t)pfi.PageSize); + + return SYSINFO_RET_OK; + } + +#endif /* HAVE_GETPERFORMANCEINFO */ + +#if defined(HAVE_GLOBALMEMORYSTATUSEX) + + ms.dwLength = sizeof(MEMORYSTATUSEX); + + GlobalMemoryStatusEx(&ms); + + if (strcmp(mode, "total") == 0) + { + SET_UI64_RESULT(result, ms.ullTotalPhys); + return SYSINFO_RET_OK; + } + else if (strcmp(mode, "free") == 0) + { + SET_UI64_RESULT(result, ms.ullAvailPhys); + return SYSINFO_RET_OK; + } + else + { + return SYSINFO_RET_FAIL; + } + +#else /* not HAVE_GLOBALMEMORYSTATUSEX */ + + GlobalMemoryStatus(&ms); + + if (strcmp(mode,"total") == 0) + { + SET_UI64_RESULT(result, ms.dwTotalPhys); + return SYSINFO_RET_OK; + } + else if (strcmp(mode,"free") == 0) + { + SET_UI64_RESULT(result, ms.dwAvailPhys); + return SYSINFO_RET_OK; + } + +#endif /* HAVE_GLOBALMEMORYSTATUSEX */ return SYSINFO_RET_FAIL; + } diff --git a/src/libs/zbxsysinfo/win32/net.c b/src/libs/zbxsysinfo/win32/net.c index f2c44b77..0b2d9ddd 100755 --- a/src/libs/zbxsysinfo/win32/net.c +++ b/src/libs/zbxsysinfo/win32/net.c @@ -26,7 +26,7 @@ int NET_IF_IN(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { #ifdef TODO -#error Realize function!!! +#error Realize function KERNEL_MAXFILES!!! #endif /* todo */ return SYSINFO_RET_FAIL; @@ -35,7 +35,7 @@ int NET_IF_IN(const char *cmd, const char *param, unsigned flags, AGENT_RESULT * int NET_IF_OUT(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { #ifdef TODO -#error Realize function!!! +#error Realize function NET_IF_OUT!!! #endif /* todo */ return SYSINFO_RET_FAIL; @@ -44,7 +44,7 @@ int NET_IF_OUT(const char *cmd, const char *param, unsigned flags, AGENT_RESULT int NET_IF_TOTAL(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { #ifdef TODO -#error Realize function!!! +#error Realize function NET_IF_TOTAL!!! #endif /* todo */ return SYSINFO_RET_FAIL; @@ -53,7 +53,7 @@ int NET_IF_TOTAL(const char *cmd, const char *param, unsigned flags, AGENT_RESUL int NET_TCP_LISTEN(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { #ifdef TODO -#error Realize function!!! +#error Realize function NET_TCP_LISTEN!!! #endif /* todo */ return SYSINFO_RET_FAIL; @@ -62,7 +62,7 @@ int NET_TCP_LISTEN(const char *cmd, const char *param, unsigned flags, AGENT int NET_IF_COLLISIONS(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { #ifdef TODO -#error Realize function!!! +#error Realize function NET_IF_COLLISIONS!!! #endif /* todo */ return SYSINFO_RET_FAIL; diff --git a/src/libs/zbxsysinfo/win32/proc.c b/src/libs/zbxsysinfo/win32/proc.c index db66a889..ff36794c 100755 --- a/src/libs/zbxsysinfo/win32/proc.c +++ b/src/libs/zbxsysinfo/win32/proc.c @@ -71,7 +71,7 @@ lbl_err: int PROC_MEMORY(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { /* usage: <function name>[ <process name>, <user name>, <mode>, <command> ] */ #ifdef TODO - # error Realize function!!! + # error Realize function KERNEL_MAXFILES!!! #endif /* todo */ return SYSINFO_RET_FAIL; diff --git a/src/libs/zbxsysinfo/win32/sensors.c b/src/libs/zbxsysinfo/win32/sensors.c index 8c724913..453bf30f 100755 --- a/src/libs/zbxsysinfo/win32/sensors.c +++ b/src/libs/zbxsysinfo/win32/sensors.c @@ -28,7 +28,7 @@ int OLD_SENSOR(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { #ifdef TODO -#error Realize function!!! +#error Realize function KERNEL_MAXFILES!!! #endif /* todo */ return SYSINFO_RET_FAIL; diff --git a/src/libs/zbxsysinfo/win32/swap.c b/src/libs/zbxsysinfo/win32/swap.c index b78fe622..5a1f13bc 100755 --- a/src/libs/zbxsysinfo/win32/swap.c +++ b/src/libs/zbxsysinfo/win32/swap.c @@ -29,7 +29,7 @@ int SYSTEM_SWAP_SIZE(const char *cmd, const char *param, unsigned flags, AGENT_R { #ifdef TODO -#error Realize function!!! +#error Realize function KERNEL_MAXFILES!!! #endif /* todo */ return SYSINFO_RET_FAIL; @@ -38,7 +38,7 @@ int SYSTEM_SWAP_SIZE(const char *cmd, const char *param, unsigned flags, AGENT_R int OLD_SWAP(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { #ifdef TODO -#error Realize function!!! +#error Realize function OLD_SWAP!!! #endif /* todo */ return SYSINFO_RET_FAIL; @@ -47,7 +47,7 @@ int OLD_SWAP(const char *cmd, const char *param, unsigned flags, AGENT_RESUL int SYSTEM_SWAP_IN(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { #ifdef TODO -#error Realize function!!! +#error Realize function SYSTEM_SWAP_IN!!! #endif /* todo */ return SYSINFO_RET_FAIL; @@ -56,7 +56,7 @@ int SYSTEM_SWAP_IN(const char *cmd, const char *param, unsigned flags, AGENT_RES int SYSTEM_SWAP_OUT(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { #ifdef TODO -#error Realize function!!! +#error Realize function SYSTEM_SWAP_OUT!!! #endif /* todo */ return SYSINFO_RET_FAIL; diff --git a/src/libs/zbxsysinfo/win32/win32.c b/src/libs/zbxsysinfo/win32/win32.c index 558754fe..779c6bc6 100755 --- a/src/libs/zbxsysinfo/win32/win32.c +++ b/src/libs/zbxsysinfo/win32/win32.c @@ -20,6 +20,42 @@ #include "common.h" #include "sysinfo.h" +#ifdef TODO +#error Check supported functionality!!! +/* +SKIP { "__exec{*}", NULL, H_Execute, NULL }, +SKIP { "__usercnt{*}", H_UserCounter, NULL, NULL }, +OK { "system.run[*]", NULL, H_RunCommand, NULL }, + { "agent.stat[avg_collector_time]", H_NumericPtr, NULL, (char *)&statAvgCollectorTime }, + { "agent.stat[max_collector_time]", H_NumericPtr, NULL, (char *)&statMaxCollectorTime }, + { "agent.stat[accepted_requests]", H_NumericPtr, NULL, (char *)&statAcceptedRequests }, + { "agent.stat[rejected_requests]", H_NumericPtr, NULL, (char *)&statRejectedRequests }, + { "agent.stat[timed_out_requests]", H_NumericPtr, NULL, (char *)&statTimedOutRequests }, + { "agent.stat[accept_errors]", H_NumericPtr, NULL, (char *)&statAcceptErrors }, + { "agent.stat[processed_requests]", H_NumericPtr, NULL, (char *)&statProcessedRequests }, + { "agent.stat[failed_requests]", H_NumericPtr, NULL, (char *)&statFailedRequests }, + { "agent.stat[unsupported_requests]", H_NumericPtr, NULL, (char *)&statUnsupportedRequests }, + { "proc_info[*]", H_ProcInfo, NULL, NULL }, // TODO 'new realization and naming' +OK { "perf_counter[*]", H_PerfCounter, NULL, NULL }, // TODO 'new naming' + { "service_state[*]", H_ServiceState, NULL, NULL }, // TODO 'new naming' + +OK { "net.tcp.port[*]", H_CheckTcpPort, NULL, NULL }, +OK { "system.cpu.util[*]", H_CpuUtil, NULL, NULL}, +OK { "system.cpu.load[*]", H_CpuLoad, NULL, NULL}, +OK { "vfs.fs.size[*]", H_DiskInfo, NULL, NULL }, +OK { "vfs.file.size[*]", H_FileSize, NULL, NULL }, +OK { "vfs.file.cksum[*]", H_CRC32, NULL, NULL }, + { "vfs.file.md5sum[*]", NULL, H_MD5Hash, NULL }, + { "system.swap.size[*]", H_SwapSize, NULL, NULL }, +OK { "vm.memory.size[*]", H_MemorySize, NULL, NULL }, +OK { "agent.ping", H_NumericConstant, NULL, (char *)1 }, +OK { "proc.num[*]", H_ProcNum, NULL, NULL }, +OK { "system.uname", NULL, H_SystemUname, NULL }, +OK { "system.hostname", NULL, H_HostName, NULL }, +OK { "agent.version", NULL, H_StringConstant, AGENT_VERSION }, +*/ +#endif /* TODO */ + ZBX_METRIC parameters_specific[]= /* KEY FLAG FUNCTION ADD_PARAM TEST_PARAM */ { diff --git a/src/zabbix_agent/diskdevices.c b/src/zabbix_agent/diskdevices.c index a6542afb..e00d6e3d 100644 --- a/src/zabbix_agent/diskdevices.c +++ b/src/zabbix_agent/diskdevices.c @@ -24,7 +24,7 @@ void collect_stats_diskdevices(ZBX_DISKDEVICES_DATA *pdiskdevices) { #if defined(TODO) -#error "Realize function" +#error "Realize function collect_stats_diskdevices IF needed" #endif } diff --git a/src/zabbix_agent/interfaces.c b/src/zabbix_agent/interfaces.c index ba4ed89d..4159738c 100644 --- a/src/zabbix_agent/interfaces.c +++ b/src/zabbix_agent/interfaces.c @@ -24,7 +24,7 @@ void collect_stats_interfaces(ZBX_INTERFACES_DATA *pinterfaces) { #if defined(TODO) -#error "Realize function" +#error "Realize function collect_stats_interfaces IF needed" #endif } |