Index: src/zabbix_agent/stats.c
===================================================================
--- src/zabbix_agent/stats.c	(revision 26429)
+++ src/zabbix_agent/stats.c	(working copy)
@@ -136,22 +136,24 @@
 void	init_collector_data()
 {
 	int	cpu_count;
-	size_t	sz, sz_cpu;
+	size_t	sz, sz_cpu, sz_disk;
 #if !defined(_WINDOWS)
 	key_t	shm_key;
 #endif
 
 	cpu_count = zbx_get_cpu_num();
 	sz = sizeof(ZBX_COLLECTOR_DATA);
+	sz_disk = sizeof(ZBX_SINGLE_DISKDEVICE_DATA) * CONFIG_DISK_NUMBERS;
 
 #ifdef _WINDOWS
 	sz_cpu = sizeof(PERF_COUNTER_DATA *) * (cpu_count + 1);
 
-	collector = zbx_malloc(collector, sz + sz_cpu);
-	memset(collector, 0, sz + sz_cpu);
+	collector = zbx_malloc(collector, sz + sz_cpu + sz_disk);
+	memset(collector, 0, sz + sz_cpu + sz_disk);
 
 	collector->cpus.cpu_counter = (PERF_COUNTER_DATA **)(collector + 1);
 	collector->cpus.count = cpu_count;
+	collector->diskdevices.device = (ZBX_SINGLE_DISKDEVICE_DATA *)((void *)(collector + 1) + sz_cpu);
 
 	init_perf_collector(&collector->perfs);
 #else
@@ -163,7 +165,7 @@
 		exit(FAIL);
 	}
 
-	if (-1 == (shm_id = zbx_shmget(shm_key, sz + sz_cpu)))
+	if (-1 == (shm_id = zbx_shmget(shm_key, sz + sz_cpu + sz_disk)))
 	{
 		zabbix_log(LOG_LEVEL_CRIT, "cannot allocate shared memory for collector");
 		exit(FAIL);
@@ -177,6 +179,7 @@
 
 	collector->cpus.cpu = (ZBX_SINGLE_CPU_STAT_DATA *)(collector + 1);
 	collector->cpus.count = cpu_count;
+	collector->diskdevices.device = (ZBX_SINGLE_DISKDEVICE_DATA *)((void *)(collector + 1) + sz_cpu);
 #endif	/* _WINDOWS */
 
 #ifdef _AIX
Index: src/zabbix_agent/zabbix_agentd.c
===================================================================
--- src/zabbix_agent/zabbix_agentd.c	(revision 26429)
+++ src/zabbix_agent/zabbix_agentd.c	(working copy)
@@ -344,6 +344,8 @@
 			PARM_OPT,	0,			0},
 		{"UserParameter",		&CONFIG_USER_PARAMETERS,		TYPE_MULTISTRING,
 			PARM_OPT,	0,			0},
+		{"DiskNumbers",			&CONFIG_DISK_NUMBERS,			TYPE_INT,
+			PARM_OPT,	8,			1000},
 #ifdef _WINDOWS
 		{"PerfCounter",			&CONFIG_PERF_COUNTERS,			TYPE_MULTISTRING,
 			PARM_OPT,	0,			0},
Index: src/zabbix_agent/diskdevices.h
===================================================================
--- src/zabbix_agent/diskdevices.h	(revision 26429)
+++ src/zabbix_agent/diskdevices.h	(working copy)
@@ -22,8 +22,6 @@
 
 #include "sysinfo.h"
 
-#define	MAX_DISKDEVICES	8
-
 typedef struct c_single_diskdevice_data
 {
 	char		name[32];
@@ -46,7 +44,7 @@
 typedef struct c_diskdevices_data
 {
 	int				count;
-	ZBX_SINGLE_DISKDEVICE_DATA	device[MAX_DISKDEVICES];
+	ZBX_SINGLE_DISKDEVICE_DATA	*device;
 } ZBX_DISKDEVICES_DATA;
 
 #define DISKDEVICE_COLLECTOR_STARTED(collector) collector
Index: src/zabbix_agent/zbxconf.c
===================================================================
--- src/zabbix_agent/zbxconf.c	(revision 26429)
+++ src/zabbix_agent/zbxconf.c	(working copy)
@@ -54,6 +54,7 @@
 
 char	**CONFIG_ALIASES                = NULL;
 char	**CONFIG_USER_PARAMETERS        = NULL;
+int	CONFIG_DISK_NUMBERS	= 8;
 #if defined(_WINDOWS)
 char	**CONFIG_PERF_COUNTERS          = NULL;
 #endif
Index: src/zabbix_agent/zbxconf.h
===================================================================
--- src/zabbix_agent/zbxconf.h	(revision 26429)
+++ src/zabbix_agent/zbxconf.h	(working copy)
@@ -35,6 +35,7 @@
 extern int	CONFIG_MAX_LINES_PER_SECOND;
 extern char	**CONFIG_ALIASES;
 extern char	**CONFIG_USER_PARAMETERS;
+extern int	CONFIG_DISK_NUMBERS;
 #ifdef _WINDOWS
 extern char	**CONFIG_PERF_COUNTERS;
 #endif
Index: src/zabbix_agent/diskdevices.c
===================================================================
--- src/zabbix_agent/diskdevices.c	(revision 26429)
+++ src/zabbix_agent/diskdevices.c	(working copy)
@@ -21,6 +21,7 @@
 #include "diskdevices.h"
 #include "stats.h"
 #include "log.h"
+#include "zbxconf.h"
 
 static void	apply_diskstat(ZBX_SINGLE_DISKDEVICE_DATA *device, time_t now, zbx_uint64_t *dstat)
 {
@@ -145,7 +146,7 @@
 	zabbix_log(LOG_LEVEL_DEBUG, "In %s() devname:'%s'", __function_name, devname);
 
 	/* collector is full */
-	if (collector->diskdevices.count == MAX_DISKDEVICES)
+	if (collector->diskdevices.count == CONFIG_DISK_NUMBERS)
 	{
 		zabbix_log(LOG_LEVEL_DEBUG, "End of %s():NULL collector is full", __function_name);
 		return NULL;
