diff -Naur zabbix-2.0.3.orig/src/libs/zbxsysinfo/linux/proc.c zabbix-2.0.3/src/libs/zbxsysinfo/linux/proc.c --- zabbix-2.0.3.orig/src/libs/zbxsysinfo/linux/proc.c 2012-10-04 00:41:35.000000000 +1000 +++ zabbix-2.0.3/src/libs/zbxsysinfo/linux/proc.c 2012-10-21 19:39:44.132615864 +1100 @@ -213,6 +213,7 @@ { char tmp[MAX_STRING_LEN], *p, *p1, procname[MAX_STRING_LEN], + memtype[MAX_STRING_LEN], proccomm[MAX_STRING_LEN]; DIR *dir; struct dirent *entries; @@ -222,7 +223,7 @@ int do_task, proccount = 0; double memsize = 0; - if (4 < num_param(param)) + if (5 < num_param(param)) return SYSINFO_RET_FAIL; if (0 != get_param(param, 1, procname, sizeof(procname))) @@ -262,6 +263,13 @@ if (0 != get_param(param, 4, proccomm, sizeof(proccomm))) *proccomm = '\0'; + if (0 != get_param(param, 5, memtype, sizeof(memtype))) + { + zbx_strlcpy( memtype, "VmSize", sizeof(memtype)); + } + zbx_strlcat( memtype, ":\t", sizeof( memtype)); + + if (NULL == (dir = opendir("/proc"))) return SYSINFO_RET_FAIL; @@ -298,10 +306,10 @@ while (NULL != fgets(tmp, sizeof(tmp), f_stat)) { - if (0 != strncmp(tmp, "VmSize:\t", 8)) + if (0 != strncmp(tmp, memtype, strlen( memtype))) continue; - p = tmp + 8; + p = tmp + strlen(memtype); if (NULL == (p1 = strrchr(p, ' '))) continue;