diff -uNrp zabbix-1.8.4.orig/include/cfg.h zabbix-1.8.4/include/cfg.h
--- zabbix-1.8.4.orig/include/cfg.h	2011-01-04 22:57:50.000000000 +0900
+++ zabbix-1.8.4/include/cfg.h	2011-03-28 00:35:02.000000000 +0900
@@ -50,9 +50,10 @@ struct cfg_line
 	int	mandatory;
 	int	min;
 	int	max;
+	int	reload;
 };
 
-int	parse_cfg_file(const char *cfg_file, struct cfg_line *cfg);
-int	parse_opt_cfg_file(const char *cfg_file, struct cfg_line *cfg);
+int	parse_cfg_file(const char *cfg_file, struct cfg_line *cfg, int reload);
+int	parse_opt_cfg_file(const char *cfg_file, struct cfg_line *cfg, int reload);
 
 #endif
diff -uNrp zabbix-1.8.4.orig/include/common.h zabbix-1.8.4/include/common.h
--- zabbix-1.8.4.orig/include/common.h	2011-01-04 22:58:37.000000000 +0900
+++ zabbix-1.8.4/include/common.h	2011-03-28 00:35:02.000000000 +0900
@@ -866,6 +866,8 @@ int	is_ip4(const char *ip);
 
 int	cmp_double(double a,double b);
 
+void	reload_action();
+void	zbx_on_reload();
 void	zbx_on_exit(); /* calls exit() at the end! */
 
 int	get_nodeid_by_id(zbx_uint64_t id);
diff -uNrp zabbix-1.8.4.orig/src/libs/zbxconf/cfg.c zabbix-1.8.4/src/libs/zbxconf/cfg.c
--- zabbix-1.8.4.orig/src/libs/zbxconf/cfg.c	2011-01-04 22:57:50.000000000 +0900
+++ zabbix-1.8.4/src/libs/zbxconf/cfg.c	2011-03-28 00:39:10.000000000 +0900
@@ -29,12 +29,12 @@ int	CONFIG_LOG_FILE_SIZE		= 1;
 char	CONFIG_ALLOW_ROOT		= 0;
 int	CONFIG_TIMEOUT			= 3;
 
-static int	__parse_cfg_file(const char *cfg_file, struct cfg_line *cfg, int level, int optional);
+static int	__parse_cfg_file(const char *cfg_file, struct cfg_line *cfg, int level, int optional, int reload);
 
-static int	parse_cfg_object(const char *cfg_file, struct cfg_line *cfg, int level)
+static int	parse_cfg_object(const char *cfg_file, struct cfg_line *cfg, int level, int reload)
 {
 #ifdef _WINDOWS
-	return __parse_cfg_file(cfg_file, cfg, level, 0);
+	return __parse_cfg_file(cfg_file, cfg, level, 0, reload);
 #else
 	DIR		*dir;
 	struct stat	sb;
@@ -48,7 +48,7 @@ static int	parse_cfg_object(const char *
 	}
 
 	if (!S_ISDIR(sb.st_mode))
-		return __parse_cfg_file(cfg_file, cfg, level, 0);
+		return __parse_cfg_file(cfg_file, cfg, level, 0, reload);
 
 	if (NULL == (dir = opendir(cfg_file))) {
 		zbx_error("%s: %s\n", cfg_file, strerror(errno));
@@ -61,7 +61,7 @@ static int	parse_cfg_object(const char *
 		if (stat(incl_file, &sb) == -1 || !S_ISREG(sb.st_mode))
 			continue;
 
-		if (__parse_cfg_file(incl_file, cfg, level, 0) == FAIL) {
+		if (__parse_cfg_file(incl_file, cfg, level, 0, reload) == FAIL) {
 			result = FAIL;
 			break;
 		}
@@ -95,7 +95,7 @@ static int	parse_cfg_object(const char *
  * Comments:                                                                  *
  *                                                                            *
  ******************************************************************************/
-static int	__parse_cfg_file(const char *cfg_file, struct cfg_line *cfg, int level, int optional)
+static int	__parse_cfg_file(const char *cfg_file, struct cfg_line *cfg, int level, int optional, int reload)
 {
 	FILE	*file;
 
@@ -161,7 +161,7 @@ static int	__parse_cfg_file(const char *
 
 				if(strcmp(parameter, "Include") == 0)
 				{
-					if (FAIL == (result = parse_cfg_object(value, cfg, level)))
+					if (FAIL == (result = parse_cfg_object(value, cfg, level, reload)))
 						break;
 				}
 
@@ -177,30 +177,33 @@ static int	__parse_cfg_file(const char *
 
 				for(i = 0; cfg[i].parameter != 0; i++)
 				{
-					if(strcmp(cfg[i].parameter, parameter))
-						continue;
-
-					zabbix_log(LOG_LEVEL_DEBUG, "Accepted configuration parameter: '%s' = '%s'",parameter, value);
-
-					if(cfg[i].function != 0)
-					{
-						if(cfg[i].function(value) != SUCCEED)
-							goto lbl_incorrect_config;
-					}
-					else if(TYPE_INT == cfg[i].type)
+					if(!reload || cfg[i].reload)
 					{
-						if (FAIL == str2uint64(value, &var))
-							goto lbl_incorrect_config;
+						if(strcmp(cfg[i].parameter, parameter))
+							continue;
 
-						if ( (cfg[i].min && var < cfg[i].min) ||
-							(cfg[i].max && var > cfg[i].max) )
+						zabbix_log(LOG_LEVEL_DEBUG, "Accepted configuration parameter: '%s' = '%s'",parameter, value);
+
+						if(cfg[i].function != 0)
+						{
+							if(cfg[i].function(value) != SUCCEED)
+								goto lbl_incorrect_config;
+						}
+						else if(TYPE_INT == cfg[i].type)
+						{
+							if (FAIL == str2uint64(value, &var))
 								goto lbl_incorrect_config;
 
-						*((int*)cfg[i].variable) = var;
-					}
-					else
-					{
-						*((char **)cfg[i].variable) = strdup(value);
+							if ( (cfg[i].min && var < cfg[i].min) ||
+								(cfg[i].max && var > cfg[i].max) )
+									goto lbl_incorrect_config;
+
+							*((int*)cfg[i].variable) = var;
+						}
+						else
+						{
+							*((char **)cfg[i].variable) = strdup(value);
+						}
 					}
 				}
 			}
@@ -246,12 +249,12 @@ lbl_incorrect_config:
 	exit(1);
 }
 
-int	parse_cfg_file(const char *cfg_file, struct cfg_line *cfg)
+int	parse_cfg_file(const char *cfg_file, struct cfg_line *cfg, int reload)
 {
-	return __parse_cfg_file(cfg_file, cfg, 0, 0);
+	return __parse_cfg_file(cfg_file, cfg, 0, 0, reload);
 }
 
-int	parse_opt_cfg_file(const char *cfg_file, struct cfg_line *cfg)
+int	parse_opt_cfg_file(const char *cfg_file, struct cfg_line *cfg, int reload)
 {
-	return __parse_cfg_file(cfg_file, cfg, 0, 1);
+	return __parse_cfg_file(cfg_file, cfg, 0, 1, reload);
 }
diff -uNrp zabbix-1.8.4.orig/src/libs/zbxdb/db.c zabbix-1.8.4/src/libs/zbxdb/db.c
--- zabbix-1.8.4.orig/src/libs/zbxdb/db.c	2011-01-04 22:57:50.000000000 +0900
+++ zabbix-1.8.4/src/libs/zbxdb/db.c	2011-03-28 00:47:59.000000000 +0900
@@ -585,6 +585,7 @@ int	zbx_db_vexecute(const char *fmt, va_
 	char	*sql = NULL;
 	int	ret = ZBX_DB_OK;
 	double	sec = 0;
+	int	tmp_log_slow_queries = CONFIG_LOG_SLOW_QUERIES;
 
 #if defined(HAVE_IBM_DB2)
 	SQLHANDLE	hstmt = 0;
@@ -603,7 +604,7 @@ int	zbx_db_vexecute(const char *fmt, va_
 	char		*error = NULL;
 #endif
 
-	if (CONFIG_LOG_SLOW_QUERIES)
+	if (tmp_log_slow_queries)
 		sec = zbx_time();
 
 	sql = zbx_dvsprintf(sql, fmt, args);
@@ -807,10 +808,10 @@ lbl_exec:
 	}
 #endif	/* HAVE_SQLITE3 */
 
-	if (CONFIG_LOG_SLOW_QUERIES)
+	if (tmp_log_slow_queries)
 	{
 		sec = zbx_time() - sec;
-		if (sec > (double)CONFIG_LOG_SLOW_QUERIES / 1000.0)
+		if (sec > (double)tmp_log_slow_queries / 1000.0)
 			zabbix_log(LOG_LEVEL_WARNING, "Slow query: " ZBX_FS_DBL " sec, \"%s\"", sec, sql);
 	}
 
@@ -827,6 +828,7 @@ DB_RESULT	zbx_db_vselect(const char *fmt
 	char		*sql = NULL;
 	DB_RESULT	result = NULL;
 	double		sec = 0;
+	int		tmp_log_slow_queries = CONFIG_LOG_SLOW_QUERIES;
 
 #if defined(HAVE_IBM_DB2)
 	int		i;
@@ -841,7 +843,7 @@ DB_RESULT	zbx_db_vselect(const char *fmt
 	char		*error = NULL;
 #endif
 
-	if (CONFIG_LOG_SLOW_QUERIES)
+	if (tmp_log_slow_queries)
 		sec = zbx_time();
 
 	sql = zbx_dvsprintf(sql, fmt, args);
@@ -1107,10 +1109,10 @@ lbl_get_table:
 	}
 #endif	/* HAVE_SQLITE3 */
 
-	if (CONFIG_LOG_SLOW_QUERIES)
+	if (tmp_log_slow_queries)
 	{
 		sec = zbx_time() - sec;
-		if (sec > (double)CONFIG_LOG_SLOW_QUERIES / 1000.0)
+		if (sec > (double)tmp_log_slow_queries / 1000.0)
 			zabbix_log(LOG_LEVEL_WARNING, "Slow query: " ZBX_FS_DBL " sec, \"%s\"", sec, sql);
 	}
 
diff -uNrp zabbix-1.8.4.orig/src/libs/zbxnix/daemon.c zabbix-1.8.4/src/libs/zbxnix/daemon.c
--- zabbix-1.8.4.orig/src/libs/zbxnix/daemon.c	2011-01-04 22:57:50.000000000 +0900
+++ zabbix-1.8.4/src/libs/zbxnix/daemon.c	2011-03-28 01:00:06.000000000 +0900
@@ -50,6 +50,10 @@ void	child_signal_handler(int sig, sigin
 	case SIGALRM:
 		zabbix_log(LOG_LEVEL_DEBUG, "Timeout while answering request");
 		break;
+	case SIGHUP:
+		zabbix_log(LOG_LEVEL_WARNING, "Reloading config file");
+		reload_action();
+		break;
 	case SIGILL:
 	case SIGFPE:
 	case SIGSEGV:
@@ -123,6 +127,13 @@ static void	parent_signal_handler(int si
 		else
 			exit(FAIL);
 		break;
+	case SIGHUP:
+		if (1 == parent)
+		{
+			zabbix_log(LOG_LEVEL_WARNING, "Reloading config file");
+			zbx_on_reload();
+		}
+		break;
 	default:
 		child_signal_handler(sig, siginfo, context);
 	}
@@ -250,6 +261,7 @@ int	daemon_start(int allow_root)
 	sigaction(SIGFPE,	&phan, NULL);
 	sigaction(SIGSEGV,	&phan, NULL);
 	sigaction(SIGBUS,	&phan, NULL);
+	sigaction(SIGHUP,	&phan, NULL);
 
 	zbx_setproctitle("main process");
 
@@ -274,4 +286,5 @@ void	init_main_process()
 
 	/* For parent only. To avoid problems with EXECUTE_INT */
 	sigaction(SIGCHLD,	&phan, NULL);
+	sigaction(SIGHUP,	&phan, NULL);
 }
diff -uNrp zabbix-1.8.4.orig/src/libs/zbxnix/fatal.c zabbix-1.8.4/src/libs/zbxnix/fatal.c
--- zabbix-1.8.4.orig/src/libs/zbxnix/fatal.c	2011-01-04 22:57:50.000000000 +0900
+++ zabbix-1.8.4/src/libs/zbxnix/fatal.c	2011-03-28 00:35:02.000000000 +0900
@@ -49,6 +49,7 @@ const char	*get_signal_name(int sig)
 	switch (sig)
 	{
 		case SIGALRM:	return "SIGALRM";
+		case SIGHUP:	return "SIGHUP";
 		case SIGILL:	return "SIGILL";
 		case SIGFPE:	return "SIGFPE";
 		case SIGSEGV:	return "SIGSEGV";
diff -uNrp zabbix-1.8.4.orig/src/zabbix_agent/zabbix_agent.c zabbix-1.8.4/src/zabbix_agent/zabbix_agent.c
--- zabbix-1.8.4.orig/src/zabbix_agent/zabbix_agent.c	2011-01-04 22:57:51.000000000 +0900
+++ zabbix-1.8.4/src/zabbix_agent/zabbix_agent.c	2011-03-28 00:35:02.000000000 +0900
@@ -76,18 +76,18 @@ void	child_signal_handler( int sig )
 
 static char	DEFAULT_CONFIG_FILE[] = "/etc/zabbix/zabbix_agent.conf";
 
-void    init_config(void)
+void    init_config(int reload)
 {
 	struct cfg_line cfg[] =
 	{
-/*               PARAMETER      ,VAR    ,FUNC,  TYPE(0i,1s),MANDATORY,MIN,MAX
+/*               PARAMETER      ,VAR    ,FUNC,  TYPE(0i,1s),MANDATORY,MIN,MAX,RELOAD
 */
-		{"Server",&CONFIG_HOSTS_ALLOWED,0,TYPE_STRING,PARM_MAND,0,0},
-		{"Timeout",&CONFIG_TIMEOUT,0,TYPE_INT,PARM_OPT,1,30},
+		{"Server",&CONFIG_HOSTS_ALLOWED,0,TYPE_STRING,PARM_MAND,0,0,0},
+		{"Timeout",&CONFIG_TIMEOUT,0,TYPE_INT,PARM_OPT,1,30,0},
 		{0}
 	};
 
-	parse_cfg_file(CONFIG_FILE, cfg);
+	parse_cfg_file(CONFIG_FILE, cfg, reload);
 }
 
 int	main(int argc, char **argv)
@@ -149,7 +149,7 @@ int	main(int argc, char **argv)
 	if (ZBX_TASK_START == task)
 	{
 		load_config();
-		load_user_parameters(0);
+		load_user_parameters(0,0);
 	}
 
 	/* Do not create debug files */
@@ -158,12 +158,12 @@ int	main(int argc, char **argv)
 	switch (task)
 	{
 		case ZBX_TASK_PRINT_SUPPORTED:
-			load_user_parameters(1);
+			load_user_parameters(1,0);
 			test_parameters();
 			exit(-1);
 			break;
 		case ZBX_TASK_TEST_METRIC:
-			load_user_parameters(1);
+			load_user_parameters(1,0);
 			test_parameter(TEST_METRIC, PROCESS_TEST);
 			exit(-1);
 			break;
diff -uNrp zabbix-1.8.4.orig/src/zabbix_agent/zabbix_agentd.c zabbix-1.8.4/src/zabbix_agent/zabbix_agentd.c
--- zabbix-1.8.4.orig/src/zabbix_agent/zabbix_agentd.c	2011-01-04 22:57:51.000000000 +0900
+++ zabbix-1.8.4/src/zabbix_agent/zabbix_agentd.c	2011-03-28 00:35:02.000000000 +0900
@@ -255,7 +255,7 @@ int MAIN_ZABBIX_ENTRY(void)
 
 	init_collector_data();
 
-	load_user_parameters(0);
+	load_user_parameters(0,0);
 
 	/* --- START THREADS ---*/
 
@@ -309,6 +309,31 @@ int MAIN_ZABBIX_ENTRY(void)
 	return SUCCEED;
 }
 
+void	reload_action()
+{
+	load_config(1);
+}
+
+void	zbx_on_reload()
+{
+	load_config(1);
+#ifdef _WINDOWS
+#else /* not _WINDOWS */
+	if (threads != NULL)
+	{
+		int	i;
+
+		for (i = 0; i < 1 + CONFIG_ZABBIX_FORKS + (0 == CONFIG_DISABLE_ACTIVE ? 1 : 0); i++)
+		{
+			if (threads[i])
+			{
+				kill(threads[i],SIGHUP);
+			}
+		}
+	}
+#endif /* _WINDOWS */
+}
+
 void	zbx_on_exit()
 {
 	zabbix_log(LOG_LEVEL_DEBUG, "zbx_on_exit() called");
@@ -376,7 +401,7 @@ int	main(int argc, char **argv)
 	init_metrics(); /* Must be before load_config().  load_config - use metrics!!! */
 
 	if (ZBX_TASK_START == t.task || ZBX_TASK_INSTALL_SERVICE == t.task || ZBX_TASK_UNINSTALL_SERVICE == t.task || ZBX_TASK_START_SERVICE == t.task || ZBX_TASK_STOP_SERVICE == t.task)
-		load_config();
+		load_config(0);
 
 #if defined (_WINDOWS)
 	if (t.flags & ZBX_TASK_FLAG_MULTIPLE_AGENTS)
@@ -406,7 +431,7 @@ int	main(int argc, char **argv)
 #if defined (_WINDOWS)
 			init_collector_data(); /* required for reading PerfCounter */
 #endif /* _WINDOWS */
-			load_user_parameters(1);
+			load_user_parameters(1,0);
 			test_parameters();
 			free_metrics();
 			exit(SUCCEED);
@@ -415,7 +440,7 @@ int	main(int argc, char **argv)
 #if defined (_WINDOWS)
 			init_collector_data(); /* required for reading PerfCounter */
 #endif /* _WINDOWS */
-			load_user_parameters(1);
+			load_user_parameters(1,0);
 			test_parameter(TEST_METRIC, PROCESS_TEST);
 			exit(SUCCEED);
 			break;
diff -uNrp zabbix-1.8.4.orig/src/zabbix_agent/zbxconf.c zabbix-1.8.4/src/zabbix_agent/zbxconf.c
--- zabbix-1.8.4.orig/src/zabbix_agent/zbxconf.c	2011-01-04 22:57:51.000000000 +0900
+++ zabbix-1.8.4/src/zabbix_agent/zbxconf.c	2011-03-28 01:14:13.000000000 +0900
@@ -56,37 +56,37 @@ int	CONFIG_BUFFER_SEND		= 5;
 
 int	CONFIG_MAX_LINES_PER_SECOND	= 100;
 
-void    load_config()
+void    load_config(int reload)
 {
 	struct cfg_line cfg[]=
 	{
-/*               PARAMETER      ,VAR    ,FUNC,  TYPE(0i,1s), MANDATORY, MIN, MAX
+/*               PARAMETER      ,VAR    ,FUNC,  TYPE(0i,1s), MANDATORY, MIN, MAX, RELOAD
 */
-		{"Server",		&CONFIG_HOSTS_ALLOWED,	0,TYPE_STRING,	PARM_MAND,	0,0},
-		{"Hostname",		&CONFIG_HOSTNAME,	0,TYPE_STRING,	PARM_OPT,	0,0},
-		{"BufferSize",		&CONFIG_BUFFER_SIZE,	0,TYPE_INT,	PARM_OPT,	2,65535},
-		{"BufferSend",		&CONFIG_BUFFER_SEND,	0,TYPE_INT,	PARM_OPT,	1,3600},
+		{"Server",		&CONFIG_HOSTS_ALLOWED,	0,TYPE_STRING,	PARM_MAND,	0,0,0},
+		{"Hostname",		&CONFIG_HOSTNAME,	0,TYPE_STRING,	PARM_OPT,	0,0,0},
+		{"BufferSize",		&CONFIG_BUFFER_SIZE,	0,TYPE_INT,	PARM_OPT,	2,65535,0},
+		{"BufferSend",		&CONFIG_BUFFER_SEND,	0,TYPE_INT,	PARM_OPT,	1,3600,0},
 
 #ifdef USE_PID_FILE
-		{"PidFile",		&CONFIG_PID_FILE,	0,TYPE_STRING,	PARM_OPT,	0,0},
+		{"PidFile",		&CONFIG_PID_FILE,	0,TYPE_STRING,	PARM_OPT,	0,0,0},
 #endif /* USE_PID_FILE */
 
-		{"LogFile",		&CONFIG_LOG_FILE,	0,TYPE_STRING,	PARM_OPT,	0,0},
-		{"LogFileSize",		&CONFIG_LOG_FILE_SIZE,	0,TYPE_INT,	PARM_OPT,	0,1024},
-		{"DisableActive",	&CONFIG_DISABLE_ACTIVE,	0,TYPE_INT,	PARM_OPT,	0,1},
-		{"DisablePassive",	&CONFIG_DISABLE_PASSIVE,0,TYPE_INT,	PARM_OPT,	0,1},
-		{"Timeout",		&CONFIG_TIMEOUT,	0,TYPE_INT,	PARM_OPT,	1,30},
-		{"ListenPort",		&CONFIG_LISTEN_PORT,	0,TYPE_INT,	PARM_OPT,	1024,32767},
-		{"ServerPort",		&CONFIG_SERVER_PORT,	0,TYPE_INT,	PARM_OPT,	1024,32767},
-		{"ListenIP",		&CONFIG_LISTEN_IP,	0,TYPE_STRING,	PARM_OPT,	0,0},
-		{"SourceIP",		&CONFIG_SOURCE_IP,	0,TYPE_STRING,	PARM_OPT,	0,0},
-
-		{"DebugLevel",		&CONFIG_LOG_LEVEL,	0,TYPE_INT,	PARM_OPT,	0,4},
-
-		{"StartAgents",		&CONFIG_ZABBIX_FORKS,		0,TYPE_INT,	PARM_OPT,1,16},
-		{"RefreshActiveChecks",	&CONFIG_REFRESH_ACTIVE_CHECKS,	0,TYPE_INT,	PARM_OPT,60,3600},
-		{"MaxLinesPerSecond",	&CONFIG_MAX_LINES_PER_SECOND,	0,TYPE_INT,	PARM_OPT,1,1000},
-		{"AllowRoot",		&CONFIG_ALLOW_ROOT,		0,TYPE_INT,	PARM_OPT,0,1},
+		{"LogFile",		&CONFIG_LOG_FILE,	0,TYPE_STRING,	PARM_OPT,	0,0,0},
+		{"LogFileSize",		&CONFIG_LOG_FILE_SIZE,	0,TYPE_INT,	PARM_OPT,	0,1024,0},
+		{"DisableActive",	&CONFIG_DISABLE_ACTIVE,	0,TYPE_INT,	PARM_OPT,	0,1,0},
+		{"DisablePassive",	&CONFIG_DISABLE_PASSIVE,0,TYPE_INT,	PARM_OPT,	0,1,0},
+		{"Timeout",		&CONFIG_TIMEOUT,	0,TYPE_INT,	PARM_OPT,	1,30,0},
+		{"ListenPort",		&CONFIG_LISTEN_PORT,	0,TYPE_INT,	PARM_OPT,	1024,32767,0},
+		{"ServerPort",		&CONFIG_SERVER_PORT,	0,TYPE_INT,	PARM_OPT,	1024,32767,0},
+		{"ListenIP",		&CONFIG_LISTEN_IP,	0,TYPE_STRING,	PARM_OPT,	0,0,0},
+		{"SourceIP",		&CONFIG_SOURCE_IP,	0,TYPE_STRING,	PARM_OPT,	0,0,0},
+
+		{"DebugLevel",		&CONFIG_LOG_LEVEL,	0,TYPE_INT,	PARM_OPT,	0,4,1},
+
+		{"StartAgents",		&CONFIG_ZABBIX_FORKS,		0,TYPE_INT,	PARM_OPT,1,16,0},
+		{"RefreshActiveChecks",	&CONFIG_REFRESH_ACTIVE_CHECKS,	0,TYPE_INT,	PARM_OPT,60,3600,0},
+		{"MaxLinesPerSecond",	&CONFIG_MAX_LINES_PER_SECOND,	0,TYPE_INT,	PARM_OPT,1,1000,0},
+		{"AllowRoot",		&CONFIG_ALLOW_ROOT,		0,TYPE_INT,	PARM_OPT,0,1,0},
 
 		{0}
 	};
@@ -94,57 +94,70 @@ void    load_config()
 	AGENT_RESULT	result;
 	char		**value = NULL;
 
-	memset(&result, 0, sizeof(AGENT_RESULT));
+	/* setting default value for reloading config */
+	if(reload)
+	{
+		CONFIG_LOG_LEVEL = LOG_LEVEL_WARNING;
+	}
 
-	parse_cfg_file(CONFIG_FILE, cfg);
+	parse_cfg_file(CONFIG_FILE, cfg, reload);
 
-#ifdef USE_PID_FILE
-	if(CONFIG_PID_FILE == NULL)
+	if(reload)
 	{
-		CONFIG_PID_FILE = "/tmp/zabbix_agentd.pid";
+		zabbix_set_log_level(CONFIG_LOG_LEVEL);
 	}
-#endif /* USE_PID_FILE */
-
-	if(CONFIG_HOSTNAME == NULL || *CONFIG_HOSTNAME == '\0')
+	else
 	{
-		if(CONFIG_HOSTNAME != NULL)
-			zbx_free(CONFIG_HOSTNAME);
+		memset(&result, 0, sizeof(AGENT_RESULT));
 
-	  	if(SUCCEED == process("system.hostname", 0, &result))
+#ifdef USE_PID_FILE
+		if(CONFIG_PID_FILE == NULL)
 		{
-			if( NULL != (value = GET_STR_RESULT(&result)) )
+			CONFIG_PID_FILE = "/tmp/zabbix_agentd.pid";
+		}
+#endif /* USE_PID_FILE */
+
+		if(CONFIG_HOSTNAME == NULL || *CONFIG_HOSTNAME == '\0')
+		{
+			if(CONFIG_HOSTNAME != NULL)
+				zbx_free(CONFIG_HOSTNAME);
+
+		  	if(SUCCEED == process("system.hostname", 0, &result))
 			{
-				CONFIG_HOSTNAME = strdup(*value);
+				if( NULL != (value = GET_STR_RESULT(&result)) )
+				{
+					CONFIG_HOSTNAME = strdup(*value);
+
+					/* If auto registration is used, our CONFIG_HOSTNAME will make it into the  */
+					/* server's database, where it is limited by HOST_HOST_LEN (currently, 64), */
+					/* so to make it work properly we need to truncate our hostname.            */
+					if (strlen(CONFIG_HOSTNAME) > 64)
+						CONFIG_HOSTNAME[64] = '\0';
+				}
+			}
+	        	free_result(&result);
 
-				/* If auto registration is used, our CONFIG_HOSTNAME will make it into the  */
-				/* server's database, where it is limited by HOST_HOST_LEN (currently, 64), */
-				/* so to make it work properly we need to truncate our hostname.            */
-				if (strlen(CONFIG_HOSTNAME) > 64)
-					CONFIG_HOSTNAME[64] = '\0';
+			if(CONFIG_HOSTNAME == NULL)
+			{
+				zabbix_log( LOG_LEVEL_CRIT, "Hostname is not defined");
+				exit(1);
 			}
 		}
-	        free_result(&result);
-
-		if(CONFIG_HOSTNAME == NULL)
+		else
 		{
-			zabbix_log( LOG_LEVEL_CRIT, "Hostname is not defined");
-			exit(1);
+			if(strlen(CONFIG_HOSTNAME) > 64)
+			{
+				zabbix_log( LOG_LEVEL_CRIT, "Hostname too long");
+				exit(1);
+			}
 		}
-	}
-	else
-	{
-		if(strlen(CONFIG_HOSTNAME) > 64)
+
+		if(CONFIG_DISABLE_ACTIVE == 1 && CONFIG_DISABLE_PASSIVE == 1)
 		{
-			zabbix_log( LOG_LEVEL_CRIT, "Hostname too long");
+			zabbix_log( LOG_LEVEL_CRIT, "Either active or passive checks must be enabled");
 			exit(1);
 		}
 	}
-
-	if(CONFIG_DISABLE_ACTIVE == 1 && CONFIG_DISABLE_PASSIVE == 1)
-	{
-		zabbix_log( LOG_LEVEL_CRIT, "Either active or passive checks must be enabled");
-		exit(1);
-	}
 }
 
 static int     add_parameter(char *key)
@@ -159,33 +172,33 @@ static int     add_parameter(char *key)
 	return add_user_parameter(key, command);
 }
 
-void    load_user_parameters(int optional)
+void    load_user_parameters(int optional, int reload)
 {
 	struct cfg_line cfg[]=
 	{
-/*               PARAMETER,		VAR,	FUNC,		TYPE(0i,1s), MANDATORY,MIN,MAX
+/*               PARAMETER,		VAR,	FUNC,		TYPE(0i,1s), MANDATORY,MIN,MAX,RELOAD
 */
-		{"EnableRemoteCommands",&CONFIG_ENABLE_REMOTE_COMMANDS,	0,TYPE_INT,	PARM_OPT,0,1},
-		{"LogRemoteCommands",&CONFIG_LOG_REMOTE_COMMANDS,	0,TYPE_INT,	PARM_OPT,0,1},
-		{"UnsafeUserParameters",&CONFIG_UNSAFE_USER_PARAMETERS,	0,TYPE_INT,	PARM_OPT,0,1},
+		{"EnableRemoteCommands",&CONFIG_ENABLE_REMOTE_COMMANDS,	0,TYPE_INT,	PARM_OPT,0,1,0},
+		{"LogRemoteCommands",&CONFIG_LOG_REMOTE_COMMANDS,	0,TYPE_INT,	PARM_OPT,0,1,0},
+		{"UnsafeUserParameters",&CONFIG_UNSAFE_USER_PARAMETERS,	0,TYPE_INT,	PARM_OPT,0,1,0},
 
-		{"Alias",		0,	&add_alias_from_config,	TYPE_STRING,PARM_OPT,0,0},
-		{"UserParameter",	0,	&add_parameter,		0,	0,	0,	0},
+		{"Alias",		0,	&add_alias_from_config,	TYPE_STRING,PARM_OPT,0,0,0},
+		{"UserParameter",	0,	&add_parameter,		0,	0,	0,	0,0},
 
 #if defined(_WINDOWS)
-		{"PerfCounter",		0,	&add_perfs_from_config,	TYPE_STRING,PARM_OPT,0,0},
+		{"PerfCounter",		0,	&add_perfs_from_config,	TYPE_STRING,PARM_OPT,0,0,0},
 #endif /* _WINDOWS */
 
 #if defined(WITH_PLUGINS)
-		{"Plugin",		0,	&add_plugin,	TYPE_STRING,PARM_OPT,0,0},
+		{"Plugin",		0,	&add_plugin,	TYPE_STRING,PARM_OPT,0,0,0},
 #endif /* ZABBIX_DAEMON */
 		{0}
 	};
 
 	if (!optional)
-		parse_cfg_file(CONFIG_FILE, cfg);
+		parse_cfg_file(CONFIG_FILE, cfg, reload);
 	else
-		parse_opt_cfg_file(CONFIG_FILE, cfg);
+		parse_opt_cfg_file(CONFIG_FILE, cfg, reload);
 }
 
 #ifdef _AIX
diff -uNrp zabbix-1.8.4.orig/src/zabbix_agent/zbxconf.h zabbix-1.8.4/src/zabbix_agent/zbxconf.h
--- zabbix-1.8.4.orig/src/zabbix_agent/zbxconf.h	2011-01-04 22:57:51.000000000 +0900
+++ zabbix-1.8.4/src/zabbix_agent/zbxconf.h	2011-03-28 00:35:02.000000000 +0900
@@ -34,7 +34,7 @@ extern int	CONFIG_LOG_LEVEL;
 extern int	CONFIG_MAX_LINES_PER_SECOND;
 
 void    load_config();
-void    load_user_parameters(int optional);
+void    load_user_parameters(int optional, int reload);
 
 #ifdef _AIX
 void	tl_version();
diff -uNrp zabbix-1.8.4.orig/src/zabbix_proxy/proxy.c zabbix-1.8.4/src/zabbix_proxy/proxy.c
--- zabbix-1.8.4.orig/src/zabbix_proxy/proxy.c	2011-01-04 22:57:50.000000000 +0900
+++ zabbix-1.8.4/src/zabbix_proxy/proxy.c	2011-03-28 01:16:25.000000000 +0900
@@ -185,78 +185,90 @@ ZBX_MUTEX	node_sync_access;
  * Comments: will terminate process if parsing fails                          *
  *                                                                            *
  ******************************************************************************/
-void	init_config(void)
+void	init_config(int reload)
 {
 	AGENT_RESULT	result;
 	char		**value = NULL;
 
 	static struct cfg_line cfg[]=
 	{
-/*		 PARAMETER	,VAR	,FUNC,	TYPE(0i,1s),MANDATORY,MIN,MAX	*/
-		{"ProxyMode",&CONFIG_PROXYMODE,0,TYPE_INT,PARM_OPT,ZBX_PROXYMODE_ACTIVE,ZBX_PROXYMODE_PASSIVE},
-		{"Server",&CONFIG_SERVER,0,TYPE_STRING,PARM_OPT,0,0},
-		{"ServerPort",&CONFIG_SERVER_PORT,0,TYPE_INT,PARM_OPT,1024,32767},
-		{"Hostname",&CONFIG_HOSTNAME,0,TYPE_STRING,PARM_OPT,0,0},
-
-		{"StartDBSyncers",&CONFIG_DBSYNCER_FORKS,0,TYPE_INT,PARM_OPT,1,64},
-		{"StartDiscoverers",&CONFIG_DISCOVERER_FORKS,0,TYPE_INT,PARM_OPT,0,255},
-		{"StartHTTPPollers",&CONFIG_HTTPPOLLER_FORKS,0,TYPE_INT,PARM_OPT,0,255},
-		{"StartPingers",&CONFIG_PINGER_FORKS,0,TYPE_INT,PARM_OPT,0,255},
-		{"StartPollers",&CONFIG_POLLER_FORKS,0,TYPE_INT,PARM_OPT,0,255},
-		{"StartPollersUnreachable",&CONFIG_UNREACHABLE_POLLER_FORKS,0,TYPE_INT,PARM_OPT,0,255},
-		{"StartIPMIPollers",&CONFIG_IPMIPOLLER_FORKS,0,TYPE_INT,PARM_OPT,0,255},
-		{"StartTrappers",&CONFIG_TRAPPER_FORKS,0,TYPE_INT,PARM_OPT,0,255},
-
-		{"CacheSize",&CONFIG_DBCONFIG_SIZE,0,TYPE_INT,PARM_OPT,128*1024,1024*1024*1024},
-		{"HistoryCacheSize",&CONFIG_HISTORY_CACHE_SIZE,0,TYPE_INT,PARM_OPT,128*1024,1024*1024*1024},
-		{"TrendCacheSize",&CONFIG_TRENDS_CACHE_SIZE,0,TYPE_INT,PARM_OPT,128*1024,1024*1024*1024},
-		{"HistoryTextCacheSize",&CONFIG_TEXT_CACHE_SIZE,0,TYPE_INT,PARM_OPT,128*1024,1024*1024*1024},
-		{"CacheUpdateFrequency",&CONFIG_DBCONFIG_FREQUENCY,0,TYPE_INT,PARM_OPT,1,3600},
-
-		{"HousekeepingFrequency",&CONFIG_HOUSEKEEPING_FREQUENCY,0,TYPE_INT,PARM_OPT,1,24},
-		{"ProxyLocalBuffer",&CONFIG_PROXY_LOCAL_BUFFER,0,TYPE_INT,PARM_OPT,0,720},
-		{"ProxyOfflineBuffer",&CONFIG_PROXY_OFFLINE_BUFFER,0,TYPE_INT,PARM_OPT,1,720},
-
-		{"HeartbeatFrequency",&CONFIG_HEARTBEAT_FREQUENCY,0,TYPE_INT,PARM_OPT,0,3600},
-		{"ConfigFrequency",&CONFIG_PROXYCONFIG_FREQUENCY,0,TYPE_INT,PARM_OPT,1,3600*7*24},
-		{"DataSenderFrequency",&CONFIG_PROXYDATA_FREQUENCY,0,TYPE_INT,PARM_OPT,1,3600},
-
-/*		{"SenderFrequency",&CONFIG_SENDER_FREQUENCY,0,TYPE_INT,PARM_OPT,5,3600},*/
-		{"TmpDir",&CONFIG_TMPDIR,0,TYPE_STRING,PARM_OPT,0,0},
-		{"FpingLocation",&CONFIG_FPING_LOCATION,0,TYPE_STRING,PARM_OPT,0,0},
+/*		 PARAMETER	,VAR	,FUNC,	TYPE(0i,1s),MANDATORY,MIN,MAX,RELOAD	*/
+		{"ProxyMode",&CONFIG_PROXYMODE,0,TYPE_INT,PARM_OPT,ZBX_PROXYMODE_ACTIVE,ZBX_PROXYMODE_PASSIVE,0},
+		{"Server",&CONFIG_SERVER,0,TYPE_STRING,PARM_OPT,0,0,0},
+		{"ServerPort",&CONFIG_SERVER_PORT,0,TYPE_INT,PARM_OPT,1024,32767,0},
+		{"Hostname",&CONFIG_HOSTNAME,0,TYPE_STRING,PARM_OPT,0,0,0},
+
+		{"StartDBSyncers",&CONFIG_DBSYNCER_FORKS,0,TYPE_INT,PARM_OPT,1,64,0},
+		{"StartDiscoverers",&CONFIG_DISCOVERER_FORKS,0,TYPE_INT,PARM_OPT,0,255,0},
+		{"StartHTTPPollers",&CONFIG_HTTPPOLLER_FORKS,0,TYPE_INT,PARM_OPT,0,255,0},
+		{"StartPingers",&CONFIG_PINGER_FORKS,0,TYPE_INT,PARM_OPT,0,255,0},
+		{"StartPollers",&CONFIG_POLLER_FORKS,0,TYPE_INT,PARM_OPT,0,255,0},
+		{"StartPollersUnreachable",&CONFIG_UNREACHABLE_POLLER_FORKS,0,TYPE_INT,PARM_OPT,0,255,0},
+		{"StartIPMIPollers",&CONFIG_IPMIPOLLER_FORKS,0,TYPE_INT,PARM_OPT,0,255,0},
+		{"StartTrappers",&CONFIG_TRAPPER_FORKS,0,TYPE_INT,PARM_OPT,0,255,0},
+
+		{"CacheSize",&CONFIG_DBCONFIG_SIZE,0,TYPE_INT,PARM_OPT,128*1024,1024*1024*1024,0},
+		{"HistoryCacheSize",&CONFIG_HISTORY_CACHE_SIZE,0,TYPE_INT,PARM_OPT,128*1024,1024*1024*1024,0},
+		{"TrendCacheSize",&CONFIG_TRENDS_CACHE_SIZE,0,TYPE_INT,PARM_OPT,128*1024,1024*1024*1024,0},
+		{"HistoryTextCacheSize",&CONFIG_TEXT_CACHE_SIZE,0,TYPE_INT,PARM_OPT,128*1024,1024*1024*1024,0},
+		{"CacheUpdateFrequency",&CONFIG_DBCONFIG_FREQUENCY,0,TYPE_INT,PARM_OPT,1,3600,0},
+
+		{"HousekeepingFrequency",&CONFIG_HOUSEKEEPING_FREQUENCY,0,TYPE_INT,PARM_OPT,1,24,0},
+		{"ProxyLocalBuffer",&CONFIG_PROXY_LOCAL_BUFFER,0,TYPE_INT,PARM_OPT,0,720,0},
+		{"ProxyOfflineBuffer",&CONFIG_PROXY_OFFLINE_BUFFER,0,TYPE_INT,PARM_OPT,1,720,0},
+
+		{"HeartbeatFrequency",&CONFIG_HEARTBEAT_FREQUENCY,0,TYPE_INT,PARM_OPT,0,3600,0},
+		{"ConfigFrequency",&CONFIG_PROXYCONFIG_FREQUENCY,0,TYPE_INT,PARM_OPT,1,3600*7*24,0},
+		{"DataSenderFrequency",&CONFIG_PROXYDATA_FREQUENCY,0,TYPE_INT,PARM_OPT,1,3600,0},
+
+/*		{"SenderFrequency",&CONFIG_SENDER_FREQUENCY,0,TYPE_INT,PARM_OPT,5,3600,0},*/
+		{"TmpDir",&CONFIG_TMPDIR,0,TYPE_STRING,PARM_OPT,0,0,0},
+		{"FpingLocation",&CONFIG_FPING_LOCATION,0,TYPE_STRING,PARM_OPT,0,0,0},
 #ifdef HAVE_IPV6
-		{"Fping6Location",&CONFIG_FPING6_LOCATION,0,TYPE_STRING,PARM_OPT,0,0},
+		{"Fping6Location",&CONFIG_FPING6_LOCATION,0,TYPE_STRING,PARM_OPT,0,0,0},
 #endif /* HAVE_IPV6 */
-		{"Timeout",&CONFIG_TIMEOUT,0,TYPE_INT,PARM_OPT,1,30},
-		{"TrapperTimeout",&CONFIG_TRAPPER_TIMEOUT,0,TYPE_INT,PARM_OPT,1,300},
-		{"UnreachablePeriod",&CONFIG_UNREACHABLE_PERIOD,0,TYPE_INT,PARM_OPT,1,3600},
-		{"UnreachableDelay",&CONFIG_UNREACHABLE_DELAY,0,TYPE_INT,PARM_OPT,1,3600},
-		{"UnavailableDelay",&CONFIG_UNAVAILABLE_DELAY,0,TYPE_INT,PARM_OPT,1,3600},
-		{"ListenIP",&CONFIG_LISTEN_IP,0,TYPE_STRING,PARM_OPT,0,0},
-		{"ListenPort",&CONFIG_LISTEN_PORT,0,TYPE_INT,PARM_OPT,1024,32767},
-		{"SourceIP",&CONFIG_SOURCE_IP,0,TYPE_STRING,PARM_OPT,0,0},
-		{"DebugLevel",&CONFIG_LOG_LEVEL,0,TYPE_INT,PARM_OPT,0,4},
-		{"PidFile",&CONFIG_PID_FILE,0,TYPE_STRING,PARM_OPT,0,0},
-		{"LogFile",&CONFIG_LOG_FILE,0,TYPE_STRING,PARM_OPT,0,0},
-		{"LogFileSize",&CONFIG_LOG_FILE_SIZE,0,TYPE_INT,PARM_OPT,0,1024},
-/*		{"AlertScriptsPath",&CONFIG_ALERT_SCRIPTS_PATH,0,TYPE_STRING,PARM_OPT,0,0},*/
-		{"ExternalScripts",&CONFIG_EXTERNALSCRIPTS,0,TYPE_STRING,PARM_OPT,0,0},
-		{"DBHost",&CONFIG_DBHOST,0,TYPE_STRING,PARM_OPT,0,0},
-		{"DBName",&CONFIG_DBNAME,0,TYPE_STRING,PARM_MAND,0,0},
-		{"DBSchema",&CONFIG_DBSCHEMA,0,TYPE_STRING,PARM_OPT,0,0},
-		{"DBUser",&CONFIG_DBUSER,0,TYPE_STRING,PARM_OPT,0,0},
-		{"DBPassword",&CONFIG_DBPASSWORD,0,TYPE_STRING,PARM_OPT,0,0},
-		{"DBSocket",&CONFIG_DBSOCKET,0,TYPE_STRING,PARM_OPT,0,0},
-		{"DBPort",&CONFIG_DBPORT,0,TYPE_INT,PARM_OPT,1024,65535},
-		{"SSHKeyLocation",&CONFIG_SSH_KEY_LOCATION,0,TYPE_STRING,PARM_OPT,0,0},
-		{"LogSlowQueries",&CONFIG_LOG_SLOW_QUERIES,0,TYPE_INT,PARM_OPT,0,3600000},
+		{"Timeout",&CONFIG_TIMEOUT,0,TYPE_INT,PARM_OPT,1,30,0},
+		{"TrapperTimeout",&CONFIG_TRAPPER_TIMEOUT,0,TYPE_INT,PARM_OPT,1,300,0},
+		{"UnreachablePeriod",&CONFIG_UNREACHABLE_PERIOD,0,TYPE_INT,PARM_OPT,1,3600,0},
+		{"UnreachableDelay",&CONFIG_UNREACHABLE_DELAY,0,TYPE_INT,PARM_OPT,1,3600,0},
+		{"UnavailableDelay",&CONFIG_UNAVAILABLE_DELAY,0,TYPE_INT,PARM_OPT,1,3600,0},
+		{"ListenIP",&CONFIG_LISTEN_IP,0,TYPE_STRING,PARM_OPT,0,0,0},
+		{"ListenPort",&CONFIG_LISTEN_PORT,0,TYPE_INT,PARM_OPT,1024,32767,0},
+		{"SourceIP",&CONFIG_SOURCE_IP,0,TYPE_STRING,PARM_OPT,0,0,0},
+		{"DebugLevel",&CONFIG_LOG_LEVEL,0,TYPE_INT,PARM_OPT,0,4,1},
+		{"PidFile",&CONFIG_PID_FILE,0,TYPE_STRING,PARM_OPT,0,0,0},
+		{"LogFile",&CONFIG_LOG_FILE,0,TYPE_STRING,PARM_OPT,0,0,0},
+		{"LogFileSize",&CONFIG_LOG_FILE_SIZE,0,TYPE_INT,PARM_OPT,0,1024,0},
+/*		{"AlertScriptsPath",&CONFIG_ALERT_SCRIPTS_PATH,0,TYPE_STRING,PARM_OPT,0,0,0},*/
+		{"ExternalScripts",&CONFIG_EXTERNALSCRIPTS,0,TYPE_STRING,PARM_OPT,0,0,0},
+		{"DBHost",&CONFIG_DBHOST,0,TYPE_STRING,PARM_OPT,0,0,0},
+		{"DBName",&CONFIG_DBNAME,0,TYPE_STRING,PARM_MAND,0,0,0},
+		{"DBSchema",&CONFIG_DBSCHEMA,0,TYPE_STRING,PARM_OPT,0,0,0},
+		{"DBUser",&CONFIG_DBUSER,0,TYPE_STRING,PARM_OPT,0,0,0},
+		{"DBPassword",&CONFIG_DBPASSWORD,0,TYPE_STRING,PARM_OPT,0,0,0},
+		{"DBSocket",&CONFIG_DBSOCKET,0,TYPE_STRING,PARM_OPT,0,0,0},
+		{"DBPort",&CONFIG_DBPORT,0,TYPE_INT,PARM_OPT,1024,65535,0},
+		{"SSHKeyLocation",&CONFIG_SSH_KEY_LOCATION,0,TYPE_STRING,PARM_OPT,0,0,0},
+		{"LogSlowQueries",&CONFIG_LOG_SLOW_QUERIES,0,TYPE_INT,PARM_OPT,0,3600000,1},
 		{0}
 	};
 
-	CONFIG_SERVER_STARTUP_TIME = time(NULL);
+	/* setting default value for reloading config */
+	if(reload)
+	{
+		CONFIG_LOG_LEVEL = LOG_LEVEL_WARNING;
+		CONFIG_LOG_SLOW_QUERIES = 0;
+	}
 
-	parse_cfg_file(CONFIG_FILE, cfg);
+	parse_cfg_file(CONFIG_FILE, cfg, reload);
 
+	if(reload)
+	{
+		zabbix_set_log_level(CONFIG_LOG_LEVEL);
+	}
+	else
+	{
+	CONFIG_SERVER_STARTUP_TIME = time(NULL);
 	if (ZBX_PROXYMODE_ACTIVE == CONFIG_PROXYMODE &&
 			(NULL == CONFIG_SERVER || '\0' == *CONFIG_SERVER))
 	{
@@ -328,6 +340,7 @@ void	init_config(void)
 	{
 		CONFIG_EXTERNALSCRIPTS=strdup("/etc/zabbix/externalscripts");
 	}
+	}
 }
 
 /******************************************************************************
@@ -382,7 +395,7 @@ int	main(int argc, char **argv)
 	/* Required for simple checks */
 	init_metrics();
 
-	init_config();
+	init_config(0);
 
 #ifdef HAVE_OPENIPMI
 	init_ipmi_handler();
@@ -656,6 +669,33 @@ int MAIN_ZABBIX_ENTRY(void)
 	return SUCCEED;
 }
 
+void	reload_action()
+{
+	init_config(1);
+}
+
+void	zbx_on_reload()
+{
+	init_config(1);
+	if (threads != NULL)
+	{
+		int	i;
+
+		for (i = 1; i <= CONFIG_CONFSYNCER_FORKS + CONFIG_DATASENDER_FORKS
+				+ CONFIG_POLLER_FORKS + CONFIG_UNREACHABLE_POLLER_FORKS
+				+ CONFIG_TRAPPER_FORKS + CONFIG_PINGER_FORKS
+				+ CONFIG_HOUSEKEEPER_FORKS + CONFIG_HTTPPOLLER_FORKS
+				+ CONFIG_DISCOVERER_FORKS + CONFIG_DBSYNCER_FORKS
+				+ CONFIG_IPMIPOLLER_FORKS; i++)
+		{
+			if (threads[i])
+			{
+				kill(threads[i], SIGHUP);
+			}
+		}
+	}
+}
+
 void	zbx_on_exit()
 {
 	zabbix_log(LOG_LEVEL_DEBUG, "zbx_on_exit() called");
diff -uNrp zabbix-1.8.4.orig/src/zabbix_sender/zabbix_sender.c zabbix-1.8.4/src/zabbix_sender/zabbix_sender.c
--- zabbix-1.8.4.orig/src/zabbix_sender/zabbix_sender.c	2011-01-04 22:57:50.000000000 +0900
+++ zabbix-1.8.4/src/zabbix_sender/zabbix_sender.c	2011-03-28 00:35:02.000000000 +0900
@@ -260,17 +260,17 @@ static void    init_config(const char* c
 
 	struct cfg_line cfg[]=
 	{
-		/* PARAMETER	,VAR				,FUNC	,TYPE(0i,1s)	,MANDATORY	,MIN			,MAX		*/
-		{"SourceIP"	,&config_source_ip_from_conf	,0	,TYPE_STRING	,PARM_OPT	,0			,0		},
-		{"Server"	,&zabbix_server_from_conf	,0	,TYPE_STRING	,PARM_OPT	,0			,0		},
-		{"ServerPort"	,&zabbix_server_port_from_conf	,0	,TYPE_INT	,PARM_OPT	,MIN_ZABBIX_PORT	,MAX_ZABBIX_PORT},
-		{"Hostname"	,&zabbix_hostname_from_conf	,0	,TYPE_STRING	,PARM_OPT	,0			,0		},
+		/* PARAMETER	,VAR				,FUNC	,TYPE(0i,1s)	,MANDATORY	,MIN			,MAX	,RELOAD	*/
+		{"SourceIP"	,&config_source_ip_from_conf	,0	,TYPE_STRING	,PARM_OPT	,0			,0	,0	},
+		{"Server"	,&zabbix_server_from_conf	,0	,TYPE_STRING	,PARM_OPT	,0			,0	,0	},
+		{"ServerPort"	,&zabbix_server_port_from_conf	,0	,TYPE_INT	,PARM_OPT	,MIN_ZABBIX_PORT	,MAX_ZABBIX_PORT	,0},
+		{"Hostname"	,&zabbix_hostname_from_conf	,0	,TYPE_STRING	,PARM_OPT	,0			,0	,0	},
 		{0}
 	};
 
 	if( config_file )
 	{
-		parse_cfg_file(config_file, cfg);
+		parse_cfg_file(config_file, cfg, 0);
 
 		if (NULL != config_source_ip_from_conf)
 		{
diff -uNrp zabbix-1.8.4.orig/src/zabbix_server/server.c zabbix-1.8.4/src/zabbix_server/server.c
--- zabbix-1.8.4.orig/src/zabbix_server/server.c	2011-01-04 22:57:50.000000000 +0900
+++ zabbix-1.8.4/src/zabbix_server/server.c	2011-03-28 01:15:28.000000000 +0900
@@ -190,68 +190,81 @@ ZBX_MUTEX	node_sync_access;
  * Comments: will terminate process if parsing fails                          *
  *                                                                            *
  ******************************************************************************/
-void	init_config(void)
+void	init_config(int reload)
 {
 	static struct cfg_line cfg[]=
 	{
-/*		 PARAMETER	,VAR	,FUNC,	TYPE(0i,1s),MANDATORY,MIN,MAX	*/
-		{"StartDBSyncers",&CONFIG_DBSYNCER_FORKS,0,TYPE_INT,PARM_OPT,1,64},
-		{"StartDiscoverers",&CONFIG_DISCOVERER_FORKS,0,TYPE_INT,PARM_OPT,0,255},
-		{"StartHTTPPollers",&CONFIG_HTTPPOLLER_FORKS,0,TYPE_INT,PARM_OPT,0,255},
-		{"StartPingers",&CONFIG_PINGER_FORKS,0,TYPE_INT,PARM_OPT,0,255},
-		{"StartPollers",&CONFIG_POLLER_FORKS,0,TYPE_INT,PARM_OPT,0,255},
-		{"StartPollersUnreachable",&CONFIG_UNREACHABLE_POLLER_FORKS,0,TYPE_INT,PARM_OPT,0,255},
-		{"StartIPMIPollers",&CONFIG_IPMIPOLLER_FORKS,0,TYPE_INT,PARM_OPT,0,255},
-		{"StartTrappers",&CONFIG_TRAPPER_FORKS,0,TYPE_INT,PARM_OPT,0,255},
-		{"CacheSize",&CONFIG_DBCONFIG_SIZE,0,TYPE_INT,PARM_OPT,128*1024,1024*1024*1024},
-		{"HistoryCacheSize",&CONFIG_HISTORY_CACHE_SIZE,0,TYPE_INT,PARM_OPT,128*1024,1024*1024*1024},
-		{"TrendCacheSize",&CONFIG_TRENDS_CACHE_SIZE,0,TYPE_INT,PARM_OPT,128*1024,1024*1024*1024},
-		{"HistoryTextCacheSize",&CONFIG_TEXT_CACHE_SIZE,0,TYPE_INT,PARM_OPT,128*1024,1024*1024*1024},
-		{"CacheUpdateFrequency",&CONFIG_DBCONFIG_FREQUENCY,0,TYPE_INT,PARM_OPT,1,3600},
-		{"HousekeepingFrequency",&CONFIG_HOUSEKEEPING_FREQUENCY,0,TYPE_INT,PARM_OPT,1,24},
-		{"MaxHousekeeperDelete",&CONFIG_MAX_HOUSEKEEPER_DELETE,0,TYPE_INT,PARM_OPT,0,1000000},
-		{"SenderFrequency",&CONFIG_SENDER_FREQUENCY,0,TYPE_INT,PARM_OPT,5,3600},
-		{"TmpDir",&CONFIG_TMPDIR,0,TYPE_STRING,PARM_OPT,0,0},
-		{"FpingLocation",&CONFIG_FPING_LOCATION,0,TYPE_STRING,PARM_OPT,0,0},
+/*		 PARAMETER	,VAR	,FUNC,	TYPE(0i,1s),MANDATORY,MIN,MAX,RELOAD	*/
+		{"StartDBSyncers",&CONFIG_DBSYNCER_FORKS,0,TYPE_INT,PARM_OPT,1,64,0},
+		{"StartDiscoverers",&CONFIG_DISCOVERER_FORKS,0,TYPE_INT,PARM_OPT,0,255,0},
+		{"StartHTTPPollers",&CONFIG_HTTPPOLLER_FORKS,0,TYPE_INT,PARM_OPT,0,255,0},
+		{"StartPingers",&CONFIG_PINGER_FORKS,0,TYPE_INT,PARM_OPT,0,255,0},
+		{"StartPollers",&CONFIG_POLLER_FORKS,0,TYPE_INT,PARM_OPT,0,255,0},
+		{"StartPollersUnreachable",&CONFIG_UNREACHABLE_POLLER_FORKS,0,TYPE_INT,PARM_OPT,0,255,0},
+		{"StartIPMIPollers",&CONFIG_IPMIPOLLER_FORKS,0,TYPE_INT,PARM_OPT,0,255,0},
+		{"StartTrappers",&CONFIG_TRAPPER_FORKS,0,TYPE_INT,PARM_OPT,0,255,0},
+		{"CacheSize",&CONFIG_DBCONFIG_SIZE,0,TYPE_INT,PARM_OPT,128*1024,1024*1024*1024,0},
+		{"HistoryCacheSize",&CONFIG_HISTORY_CACHE_SIZE,0,TYPE_INT,PARM_OPT,128*1024,1024*1024*1024,0},
+		{"TrendCacheSize",&CONFIG_TRENDS_CACHE_SIZE,0,TYPE_INT,PARM_OPT,128*1024,1024*1024*1024,0},
+		{"HistoryTextCacheSize",&CONFIG_TEXT_CACHE_SIZE,0,TYPE_INT,PARM_OPT,128*1024,1024*1024*1024,0},
+		{"CacheUpdateFrequency",&CONFIG_DBCONFIG_FREQUENCY,0,TYPE_INT,PARM_OPT,1,3600,0},
+		{"HousekeepingFrequency",&CONFIG_HOUSEKEEPING_FREQUENCY,0,TYPE_INT,PARM_OPT,1,24,0},
+		{"MaxHousekeeperDelete",&CONFIG_MAX_HOUSEKEEPER_DELETE,0,TYPE_INT,PARM_OPT,0,1000000,0},
+		{"SenderFrequency",&CONFIG_SENDER_FREQUENCY,0,TYPE_INT,PARM_OPT,5,3600,0},
+		{"TmpDir",&CONFIG_TMPDIR,0,TYPE_STRING,PARM_OPT,0,0,0},
+		{"FpingLocation",&CONFIG_FPING_LOCATION,0,TYPE_STRING,PARM_OPT,0,0,0},
 #ifdef HAVE_IPV6
-		{"Fping6Location",&CONFIG_FPING6_LOCATION,0,TYPE_STRING,PARM_OPT,0,0},
+		{"Fping6Location",&CONFIG_FPING6_LOCATION,0,TYPE_STRING,PARM_OPT,0,0,0},
 #endif /* HAVE_IPV6 */
-		{"Timeout",&CONFIG_TIMEOUT,0,TYPE_INT,PARM_OPT,1,30},
-		{"TrapperTimeout",&CONFIG_TRAPPER_TIMEOUT,0,TYPE_INT,PARM_OPT,1,300},
-		{"UnreachablePeriod",&CONFIG_UNREACHABLE_PERIOD,0,TYPE_INT,PARM_OPT,1,3600},
-		{"UnreachableDelay",&CONFIG_UNREACHABLE_DELAY,0,TYPE_INT,PARM_OPT,1,3600},
-		{"UnavailableDelay",&CONFIG_UNAVAILABLE_DELAY,0,TYPE_INT,PARM_OPT,1,3600},
-		{"ListenIP",&CONFIG_LISTEN_IP,0,TYPE_STRING,PARM_OPT,0,0},
-		{"ListenPort",&CONFIG_LISTEN_PORT,0,TYPE_INT,PARM_OPT,1024,32767},
-		{"SourceIP",&CONFIG_SOURCE_IP,0,TYPE_STRING,PARM_OPT,0,0},
-		{"DisableHousekeeping",&CONFIG_DISABLE_HOUSEKEEPING,0,TYPE_INT,PARM_OPT,0,1},
-		{"DebugLevel",&CONFIG_LOG_LEVEL,0,TYPE_INT,PARM_OPT,0,4},
-		{"PidFile",&CONFIG_PID_FILE,0,TYPE_STRING,PARM_OPT,0,0},
-		{"LogFile",&CONFIG_LOG_FILE,0,TYPE_STRING,PARM_OPT,0,0},
-		{"LogFileSize",&CONFIG_LOG_FILE_SIZE,0,TYPE_INT,PARM_OPT,0,1024},
-		{"AlertScriptsPath",&CONFIG_ALERT_SCRIPTS_PATH,0,TYPE_STRING,PARM_OPT,0,0},
-		{"ExternalScripts",&CONFIG_EXTERNALSCRIPTS,0,TYPE_STRING,PARM_OPT,0,0},
-		{"DBHost",&CONFIG_DBHOST,0,TYPE_STRING,PARM_OPT,0,0},
-		{"DBName",&CONFIG_DBNAME,0,TYPE_STRING,PARM_MAND,0,0},
-		{"DBSchema",&CONFIG_DBSCHEMA,0,TYPE_STRING,PARM_OPT,0,0},
-		{"DBUser",&CONFIG_DBUSER,0,TYPE_STRING,PARM_OPT,0,0},
-		{"DBPassword",&CONFIG_DBPASSWORD,0,TYPE_STRING,PARM_OPT,0,0},
-		{"DBSocket",&CONFIG_DBSOCKET,0,TYPE_STRING,PARM_OPT,0,0},
-		{"DBPort",&CONFIG_DBPORT,0,TYPE_INT,PARM_OPT,1024,65535},
-		{"NodeID",&CONFIG_NODEID,0,TYPE_INT,PARM_OPT,0,65535},
-		{"NodeNoEvents",&CONFIG_NODE_NOEVENTS,0,TYPE_INT,PARM_OPT,0,1},
-		{"NodeNoHistory",&CONFIG_NODE_NOHISTORY,0,TYPE_INT,PARM_OPT,0,1},
-		{"SSHKeyLocation",&CONFIG_SSH_KEY_LOCATION,0,TYPE_STRING,PARM_OPT,0,0},
-		{"LogSlowQueries",&CONFIG_LOG_SLOW_QUERIES,0,TYPE_INT,PARM_OPT,0,3600000},
-		{"StartProxyPollers",&CONFIG_PROXYPOLLER_FORKS,0,TYPE_INT,PARM_OPT,0,255},
-		{"ProxyConfigFrequency",&CONFIG_PROXYCONFIG_FREQUENCY,0,TYPE_INT,PARM_OPT,1,3600*7*24},
-		{"ProxyDataFrequency",&CONFIG_PROXYDATA_FREQUENCY,0,TYPE_INT,PARM_OPT,1,3600},
+		{"Timeout",&CONFIG_TIMEOUT,0,TYPE_INT,PARM_OPT,1,30,0},
+		{"TrapperTimeout",&CONFIG_TRAPPER_TIMEOUT,0,TYPE_INT,PARM_OPT,1,300,0},
+		{"UnreachablePeriod",&CONFIG_UNREACHABLE_PERIOD,0,TYPE_INT,PARM_OPT,1,3600,0},
+		{"UnreachableDelay",&CONFIG_UNREACHABLE_DELAY,0,TYPE_INT,PARM_OPT,1,3600,0},
+		{"UnavailableDelay",&CONFIG_UNAVAILABLE_DELAY,0,TYPE_INT,PARM_OPT,1,3600,0},
+		{"ListenIP",&CONFIG_LISTEN_IP,0,TYPE_STRING,PARM_OPT,0,0,0},
+		{"ListenPort",&CONFIG_LISTEN_PORT,0,TYPE_INT,PARM_OPT,1024,32767,0},
+		{"SourceIP",&CONFIG_SOURCE_IP,0,TYPE_STRING,PARM_OPT,0,0,0},
+		{"DisableHousekeeping",&CONFIG_DISABLE_HOUSEKEEPING,0,TYPE_INT,PARM_OPT,0,1,0},
+		{"DebugLevel",&CONFIG_LOG_LEVEL,0,TYPE_INT,PARM_OPT,0,4,1},
+		{"PidFile",&CONFIG_PID_FILE,0,TYPE_STRING,PARM_OPT,0,0,0},
+		{"LogFile",&CONFIG_LOG_FILE,0,TYPE_STRING,PARM_OPT,0,0,0},
+		{"LogFileSize",&CONFIG_LOG_FILE_SIZE,0,TYPE_INT,PARM_OPT,0,1024,0},
+		{"AlertScriptsPath",&CONFIG_ALERT_SCRIPTS_PATH,0,TYPE_STRING,PARM_OPT,0,0,0},
+		{"ExternalScripts",&CONFIG_EXTERNALSCRIPTS,0,TYPE_STRING,PARM_OPT,0,0,0},
+		{"DBHost",&CONFIG_DBHOST,0,TYPE_STRING,PARM_OPT,0,0,0},
+		{"DBName",&CONFIG_DBNAME,0,TYPE_STRING,PARM_MAND,0,0,0},
+		{"DBSchema",&CONFIG_DBSCHEMA,0,TYPE_STRING,PARM_OPT,0,0,0},
+		{"DBUser",&CONFIG_DBUSER,0,TYPE_STRING,PARM_OPT,0,0,0},
+		{"DBPassword",&CONFIG_DBPASSWORD,0,TYPE_STRING,PARM_OPT,0,0,0},
+		{"DBSocket",&CONFIG_DBSOCKET,0,TYPE_STRING,PARM_OPT,0,0,0},
+		{"DBPort",&CONFIG_DBPORT,0,TYPE_INT,PARM_OPT,1024,65535,0},
+		{"NodeID",&CONFIG_NODEID,0,TYPE_INT,PARM_OPT,0,65535,0},
+		{"NodeNoEvents",&CONFIG_NODE_NOEVENTS,0,TYPE_INT,PARM_OPT,0,1,0},
+		{"NodeNoHistory",&CONFIG_NODE_NOHISTORY,0,TYPE_INT,PARM_OPT,0,1,0},
+		{"SSHKeyLocation",&CONFIG_SSH_KEY_LOCATION,0,TYPE_STRING,PARM_OPT,0,0,0},
+		{"LogSlowQueries",&CONFIG_LOG_SLOW_QUERIES,0,TYPE_INT,PARM_OPT,0,3600000,1},
+		{"StartProxyPollers",&CONFIG_PROXYPOLLER_FORKS,0,TYPE_INT,PARM_OPT,0,255,0},
+		{"ProxyConfigFrequency",&CONFIG_PROXYCONFIG_FREQUENCY,0,TYPE_INT,PARM_OPT,1,3600*7*24,0},
+		{"ProxyDataFrequency",&CONFIG_PROXYDATA_FREQUENCY,0,TYPE_INT,PARM_OPT,1,3600,0},
 		{0}
 	};
 
-	CONFIG_SERVER_STARTUP_TIME = time(NULL);
+	/* setting default value for reloading config */
+	if(reload)
+	{
+		CONFIG_LOG_LEVEL = LOG_LEVEL_WARNING;
+		CONFIG_LOG_SLOW_QUERIES = 0;
+	}
 
-	parse_cfg_file(CONFIG_FILE, cfg);
+	parse_cfg_file(CONFIG_FILE, cfg, reload);
+
+	if(reload)
+	{
+		zabbix_set_log_level(CONFIG_LOG_LEVEL);
+	}
+	else
+	{
+	CONFIG_SERVER_STARTUP_TIME = time(NULL);
 
 	if(CONFIG_DBNAME == NULL)
 	{
@@ -291,6 +304,7 @@ void	init_config(void)
 #ifdef HAVE_SQLITE3
 	CONFIG_MAX_HOUSEKEEPER_DELETE = 0;
 #endif
+	}
 }
 
 /******************************************************************************
@@ -353,7 +367,7 @@ int	main(int argc, char **argv)
 	/* Required for simple checks */
 	init_metrics();
 
-	init_config();
+	init_config(0);
 
 #ifdef HAVE_OPENIPMI
 	init_ipmi_handler();
@@ -732,6 +746,35 @@ int	MAIN_ZABBIX_ENTRY(void)
 	return SUCCEED;
 }
 
+void	reload_action()
+{
+	init_config(1);
+}
+
+void	zbx_on_reload()
+{
+	init_config(1);
+	if (threads != NULL)
+	{
+		int	i;
+
+		for (i = 1; i <= CONFIG_DBCONFIG_FORKS + CONFIG_POLLER_FORKS
+				+ CONFIG_UNREACHABLE_POLLER_FORKS + CONFIG_TRAPPER_FORKS
+				+ CONFIG_PINGER_FORKS + CONFIG_ALERTER_FORKS
+				+ CONFIG_HOUSEKEEPER_FORKS + CONFIG_TIMER_FORKS
+				+ CONFIG_NODEWATCHER_FORKS + CONFIG_HTTPPOLLER_FORKS
+				+ CONFIG_DISCOVERER_FORKS + CONFIG_DBSYNCER_FORKS
+				+ CONFIG_ESCALATOR_FORKS + CONFIG_IPMIPOLLER_FORKS
+				+ CONFIG_PROXYPOLLER_FORKS; i++)
+		{
+			if (threads[i])
+			{
+				kill(threads[i], SIGHUP);
+			}
+		}
+	}
+}
+
 void	zbx_on_exit()
 {
 	zabbix_log(LOG_LEVEL_DEBUG, "zbx_on_exit() called");
