[icinga-checkins] icinga.org: icinga-core/hbaecker/ssl: add more debugoutput for table trimming options

git at icinga.org git at icinga.org
Fri Oct 9 18:44:15 CEST 2009


Module: icinga-core
Branch: hbaecker/ssl
Commit: ecef7a22290e4f1628a21b00da8e272761c0c387
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=ecef7a22290e4f1628a21b00da8e272761c0c387

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Thu Oct  8 14:56:24 2009 +0200

add more debugoutput for table trimming options
debug_level=-1, debug_verbosity=2 => ido2db.debug:
ndo2db_db_perform_maintenance() max_timedevents_age=3600, max_systemcommands_age=86400, max_servicechecks_age=86400, max_hostchecks_age=86400, max_eventhandlers_age=604800, max_externalcommands_age=604800, trim_db_interval=60

---

 module/idoutils/src/db.c     |    4 ++--
 module/idoutils/src/ido2db.c |    3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/module/idoutils/src/db.c b/module/idoutils/src/db.c
index ecc6111..4fe56bb 100644
--- a/module/idoutils/src/db.c
+++ b/module/idoutils/src/db.c
@@ -846,7 +846,7 @@ int ndo2db_db_perform_maintenance(ndo2db_idi *idi) {
 	/* get the current time */
 	time(&current_time);
 
-	ndo2db_log_debug_info(NDO2DB_DEBUGL_PROCESSINFO, 2, "ndo2db_db_perform_maintenance() trim_db_interval=%lu\n", idi->dbinfo.trim_db_interval);
+	ndo2db_log_debug_info(NDO2DB_DEBUGL_PROCESSINFO, 2, "ndo2db_db_perform_maintenance() max_timedevents_age=%lu, max_systemcommands_age=%lu, max_servicechecks_age=%lu, max_hostchecks_age=%lu, max_eventhandlers_age=%lu, max_externalcommands_age=%lu, trim_db_interval=%lu\n", idi->dbinfo.max_timedevents_age, idi->dbinfo.max_systemcommands_age, idi->dbinfo.max_servicechecks_age, idi->dbinfo.max_hostchecks_age, idi->dbinfo.max_eventhandlers_age, idi->dbinfo.max_externalcommands_age, idi->dbinfo.trim_db_interval);
 
 	/* trim tables */
 	if (((unsigned long) current_time - idi->dbinfo.trim_db_interval) > (unsigned long) idi->dbinfo.last_table_trim_time) {
@@ -861,7 +861,7 @@ int ndo2db_db_perform_maintenance(ndo2db_idi *idi) {
 		if (idi->dbinfo.max_eventhandlers_age > 0L)
 			ndo2db_db_trim_data_table(idi, ndo2db_db_tablenames[NDO2DB_DBTABLE_EVENTHANDLERS], "start_time", (time_t) ((unsigned long) current_time - idi->dbinfo.max_eventhandlers_age));
 		if(idi->dbinfo.max_externalcommands_age>0L)
-			ndo2db_db_trim_data_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_EXTERNALCOMMANDS],"entry_time",(time_t)((unsigned long)current_time-idi->dbinfo.max_externalcommands_age));
+			ndo2db_db_trim_data_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_EXTERNALCOMMANDS],"entry_time",(time_t)((unsigned long)current_time - idi->dbinfo.max_externalcommands_age));
 		idi->dbinfo.last_table_trim_time = current_time;
 	}
 
diff --git a/module/idoutils/src/ido2db.c b/module/idoutils/src/ido2db.c
index c9ca85f..413197e 100644
--- a/module/idoutils/src/ido2db.c
+++ b/module/idoutils/src/ido2db.c
@@ -411,7 +411,8 @@ int ndo2db_process_config_var(char *arg){
 	else if(!strcmp(var,"max_debug_file_size"))
 		ndo2db_max_debug_file_size=strtoul(val,NULL,0);
 
-	ndo2db_log_debug_info(NDO2DB_DEBUGL_PROCESSINFO, 2, "ndo2db_process_config_var() trim_db_interval=%lu\n", ndo2db_db_settings.trim_db_interval);
+	ndo2db_log_debug_info(NDO2DB_DEBUGL_PROCESSINFO, 2, "ndo2db_process_config_var() config set: lock_file=%s, socket_type=%d, socket_name=%s, tcp_port=%d, db_servertype=%d, db_host=%s, db_port=%d, db_user=%s, db_pass=%s, db_name=%s, db_prefix=%s, max_timedevents_age=%lu, max_systemcommands_age=%lu, max_servicechecks_age=%lu, max_hostchecks_age=%lu, max_eventhandlers_age=%lu, max_externalcommands_age=%lu, trim_db_interval=%lu, ndo2db_user=%s, ndo2db_group=%s, debug_file=%s, debug_level=%d, debug_verbosity=%d, max_debug_file_size=%lu\n", lock_file, ndo2db_socket_type, ndo2db_socket_name, ndo2db_tcp_port, ndo2db_db_settings.server_type, ndo2db_db_settings.host, ndo2db_db_settings.port, ndo2db_db_settings.username, ndo2db_db_settings.password, ndo2db_db_settings.dbname, ndo2db_db_settings.dbprefix, ndo2db_db_settings.max_timedevents_age, ndo2db_db_settings.max_systemcommands_age, ndo2db_db_settings.max_servicechecks_age, ndo2db_db_settings.max_hostchecks_age, ndo2db_db_settings.ma
 x_eventhandlers_age, ndo2db_db_settings.max_externalcommands_age, ndo2db_db_settings.trim_db_interval, ndo2db_user, ndo2db_group, ndo2db_debug_level, ndo2db_debug_verbosity, ndo2db_max_debug_file_size);
+
 	ndo2db_log_debug_info(NDO2DB_DEBUGL_PROCESSINFO, 2, "ndo2db_process_config_var() end\n");
 
 	return NDO_OK;





More information about the icinga-checkins mailing list