diff -ur /tmp/zbx_orig/zabbix-2.0.5/src/libs/zbxalgo/vector.c src/libs/zbxalgo/vector.c --- /tmp/zbx_orig/zabbix-2.0.5/src/libs/zbxalgo/vector.c 2013-02-12 13:27:22.000000000 +0200 +++ src/libs/zbxalgo/vector.c 2013-03-07 17:59:57.048133138 +0200 @@ -168,7 +168,7 @@ return FAIL; \ } \ \ -int zbx_vector_ ## __id ## _search(zbx_vector_ ## __id ## _t *vector, __type value, \ +int zbx_vector_ ## __id ## _search(zbx_vector_ ## __id ## _t *vector, const __type value, \ zbx_compare_func_t compare_func) \ { \ int index; \ diff -ur /tmp/zbx_orig/zabbix-2.0.5/src/zabbix_server/housekeeper/housekeeper.c src/zabbix_server/housekeeper/housekeeper.c --- /tmp/zbx_orig/zabbix-2.0.5/src/zabbix_server/housekeeper/housekeeper.c 2013-02-12 13:27:22.000000000 +0200 +++ src/zabbix_server/housekeeper/housekeeper.c 2013-03-07 17:59:57.048133138 +0200 @@ -29,6 +29,8 @@ extern unsigned char process_type; +zbx_vector_str_t disabled_tables; + /****************************************************************************** * * * Function: housekeeping_cleanup * @@ -68,7 +70,11 @@ housekeeper.field = row[2]; ZBX_STR2UINT64(housekeeper.value, row[3]); - if (0 == CONFIG_MAX_HOUSEKEEPER_DELETE) + + + if (zbx_vector_str_search(&disabled_tables, housekeeper.tablename, ZBX_DEFAULT_STR_COMPARE_FUNC) != FAIL) + d = 0; + else if (0 == CONFIG_MAX_HOUSEKEEPER_DELETE) { d = DBexecute( "delete from %s" @@ -148,6 +154,9 @@ const char *__function_name = "housekeeping_sessions"; int deleted; + if (zbx_vector_str_search(&disabled_tables, "sessions", ZBX_DEFAULT_STR_COMPARE_FUNC) != FAIL) + return 0; + zabbix_log(LOG_LEVEL_DEBUG, "In %s() now:%d", __function_name, now); deleted = DBexecute("delete from sessions where lastaccess<%d", now - SEC_PER_YEAR); @@ -162,6 +171,9 @@ const char *__function_name = "housekeeping_alerts"; int deleted, alert_history; + if (zbx_vector_str_search(&disabled_tables, "alerts", ZBX_DEFAULT_STR_COMPARE_FUNC) != FAIL) + return 0; + zabbix_log(LOG_LEVEL_DEBUG, "In %s() now:%d", __function_name, now); deleted = DBexecute("delete from alerts where clock<%d", @@ -180,6 +192,9 @@ DB_ROW row; zbx_uint64_t eventid; + if (zbx_vector_str_search(&disabled_tables, "events", ZBX_DEFAULT_STR_COMPARE_FUNC) != FAIL) + return 0; + zabbix_log(LOG_LEVEL_DEBUG, "In %s() now:%d", __function_name, now); result = DBselect("select eventid from events where clock<%d", @@ -221,6 +236,9 @@ DB_ROW row; int min_clock, deleted; + if (zbx_vector_str_search(&disabled_tables, table, ZBX_DEFAULT_STR_COMPARE_FUNC) != FAIL) + return 0; + zabbix_log(LOG_LEVEL_DEBUG, "In %s() table:'%s' itemid:" ZBX_FS_UI64 " keep_history:%d now:%d", __function_name, table, itemid, keep_history, now); @@ -299,6 +317,12 @@ { int now, d_history_and_trends, d_cleanup, d_events, d_alerts, d_sessions; + zbx_vector_str_create(&disabled_tables); + char *disabled_table; + if (CONFIG_DISABLE_HOUSEKEEPING && strcmp(CONFIG_DISABLE_HOUSEKEEPING,"0") != 0) + for (disabled_table = strtok(CONFIG_DISABLE_HOUSEKEEPING, ","); disabled_table; disabled_table = strtok(NULL, ",")) + zbx_vector_str_append(&disabled_tables, disabled_table); + for (;;) { zabbix_log(LOG_LEVEL_WARNING, "executing housekeeper"); diff -ur /tmp/zbx_orig/zabbix-2.0.5/src/zabbix_server/housekeeper/housekeeper.h src/zabbix_server/housekeeper/housekeeper.h --- /tmp/zbx_orig/zabbix-2.0.5/src/zabbix_server/housekeeper/housekeeper.h 2013-02-12 13:27:22.000000000 +0200 +++ src/zabbix_server/housekeeper/housekeeper.h 2013-03-07 17:59:57.048133138 +0200 @@ -22,6 +22,7 @@ extern int CONFIG_HOUSEKEEPING_FREQUENCY; extern int CONFIG_MAX_HOUSEKEEPER_DELETE; +extern char *CONFIG_DISABLE_HOUSEKEEPING; void main_housekeeper_loop(); diff -ur /tmp/zbx_orig/zabbix-2.0.5/src/zabbix_server/server.c src/zabbix_server/server.c --- /tmp/zbx_orig/zabbix-2.0.5/src/zabbix_server/server.c 2013-02-12 13:27:22.000000000 +0200 +++ src/zabbix_server/server.c 2013-03-07 17:59:57.048133138 +0200 @@ -138,7 +138,7 @@ int CONFIG_HISTORY_CACHE_SIZE = 8 * ZBX_MEBIBYTE; int CONFIG_TRENDS_CACHE_SIZE = 4 * ZBX_MEBIBYTE; int CONFIG_TEXT_CACHE_SIZE = 16 * ZBX_MEBIBYTE; -int CONFIG_DISABLE_HOUSEKEEPING = 0; +char *CONFIG_DISABLE_HOUSEKEEPING = NULL; int CONFIG_UNREACHABLE_PERIOD = 45; int CONFIG_UNREACHABLE_DELAY = 15; int CONFIG_UNAVAILABLE_DELAY = 60; @@ -232,7 +232,7 @@ CONFIG_MAX_HOUSEKEEPER_DELETE = 0; #endif - if (1 == CONFIG_DISABLE_HOUSEKEEPING) + if (CONFIG_DISABLE_HOUSEKEEPING && strcmp(CONFIG_DISABLE_HOUSEKEEPING, "1") == 0) CONFIG_HOUSEKEEPER_FORKS = 0; } @@ -341,7 +341,7 @@ PARM_OPT, 1024, 32767}, {"SourceIP", &CONFIG_SOURCE_IP, TYPE_STRING, PARM_OPT, 0, 0}, - {"DisableHousekeeping", &CONFIG_DISABLE_HOUSEKEEPING, TYPE_INT, + {"DisableHousekeeping", &CONFIG_DISABLE_HOUSEKEEPING, TYPE_STRING, PARM_OPT, 0, 1}, {"DebugLevel", &CONFIG_LOG_LEVEL, TYPE_INT, PARM_OPT, 0, 4}, Only in include/: config.h.in~ diff -ur /tmp/zbx_orig/zabbix-2.0.5/include/zbxalgo.h include/zbxalgo.h --- /tmp/zbx_orig/zabbix-2.0.5/include/zbxalgo.h 2013-02-12 13:27:22.000000000 +0200 +++ include/zbxalgo.h 2013-03-07 20:35:15.350752965 +0200 @@ -264,7 +264,7 @@ zbx_compare_func_t compare_func); \ int zbx_vector_ ## __id ## _lsearch(zbx_vector_ ## __id ## _t *vector, __type value, int *index, \ zbx_compare_func_t compare_func); \ -int zbx_vector_ ## __id ## _search(zbx_vector_ ## __id ## _t *vector, __type value, \ +int zbx_vector_ ## __id ## _search(zbx_vector_ ## __id ## _t *vector, const __type value, \ zbx_compare_func_t compare_func); \ \ void zbx_vector_ ## __id ## _reserve(zbx_vector_ ## __id ## _t *vector, size_t size); \