Skip to content
This repository has been archived by the owner on Jan 15, 2019. It is now read-only.

[dev.icinga.com #3408] Unsafe handling of dbi_conn_sequence_last #1153

Closed
icinga-migration opened this issue Oct 29, 2012 · 20 comments
Closed

Comments

@icinga-migration
Copy link

This issue has been migrated from Redmine: https://dev.icinga.com/issues/3408

Created by abraxas on 2012-10-29 02:22:11 +00:00

Assignee: mfriedrich
Status: Resolved (closed on 2012-11-20 15:01:48 +00:00)
Target Version: 1.8.2
Last Update: 2014-12-08 14:35:04 +00:00 (in Redmine)

Icinga Version: 1.8.0
OS Version: RHEL 6.3

In various functions dbi_conn_sequence_last is called to retrieve SQL ids generated by the Database backend. This is safe if called after an INSERT statement. However in the following functions dbi_conn_sequence_last is called after an insert_or_update function call.

ido2db_handle_notification_data
ido2db_handle_configfilevariables
ido2db_handle_hostdefinition
ido2db_handle_hostgroupdefiniton
ido2db_handle_servicedefinition
ido2db_handle_servicegroupdefinition
ido2db_handle_hostescalationdefinition
ido2db_handle_serviceescalationdefinition
ido2db_handle_timeperiodefinition
ido2db_handle_contactdefinition
ido2db_handle_contactgroupdefinition

The object id returned will be 0 for mysql UPDATE and the highest sequence of the connection and table for postgresql UPDATE. In both cases the reported id will be wrong and not safe for further use potentially resulting in an inconsistend database.

Due to the nature of definitions and configfilevariables (both usually cleared during icinga startup) this error is of a potential nature, however I observed this issue in notification_data.

A fix would be to set a flag in _insert_or_update functions whether UPDATE or INSERT has been called, that could be checked before calling dbi_conn_sequence_last. In case of INSERT the call is safe, in case of UPDATE the row-id of the entry needs to be retrieved by a separate SELECT statement.

Changesets

2012-10-31 23:33:14 +00:00 by mfriedrich 90c7677

idoutils: move the insert id / sequence stuff into ido2db_query_insert_or_update_notificationdata_add (refs #3408)

that qualifies the call on dbi_conn_sequence_last (or ocilib ones) just
for valid inserts. for the update, we can copy the safety select from
mysql, and put it in place when mysql/pgsql with libdbi actually did an
update - updating the referenced object id we should return in that
case. 0 is completely invalid, and must be avoided at all cost.

2012-10-31 23:57:28 +00:00 by mfriedrich 9b4b848

idoutils: move the insert id / sequence stuff into ido2db_query_insert_or_update_contactnotificationdata_add (refs #3408)

2012-11-01 00:32:48 +00:00 by mfriedrich e323e4e

idoutils: move the insert id / sequence stuff into ido2db_query_insert_or_update_configfilevariables_add (refs #3408)

2012-11-01 10:32:44 +00:00 by mfriedrich 9097281

idoutils: correct (non) sequence debug output refs #3408

2012-11-01 10:56:01 +00:00 by mfriedrich 2376fc2

idoutils: move the insert id / sequence stuff into ido2db_query_insert_or_update_hostdefinition_definition_add (refs #3408)

2012-11-01 11:12:05 +00:00 by mfriedrich 6dc1239

idoutils: move the insert id / sequence stuff into ido2db_query_insert_or_update_hostgroupdefinition_definition_add (refs #3408)

2012-11-01 11:27:43 +00:00 by mfriedrich 90ef902

idoutils: move the insert id / sequence stuff intoido2db_query_insert_or_update_servicedefinition_definition_add (refs #3408)

2012-11-01 11:55:38 +00:00 by mfriedrich 3dae1a8

idoutils: move the insert id / sequence stuff into ido2db_query_insert_or_update_servicegroupdefinition_definition_add (refs #3408)

2012-11-01 12:10:34 +00:00 by mfriedrich d8b7009

idoutils: move the insert id / sequence stuff into ido2db_query_insert_or_update_hostescalationdefinition_definition_add (refs #3408)

2012-11-01 12:18:58 +00:00 by mfriedrich 06a8ae3

idoutils: move the insert id / sequence stuff into ido2db_query_insert_or_update_serviceescalationdefinition_definition_add (refs #3408)

2012-11-01 12:33:46 +00:00 by mfriedrich 186347f

idoutils: move the insert id / sequence stuff into ido2db_query_insert_or_update_timeperiodefinition_definition_add (refs #3408)

2012-11-01 12:45:02 +00:00 by mfriedrich 3673c1c

idoutils: move the insert id / sequence stuff into ido2db_query_insert_or_update_contactdefinition_definition_add (refs #3408)

2012-11-01 12:55:13 +00:00 by mfriedrich c6031ae

idoutils: move the insert id / sequence stuff into ido2db_query_insert_or_update_contactgroupdefinition_definition_add (refs #3408)

2012-11-01 13:07:33 +00:00 by mfriedrich 5344f68

idoutils: dbi_result_free on unsuccesful queries as well (refs #3408 #3406)

2012-11-01 13:33:01 +00:00 by mfriedrich f3df924

idoutils: move dbi_result_free into insert_or_update functions (refs #3408 #3406)

2012-11-01 13:43:13 +00:00 by mfriedrich 7a23cdc

idoutils: cleanup unused vars from rewrite (refs #3408)

Relations:

@icinga-migration
Copy link
Author

Updated by abraxas on 2012-10-29 02:37:21 +00:00

This might be a duplicate of bug #3326

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2012-10-29 18:06:12 +00:00

  • Status changed from New to Assigned
  • Assigned to set to mfriedrich
  • Target Version set to 1.8.2

hmmmm that would explain a lot, though i am not sure if #3326 is the same origin/cause. thanks for the thoughts though, i wasn't aware of the fact that libdbi behaves badly on such a change. (bad enough that i had to change all queries thanks for mysql itsself).

@icinga-migration
Copy link
Author

Updated by abraxas on 2012-10-30 07:07:50 +00:00

Sorry #3326 was a copy error. I meant #3022, however there was a rewrite of the mysql statements inbetween, so it's possibly a different issue.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2012-10-30 12:27:42 +00:00

oh. now #3022 makes more sense. thanks.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2012-10-30 12:27:48 +00:00

  • Priority changed from Low to High

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2012-10-30 21:22:26 +00:00

another proposal would be to let the insert_or_update query figure the "last insert id" to be determined by itsself, passing as reference parameters (int or unsignedlong). since the select is already there, but as safety select for the insert, and not after the update itsself for getting the last id.

though, all functions need to be analyzed which ids are to be fetched in dbhandlers for these query calls.

and, to note, if moved inside the insert_or_update functions, the final free call on the dbi_result must be put inside the functions, after the last query, removing it from dbhandlers, to avoid confusion.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2012-10-31 22:45:42 +00:00

ido2db_query_insert_or_update_notificationdata_add
idi->dbinfo.last_notification_id

ido2db_query_insert_or_update_contactnotificationdata_add
idi->dbinfo.last_contact_notification_id

ido2db_query_insert_or_update_configfilevariables_add
configfile_id

ido2db_query_insert_or_update_hostdefinition_definition_add
host_id

ido2db_query_insert_or_update_hostgroupdefinition_definition_add
group_id

ido2db_query_insert_or_update_servicedefinition_definition_add
service_id

ido2db_query_insert_or_update_servicegroupdefinition_definition_add
group_id

ido2db_query_insert_or_update_hostescalationdefinition_definition_add
escalation_id

ido2db_query_insert_or_update_serviceescalationdefinition_definition_add
escalation_id

ido2db_query_insert_or_update_timeperiodefinition_definition_add
timeperiod_id

ido2db_query_insert_or_update_contactdefinition_definition_add
contact_id

ido2db_query_insert_or_update_contactgroupdefinition_definition_add
group_id

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2012-10-31 23:32:00 +00:00

ok, the general approach is now

  • add type param to insert_or_update functions
  • add reference to object id, if not already within idi struct as param to insert_or_update functions

within the function, do all the last insert id / sequence stuff yourself.

  • when an update happens, copy over the "safety select" from mysql to both mysql and pgsql update condition, assigning a new value to the referenced object id
  • when an insert happens, dbi_conn_sequence_last / ocilib respective is called and put as value to referenced object id

all the insert id get foo is deleted from within dbhandlers.c function calls, also the dbi_free stuff is entirely moved into the insert_or_update functions.

example from a pgsql insert query on notifications, rewritten

Thu Nov  1 00:25:24 2012 .229036 [001.2] [pid=19432] [tid=139763215701760] ido2db_compare_object_hashdata() start
Thu Nov  1 00:25:24 2012 .229048 [001.2] [pid=19432] [tid=139763215701760] ido2db_compare_object_hashdata() start
Thu Nov  1 00:25:24 2012 .229060 [001.2] [pid=19432] [tid=139763215701760] ido2db_get_cached_object_id(372) end
Thu Nov  1 00:25:24 2012 .229073 [001.2] [pid=19432] [tid=139763215701760] ido2db_get_object_id(372) return cached object
Thu Nov  1 00:25:24 2012 .229085 [001.2] [pid=19432] [tid=139763215701760] ido2db_query_insert_or_update_notificationdata_add() start
Thu Nov  1 00:25:24 2012 .229111 [001.2] [pid=19432] [tid=139763215701760] ido2db_db_query() start
Thu Nov  1 00:25:24 2012 .229530 [002.0] [pid=19432] [tid=139763215701760] UPDATE icinga_notifications SET notification_type=1, notification_reason=99, end_time=FROM_UNIXTIME(0), end_time_usec=0, state=2, output=E'CRITICAL: foobaer', long_output=E'CRITICAL: foobaer', escalated=0, contacts_notified=0  WHERE instance_id=1 AND start_time=FROM_UNIXTIME(1351725924) AND start_time_usec=1351725924 AND object_id=372
Thu Nov  1 00:25:24 2012 .231771 [001.2] [pid=19432] [tid=139763215701760] ido2db_db_query(0) end
Thu Nov  1 00:25:24 2012 .231807 [001.2] [pid=19432] [tid=139763215701760] ido2db_db_query() start
Thu Nov  1 00:25:24 2012 .232078 [002.0] [pid=19432] [tid=139763215701760] INSERT INTO icinga_notifications (instance_id, notification_type, notification_reason, start_time, start_time_usec, end_time, end_time_usec, object_id, state, output, long_output, escalated, contacts_notified) VALUES (1, 1, 99, FROM_UNIXTIME(1351725924), 1351725924, FROM_UNIXTIME(0), 0, 372, 2, E'CRITICAL: foobaer', E'CRITICAL: foobaer', 0, 0)
Thu Nov  1 00:25:24 2012 .272746 [001.2] [pid=19432] [tid=139763215701760] ido2db_db_query(0) end
Thu Nov  1 00:25:24 2012 .273261 [001.2] [pid=19432] [tid=139763215701760] ido2db_handle_notificationdata(icinga_notifications_notification_id_seq=10470) last_notification_id
Thu Nov  1 00:25:24 2012 .273290 [001.2] [pid=19432] [tid=139763215701760] ido2db_query_insert_or_update_notificationdata_add() end
Thu Nov  1 00:25:24 2012 .273305 [001.2] [pid=19432] [tid=139763215701760] ido2db_handle_notificationdata() end

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2012-11-01 00:32:14 +00:00

for debug reasons, always hitting the update statements when testing, set clean_config_tables_on_core_startup=0 in ido2db.cfg

tested with ido2db_query_insert_or_update_configfilevariables_add still pgsql

Thu Nov  1 01:31:29 2012 .495656 [001.2] [pid=2155] [tid=139902863058688] ido2db_handle_configfilevariables() start
Thu Nov  1 01:31:29 2012 .495663 [002.0] [pid=2155] [tid=139902863058688] HANDLE_CONFIGFILEVARS [1]
Thu Nov  1 01:31:29 2012 .495670 [001.2] [pid=2155] [tid=139902863058688] ido2db_convert_standard_data_elements() start
Thu Nov  1 01:31:29 2012 .495678 [002.0] [pid=2155] [tid=139902863058688] HANDLE_CONFIGFILEVARS [2]
Thu Nov  1 01:31:29 2012 .495685 [002.0] [pid=2155] [tid=139902863058688] TSTAMP: 1351729889   LATEST: 1351729885
Thu Nov  1 01:31:29 2012 .495692 [002.0] [pid=2155] [tid=139902863058688] HANDLE_CONFIGFILEVARS [3]
Thu Nov  1 01:31:29 2012 .495699 [001.2] [pid=2155] [tid=139902863058688] ido2db_db_escape_string('/etc/icinga/icinga.cfg') start
Thu Nov  1 01:31:29 2012 .495706 [001.2] [pid=2155] [tid=139902863058688] ido2db_db_escape_string end
Thu Nov  1 01:31:29 2012 .495720 [001.2] [pid=2155] [tid=139902863058688] ido2db_query_insert_or_update_configfilevariables_add() start
Thu Nov  1 01:31:29 2012 .495735 [001.2] [pid=2155] [tid=139902863058688] ido2db_db_query() start
Thu Nov  1 01:31:29 2012 .496125 [002.0] [pid=2155] [tid=139902863058688] UPDATE icinga_configfiles SET instance_id=1, configfile_type=0, configfile_path=E'/etc/icinga/icinga.cfg' WHERE instance_id=1 AND configfile_type=0 AND configfile_path=E'/etc/icinga/icinga.cfg'
Thu Nov  1 01:31:29 2012 .498071 [001.2] [pid=2155] [tid=139902863058688] ido2db_db_query(0) end
Thu Nov  1 01:31:29 2012 .498099 [001.2] [pid=2155] [tid=139902863058688] ido2db_query_insert_or_update_configfilevariables_add(1) update rows affected
Thu Nov  1 01:31:29 2012 .498119 [001.2] [pid=2155] [tid=139902863058688] ido2db_db_query() start
Thu Nov  1 01:31:29 2012 .498486 [002.0] [pid=2155] [tid=139902863058688] SELECT configfile_id FROM icinga_configfiles WHERE instance_id=1 AND configfile_type=0 AND configfile_path='/etc/icinga/icinga.cfg'
Thu Nov  1 01:31:29 2012 .499086 [001.2] [pid=2155] [tid=139902863058688] ido2db_db_query(0) end
Thu Nov  1 01:31:29 2012 .499117 [001.2] [pid=2155] [tid=139902863058688] ido2db_handle_configfilevariables((null)=7) configfilevariables_id
Thu Nov  1 01:31:29 2012 .499134 [001.2] [pid=2155] [tid=139902863058688] ido2db_query_insert_or_update_configfilevariables_add() end
Thu Nov  1 01:31:29 2012 .499148 [001.2] [pid=2155] [tid=139902863058688] ido2db_handle_configfilevariables_elements()  start
Thu Nov  1 01:31:29 2012 .499163 [001.2] [pid=2155] [tid=139902863058688] ido2db_db_escape_string('accept_passive_host_checks') start
Thu Nov  1 01:31:29 2012 .499174 [001.2] [pid=2155] [tid=139902863058688] ido2db_db_escape_string end
Thu Nov  1 01:31:29 2012 .499183 [001.2] [pid=2155] [tid=139902863058688] ido2db_db_escape_string('1') start

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2012-11-01 00:35:51 +00:00

still missing for the next days (too tired now). example is implemented above.

ido2db_query_insert_or_update_hostdefinition_definition_add
host_id

ido2db_query_insert_or_update_hostgroupdefinition_definition_add
group_id

ido2db_query_insert_or_update_servicedefinition_definition_add
service_id

ido2db_query_insert_or_update_servicegroupdefinition_definition_add
group_id

ido2db_query_insert_or_update_hostescalationdefinition_definition_add
escalation_id

ido2db_query_insert_or_update_serviceescalationdefinition_definition_add
escalation_id

ido2db_query_insert_or_update_timeperiodefinition_definition_add
timeperiod_id

ido2db_query_insert_or_update_contactdefinition_definition_add
contact_id

ido2db_query_insert_or_update_contactgroupdefinition_definition_add
group_id

todos:

  • test with mysql, pgsql, oracle
  • test with existing data, and empty db

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2012-11-01 00:35:59 +00:00

  • Done % changed from 0 to 20

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2012-11-01 11:55:06 +00:00

Thu Nov  1 11:53:41 2012 .459982 [001.2] [pid=18034] [tid=139710335907584] ido2db_query_insert_or_update_hostdefinition_definition_add() start
Thu Nov  1 11:53:41 2012 .460033 [001.2] [pid=18034] [tid=139710335907584] ido2db_db_query() start
Thu Nov  1 11:53:41 2012 .460298 [002.0] [pid=18034] [tid=139710335907584] UPDATE icinga_hosts SET alias=E'1066localhost', display_name=E'1066display_localhost', address=E'127.0.0.1', check_command_object_id=103, check_command_args=E'', eventhandler_c
ommand_object_id=0, eventhandler_command_args=E'', check_timeperiod_object_id=2, notification_timeperiod_object_id=113, failure_prediction_options=E'', check_interval=5.000000, retry_interval=1.000000, max_check_attempts=10, first_notification_delay=0
.000000, notification_interval=120.000000, notify_on_down=1, notify_on_unreachable=1, notify_on_recovery=1, notify_on_flapping=0, notify_on_downtime=0, stalk_on_up=0, stalk_on_down=0, stalk_on_unreachable=0, flap_detection_enabled=1, flap_detection_on
_up=1, flap_detection_on_down=1, flap_detection_on_unreachable=1, low_flap_threshold=0.000000, high_flap_threshold=0.000000, process_performance_data=1, freshness_checks_enabled=0, freshness_threshold=0, passive_checks_enabled=1, event_handler_enabled
=1, active_checks_enabled=1, retain_status_information=1, retain_nonstatus_information=1, notifications_enabled=1, obsess_over_host=1, failure_prediction_enabled=1, notes=E'', notes_url=E'', action_url=E'', icon_image=E's.gif\' width=\'0\' height=\'0\
' border=\'0\'>

Thu Nov  1 12:09:54 2012 .409519 [001.2] [pid=27458] [tid=139832974264064] ido2db_query_insert_or_update_hostgroupdefinition_definition_add() start
Thu Nov  1 12:09:54 2012 .409536 [001.2] [pid=27458] [tid=139832974264064] ido2db_db_query() start
Thu Nov  1 12:09:54 2012 .409803 [002.0] [pid=27458] [tid=139832974264064] UPDATE icinga_hostgroups SET config_type=1, alias=E'2913 Linux Servers' WHERE instance_id=1 AND hostgroup_object_id=349
Thu Nov  1 12:09:54 2012 .411167 [001.2] [pid=27458] [tid=139832974264064] ido2db_db_query(0) end
Thu Nov  1 12:09:54 2012 .411197 [001.2] [pid=27458] [tid=139832974264064] ido2db_db_query() start
Thu Nov  1 12:09:54 2012 .411457 [002.0] [pid=27458] [tid=139832974264064] SELECT hostgroup_id FROM icinga_hostgroups WHERE instance_id=1 AND hostgroup_object_id=349
Thu Nov  1 12:09:54 2012 .411912 [001.2] [pid=27458] [tid=139832974264064] ido2db_db_query(0) end
Thu Nov  1 12:09:54 2012 .411941 [001.2] [pid=27458] [tid=139832974264064] ido2db_handle_hostgroupdefinition(139) hostgroup_id
Thu Nov  1 12:09:54 2012 .411957 [001.2] [pid=27458] [tid=139832974264064] ido2db_query_insert_or_update_hostgroupdefinition_definition_add() end

Thu Nov  1 12:23:42 2012 .020630 [001.2] [pid=1763] [tid=139962934830848] ido2db_get_object_id(107) end
Thu Nov  1 12:23:42 2012 .020654 [001.2] [pid=1763] [tid=139962934830848] ido2db_query_insert_or_update_servicedefinition_definition_add() start
Thu Nov  1 12:23:42 2012 .020696 [001.2] [pid=1763] [tid=139962934830848] ido2db_db_query() start
Thu Nov  1 12:23:42 2012 .020966 [002.0] [pid=1763] [tid=139962934830848] UPDATE icinga_services SET host_object_id=131, display_name=E'cert[exp]: thomas-1.office.crt', check_command_object_id=91, check_command_args=E'/vservers/thomas-1/etc/httpd/ssl.crt/thomas-1.office.crt!60', eventhandler_command_object_id=0, eventhandler_command_args=E'', check_timeperiod_object_id=2, notification_timeperiod_object_id=107, failure_prediction_options=E'', check_interval=7.000000, retry_interval=3.000000, max_check_attempts=3, first_notification_delay=0.000000, notification_interval=10.000000, notify_on_warning=1, notify_on_unknown=1, notify_on_critical=1, notify_on_recovery=1, notify_on_flapping=1, notify_on_downtime=1, stalk_on_ok=0, stalk_on_warning=0, stalk_on_unknown=0, stalk_on_critical=0, is_volatile=0, flap_detection_enabled=1, flap_detection_on_ok=1, flap_detection_on_warning=1, flap_detection_on_unknown=1, flap_detection_on_critical=1, low_flap_threshold=0.000000, high_flap_threshold=0.000000, process_performance_data=1, freshness_checks_enabled=1, freshness_threshold=0, passive_checks_enabled=1, event_handler_enabled=0, active_checks_enabled=0, retain_status_information=1, retain_nonstatus_information=1, notifications_enabled=1, obsess_over_service=0, failure_prediction_enabled=1, notes=E'', notes_url=E'', action_url=E'', icon_image=E'', icon_image_alt=E'' WHERE instance_id=1 AND config_type=1 AND service_object_id=6
Thu Nov  1 12:23:42 2012 .023507 [001.2] [pid=1763] [tid=139962934830848] ido2db_db_query(0) end
Thu Nov  1 12:23:42 2012 .023538 [001.2] [pid=1763] [tid=139962934830848] ido2db_db_query() start
Thu Nov  1 12:23:42 2012 .023806 [002.0] [pid=1763] [tid=139962934830848] SELECT service_id FROM icinga_services WHERE instance_id=1 AND config_type=1 AND service_object_id=6
Thu Nov  1 12:23:42 2012 .024403 [001.2] [pid=1763] [tid=139962934830848] ido2db_db_query(0) end
Thu Nov  1 12:23:42 2012 .024432 [001.2] [pid=1763] [tid=139962934830848] ido2db_handle_servicedefinition(24169) service_id
Thu Nov  1 12:23:42 2012 .024449 [001.2] [pid=1763] [tid=139962934830848] ido2db_query_insert_or_update_servicedefinition_definition_add() end

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2012-11-01 12:34:23 +00:00

Thu Nov  1 12:53:01 2012 .502763 [002.0] [pid=15216] [tid=139820981319424] SELECT object_id FROM icinga_objects WHERE instance_id=1 AND objecttype_id=4 AND name1=E'2913servicegroup' AND name2 IS NULL
Thu Nov  1 12:53:01 2012 .503448 [001.2] [pid=15216] [tid=139820981319424] ido2db_db_query(0) end
Thu Nov  1 12:53:01 2012 .503480 [001.2] [pid=15216] [tid=139820981319424] ido2db_get_object_id(4376) end
Thu Nov  1 12:53:01 2012 .503496 [001.2] [pid=15216] [tid=139820981319424] ido2db_set_object_as_active() start
Thu Nov  1 12:53:01 2012 .503513 [001.2] [pid=15216] [tid=139820981319424] ido2db_db_query() start
Thu Nov  1 12:53:01 2012 .503797 [002.0] [pid=15216] [tid=139820981319424] UPDATE icinga_objects SET is_active='1' WHERE instance_id=1 AND objecttype_id=4 AND object_id=4376
Thu Nov  1 12:53:01 2012 .504767 [001.2] [pid=15216] [tid=139820981319424] ido2db_db_query(0) end
Thu Nov  1 12:53:01 2012 .504795 [001.2] [pid=15216] [tid=139820981319424] ido2db_set_object_as_active() end
Thu Nov  1 12:53:01 2012 .504823 [001.2] [pid=15216] [tid=139820981319424] ido2db_query_insert_or_update_servicegroupdefinition_definition_add() start
Thu Nov  1 12:53:01 2012 .504845 [001.2] [pid=15216] [tid=139820981319424] ido2db_db_query() start
Thu Nov  1 12:53:01 2012 .505116 [002.0] [pid=15216] [tid=139820981319424] UPDATE icinga_servicegroups SET alias=E'2913 Service Group' WHERE instance_id=1 AND config_type=1 AND servicegroup_object_id=4376
Thu Nov  1 12:53:01 2012 .506611 [001.2] [pid=15216] [tid=139820981319424] ido2db_db_query(0) end
Thu Nov  1 12:53:01 2012 .506645 [001.2] [pid=15216] [tid=139820981319424] ido2db_db_query() start
Thu Nov  1 12:53:01 2012 .506923 [002.0] [pid=15216] [tid=139820981319424] SELECT servicegroup_id FROM icinga_servicegroups WHERE instance_id=1 AND config_type=1 AND servicegroup_object_id=4376
Thu Nov  1 12:53:01 2012 .507439 [001.2] [pid=15216] [tid=139820981319424] ido2db_db_query(0) end
Thu Nov  1 12:53:01 2012 .507469 [001.2] [pid=15216] [tid=139820981319424] ido2db_handle_servicegroupdefinition(97) group_id
Thu Nov  1 12:53:01 2012 .507486 [001.2] [pid=15216] [tid=139820981319424] ido2db_query_insert_or_update_servicegroupdefinition_definition_add() end
Thu Nov  1 12:53:01 2012 .507500 [001.2] [pid=15216] [tid=139820981319424] ido2db_handle_servicegroupdefinition() members  start
Thu Nov  1 12:53:01 2012 .507515 [001.2] [pid=15216] [tid=139820981319424] ido2db_handle_servicegroupdefinition() end

Thu Nov  1 13:30:39 2012 .841396 [001.2] [pid=6799] [tid=140535075989248] ido2db_handle_timeperiodefinition() start
Thu Nov  1 13:30:39 2012 .841419 [001.2] [pid=6799] [tid=140535075989248] ido2db_convert_standard_data_elements() start
Thu Nov  1 13:30:39 2012 .841433 [001.2] [pid=6799] [tid=140535075989248] ido2db_db_escape_string('24 Hours A Day, 7 Days A Week') start
Thu Nov  1 13:30:39 2012 .841446 [001.2] [pid=6799] [tid=140535075989248] ido2db_db_escape_string end
Thu Nov  1 13:30:39 2012 .841459 [001.2] [pid=6799] [tid=140535075989248] ido2db_get_object_id_with_insert() start
Thu Nov  1 13:30:39 2012 .841471 [001.2] [pid=6799] [tid=140535075989248] ido2db_get_object_id() start
Thu Nov  1 13:30:39 2012 .841483 [001.2] [pid=6799] [tid=140535075989248] ido2db_get_cached_object_id() start
Thu Nov  1 13:30:39 2012 .841495 [001.2] [pid=6799] [tid=140535075989248] ido2db_object_hashfunc() start
Thu Nov  1 13:30:39 2012 .841507 [001.2] [pid=6799] [tid=140535075989248] ido2db_object_hashfunc() end
Thu Nov  1 13:30:39 2012 .841519 [001.2] [pid=6799] [tid=140535075989248] ido2db_get_cached_object_id(0) end
Thu Nov  1 13:30:39 2012 .841532 [001.2] [pid=6799] [tid=140535075989248] ido2db_db_escape_string('1066notification_period') start
Thu Nov  1 13:30:39 2012 .841544 [001.2] [pid=6799] [tid=140535075989248] ido2db_db_escape_string end
Thu Nov  1 13:30:39 2012 .841561 [001.2] [pid=6799] [tid=140535075989248] ido2db_db_query() start
Thu Nov  1 13:30:39 2012 .841836 [002.0] [pid=6799] [tid=140535075989248] SELECT object_id FROM icinga_objects WHERE instance_id=1 AND objecttype_id=9 AND name1=E'1066notification_period' AND name2 IS NULL
Thu Nov  1 13:30:39 2012 .843042 [001.2] [pid=6799] [tid=140535075989248] ido2db_db_query(0) end
Thu Nov  1 13:30:39 2012 .843074 [001.2] [pid=6799] [tid=140535075989248] ido2db_get_object_id(107) end
Thu Nov  1 13:30:39 2012 .843089 [001.2] [pid=6799] [tid=140535075989248] ido2db_set_object_as_active() start
Thu Nov  1 13:30:39 2012 .843104 [001.2] [pid=6799] [tid=140535075989248] ido2db_db_query() start
Thu Nov  1 13:30:39 2012 .843367 [002.0] [pid=6799] [tid=140535075989248] UPDATE icinga_objects SET is_active='1' WHERE instance_id=1 AND objecttype_id=9 AND object_id=107
Thu Nov  1 13:30:39 2012 .844813 [001.2] [pid=6799] [tid=140535075989248] ido2db_db_query(0) end
Thu Nov  1 13:30:39 2012 .844841 [001.2] [pid=6799] [tid=140535075989248] ido2db_set_object_as_active() end
Thu Nov  1 13:30:39 2012 .844866 [001.2] [pid=6799] [tid=140535075989248] ido2db_query_insert_or_update_timeperiodefinition_definition_add() start
Thu Nov  1 13:30:39 2012 .844889 [001.2] [pid=6799] [tid=140535075989248] ido2db_db_query() start
Thu Nov  1 13:30:39 2012 .845152 [002.0] [pid=6799] [tid=140535075989248] UPDATE icinga_timeperiods SET alias=E'24 Hours A Day, 7 Days A Week' WHERE instance_id=1 AND config_type=1 AND timeperiod_object_id=107
Thu Nov  1 13:30:39 2012 .846932 [001.2] [pid=6799] [tid=140535075989248] ido2db_db_query(0) end
Thu Nov  1 13:30:39 2012 .846963 [001.2] [pid=6799] [tid=140535075989248] ido2db_db_query() start
Thu Nov  1 13:30:39 2012 .847228 [002.0] [pid=6799] [tid=140535075989248] SELECT timeperiod_id FROM icinga_timeperiods WHERE instance_id=1 AND config_type=1 AND timeperiod_object_id=107
Thu Nov  1 13:30:39 2012 .847881 [001.2] [pid=6799] [tid=140535075989248] ido2db_db_query(0) end
Thu Nov  1 13:30:39 2012 .847910 [001.2] [pid=6799] [tid=140535075989248] ido2db_handle_timeperiodefinition(49) timeperiod_id
Thu Nov  1 13:30:39 2012 .847926 [001.2] [pid=6799] [tid=140535075989248] ido2db_query_insert_or_update_timeperiodefinition_definition_add() end
Thu Nov  1 13:30:39 2012 .847940 [001.2] [pid=6799] [tid=140535075989248] ido2db_handle_timeperiodefinition() timeranges start
Thu Nov  1 13:30:39 2012 .847971 [001.2] [pid=6799] [tid=140535075989248] ido2db_db_query() start
Thu Nov  1 13:30:39 2012 .848235 [002.0] [pid=6799] [tid=140535075989248] INSERT INTO icinga_timeperiod_timeranges (instance_id, timeperiod_id, day, start_sec, end_sec) VALUES (1,49,0,0,86400),(1,49,1,0,86400),(1,49,2,0,86400),(1,49,3,0,86400),(1,49,4,0,86400),(1,49,5,0,86400),(1,49,6,0,86400)
Thu Nov  1 13:30:39 2012 .892329 [001.2] [pid=6799] [tid=140535075989248] ido2db_db_query(0) end
Thu Nov  1 13:30:39 2012 .892386 [001.2] [pid=6799] [tid=140535075989248] ido2db_handle_timeperiodefinition() end

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2012-11-01 13:06:28 +00:00

Thu Nov  1 13:44:28 2012 .779094 [001.2] [pid=20448] [tid=139715410147072] ido2db_query_insert_or_update_contactdefinition_definition_add() start
Thu Nov  1 13:44:28 2012 .779119 [001.2] [pid=20448] [tid=139715410147072] ido2db_db_query() start
Thu Nov  1 13:44:28 2012 .779380 [002.0] [pid=20448] [tid=139715410147072] UPDATE icinga_contacts SET alias=E'Icinga Test Admin', email_address=E'icinga@localhost', pager_address=E'', host_timeperiod_object_id=2, service_timeperiod_object_id=2, host_notifications_enabled=1, service_notifications_enabled=1, can_submit_commands=1, notify_service_recovery=1, notify_service_warning=1, notify_service_unknown=1, notify_service_critical=1, notify_service_flapping=1, notify_service_downtime=1, notify_host_recovery=1, notify_host_down=1, notify_host_unreachable=1, notify_host_flapping=1, notify_host_downtime=1 WHERE instance_id=1 AND config_type=1 AND contact_object_id=35
Thu Nov  1 13:44:28 2012 .781980 [001.2] [pid=20448] [tid=139715410147072] ido2db_db_query(0) end
Thu Nov  1 13:44:28 2012 .782011 [001.2] [pid=20448] [tid=139715410147072] ido2db_db_query() start
Thu Nov  1 13:44:28 2012 .782276 [002.0] [pid=20448] [tid=139715410147072] SELECT contact_id FROM icinga_contacts WHERE instance_id=1 AND config_type=1 AND contact_object_id=35
Thu Nov  1 13:44:28 2012 .782780 [001.2] [pid=20448] [tid=139715410147072] ido2db_db_query(0) end
Thu Nov  1 13:44:28 2012 .782808 [001.2] [pid=20448] [tid=139715410147072] ido2db_handle_contactdefinition(61) contact_id
Thu Nov  1 13:44:28 2012 .782824 [001.2] [pid=20448] [tid=139715410147072] ido2db_query_insert_or_update_contactdefinition_definition_add() end

Thu Nov  1 13:54:08 2012 .796647 [001.2] [pid=28823] [tid=140128541439744] ido2db_handle_contactgroupdefinition() start
Thu Nov  1 13:54:08 2012 .796659 [001.2] [pid=28823] [tid=140128541439744] ido2db_convert_standard_data_elements() start
Thu Nov  1 13:54:08 2012 .796672 [001.2] [pid=28823] [tid=140128541439744] ido2db_db_escape_string('Icinga Administrators') start
Thu Nov  1 13:54:08 2012 .796685 [001.2] [pid=28823] [tid=140128541439744] ido2db_db_escape_string end
Thu Nov  1 13:54:08 2012 .796698 [001.2] [pid=28823] [tid=140128541439744] ido2db_get_object_id_with_insert() start
Thu Nov  1 13:54:08 2012 .796710 [001.2] [pid=28823] [tid=140128541439744] ido2db_get_object_id() start
Thu Nov  1 13:54:08 2012 .796722 [001.2] [pid=28823] [tid=140128541439744] ido2db_get_cached_object_id() start
Thu Nov  1 13:54:08 2012 .796734 [001.2] [pid=28823] [tid=140128541439744] ido2db_object_hashfunc() start
Thu Nov  1 13:54:08 2012 .796746 [001.2] [pid=28823] [tid=140128541439744] ido2db_object_hashfunc() end
Thu Nov  1 13:54:08 2012 .796758 [001.2] [pid=28823] [tid=140128541439744] ido2db_get_cached_object_id(0) end
Thu Nov  1 13:54:08 2012 .796770 [001.2] [pid=28823] [tid=140128541439744] ido2db_db_escape_string('1stlevel') start
Thu Nov  1 13:54:08 2012 .796783 [001.2] [pid=28823] [tid=140128541439744] ido2db_db_escape_string end
Thu Nov  1 13:54:08 2012 .796800 [001.2] [pid=28823] [tid=140128541439744] ido2db_db_query() start
Thu Nov  1 13:54:08 2012 .797060 [002.0] [pid=28823] [tid=140128541439744] SELECT object_id FROM icinga_objects WHERE instance_id=1 AND objecttype_id=11 AND name1=E'1stlevel' AND name2 IS NULL
Thu Nov  1 13:54:08 2012 .798306 [001.2] [pid=28823] [tid=140128541439744] ido2db_db_query(0) end
Thu Nov  1 13:54:08 2012 .798353 [001.2] [pid=28823] [tid=140128541439744] ido2db_get_object_id(120) end
Thu Nov  1 13:54:08 2012 .798369 [001.2] [pid=28823] [tid=140128541439744] ido2db_set_object_as_active() start
Thu Nov  1 13:54:08 2012 .798384 [001.2] [pid=28823] [tid=140128541439744] ido2db_db_query() start
Thu Nov  1 13:54:08 2012 .798647 [002.0] [pid=28823] [tid=140128541439744] UPDATE icinga_objects SET is_active='1' WHERE instance_id=1 AND objecttype_id=11 AND object_id=120
Thu Nov  1 13:54:08 2012 .799809 [001.2] [pid=28823] [tid=140128541439744] ido2db_db_query(0) end
Thu Nov  1 13:54:08 2012 .799835 [001.2] [pid=28823] [tid=140128541439744] ido2db_set_object_as_active() end
Thu Nov  1 13:54:08 2012 .799850 [001.2] [pid=28823] [tid=140128541439744] ido2db_query_insert_or_update_contactgroupdefinition_definition_add() start
Thu Nov  1 13:54:08 2012 .799866 [001.2] [pid=28823] [tid=140128541439744] ido2db_db_query() start
Thu Nov  1 13:54:08 2012 .800122 [002.0] [pid=28823] [tid=140128541439744] UPDATE icinga_contactgroups SET alias=E'Icinga Administrators' WHERE instance_id=1 AND config_type=1 AND contactgroup_object_id=120
Thu Nov  1 13:54:08 2012 .801538 [001.2] [pid=28823] [tid=140128541439744] ido2db_db_query(0) end
Thu Nov  1 13:54:08 2012 .801569 [001.2] [pid=28823] [tid=140128541439744] ido2db_db_query() start
Thu Nov  1 13:54:08 2012 .801827 [002.0] [pid=28823] [tid=140128541439744] SELECT contactgroup_id FROM icinga_contactgroups WHERE instance_id=1 AND config_type=1 AND contactgroup_object_id=120
Thu Nov  1 13:54:08 2012 .802285 [001.2] [pid=28823] [tid=140128541439744] ido2db_db_query(0) end
Thu Nov  1 13:54:08 2012 .802314 [001.2] [pid=28823] [tid=140128541439744] ido2db_handle_contactgroupdefinition(67) group_id
Thu Nov  1 13:54:08 2012 .802349 [001.2] [pid=28823] [tid=140128541439744] ido2db_query_insert_or_update_contactgroupdefinition_definition_add() end
Thu Nov  1 13:54:08 2012 .802363 [001.2] [pid=28823] [tid=140128541439744] ido2db_handle_contactgroupdefinition() members start
Thu Nov  1 13:54:08 2012 .802377 [001.2] [pid=28823] [tid=140128541439744] ido2db_get_object_id_with_insert() start
Thu Nov  1 13:54:08 2012 .802390 [001.2] [pid=28823] [tid=140128541439744] ido2db_get_object_id() start
Thu Nov  1 13:54:08 2012 .802402 [001.2] [pid=28823] [tid=140128541439744] ido2db_get_cached_object_id() start
Thu Nov  1 13:54:08 2012 .802415 [001.2] [pid=28823] [tid=140128541439744] ido2db_object_hashfunc() start
Thu Nov  1 13:54:08 2012 .802427 [001.2] [pid=28823] [tid=140128541439744] ido2db_object_hashfunc() end
Thu Nov  1 13:54:08 2012 .802439 [001.2] [pid=28823] [tid=140128541439744] ido2db_get_cached_object_id(0) end
Thu Nov  1 13:54:08 2012 .802452 [001.2] [pid=28823] [tid=140128541439744] ido2db_db_escape_string('testconfig-admin') start
Thu Nov  1 13:54:08 2012 .802465 [001.2] [pid=28823] [tid=140128541439744] ido2db_db_escape_string end
Thu Nov  1 13:54:08 2012 .802481 [001.2] [pid=28823] [tid=140128541439744] ido2db_db_query() start
Thu Nov  1 13:54:08 2012 .802743 [002.0] [pid=28823] [tid=140128541439744] SELECT object_id FROM icinga_objects WHERE instance_id=1 AND objecttype_id=10 AND name1=E'testconfig-admin' AND name2 IS NULL
Thu Nov  1 13:54:08 2012 .803215 [001.2] [pid=28823] [tid=140128541439744] ido2db_db_query(0) end
Thu Nov  1 13:54:08 2012 .803245 [001.2] [pid=28823] [tid=140128541439744] ido2db_get_object_id(44) end
Thu Nov  1 13:54:08 2012 .803263 [001.2] [pid=28823] [tid=140128541439744] ido2db_db_query() start
Thu Nov  1 13:54:08 2012 .803519 [002.0] [pid=28823] [tid=140128541439744] INSERT INTO icinga_contactgroup_members (instance_id, contactgroup_id, contact_object_id) VALUES (1,67,44)
Thu Nov  1 13:54:08 2012 .805147 [001.2] [pid=28823] [tid=140128541439744] ido2db_db_query(0) end
Thu Nov  1 13:54:08 2012 .805174 [001.2] [pid=28823] [tid=140128541439744] ido2db_handle_contactgroupdefinition() end

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2012-11-01 14:00:25 +00:00

  • Status changed from Assigned to 7
  • Done % changed from 20 to 90

so, executive summary

  • libdbi is just a wrapper, and does not care when dbi_conn_sequence_last is called after an update statement
  • it affects all libdbi supported rdbms, mysql and pgsql
  • oracle is only affected by the code cleanup and moving all sequence/lastinsertid stuff into the insert_or_update functions
  • additonal, i've moved all dbi_result_free calls directly where they belong, as well as added some safety free's on unsuccessful queries

from my tests on pgsql with existing config in it, this works.

  • pgsql, clean_config_tables_on_core_startup=0 (/)

see above

  • pgsql, clean_config_tables_on_core_startup=1 (/)
Thu Nov  1 14:58:53 2012 .048416 [002.0] [pid=12392] [tid=139963902203648] SELECT object_id FROM icinga_objects WHERE instance_id=1 AND objecttype_id=9 AND name1=E'workhours' AND name2 IS NULL
Thu Nov  1 14:58:53 2012 .048910 [001.2] [pid=12392] [tid=139963902203648] ido2db_db_query(0) end
Thu Nov  1 14:58:53 2012 .048938 [001.2] [pid=12392] [tid=139963902203648] ido2db_get_object_id(113) end
Thu Nov  1 14:58:53 2012 .048967 [001.2] [pid=12392] [tid=139963902203648] ido2db_query_insert_or_update_hostdefinition_definition_add() start
Thu Nov  1 14:58:53 2012 .049021 [001.2] [pid=12392] [tid=139963902203648] ido2db_db_query() start
Thu Nov  1 14:58:53 2012 .049274 [002.0] [pid=12392] [tid=139963902203648] UPDATE icinga_hosts SET alias=E'1066localhost', display_name=E'1066display_localhost', address=E'127.0.0.1', check_command_object_id=103, check_command_args=E'', eventhandler_command
_object_id=0, eventhandler_command_args=E'', check_timeperiod_object_id=2, notification_timeperiod_object_id=113, failure_prediction_options=E'', check_interval=5.000000, retry_interval=1.000000, max_check_attempts=10, first_notification_delay=0.000000, not
ification_interval=120.000000, notify_on_down=1, notify_on_unreachable=1, notify_on_recovery=1, notify_on_flapping=0, notify_on_downtime=0, stalk_on_up=0, stalk_on_down=0, stalk_on_unreachable=0, flap_detection_enabled=1, flap_detection_on_up=1, flap_detect
ion_on_down=1, flap_detection_on_unreachable=1, low_flap_threshold=0.000000, high_flap_threshold=0.000000, process_performance_data=1, freshness_checks_enabled=0, freshness_threshold=0, passive_checks_enabled=1, event_handler_enabled=1, active_checks_enable
d=1, retain_status_information=1, retain_nonstatus_information=1, notifications_enabled=1, obsess_over_host=1, failure_prediction_enabled=1, notes=E'', notes_url=E'', action_url=E'', icon_image=E's.gif\' width=\'0\' height=\'0\' border=\'0\'>

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2012-11-01 14:22:29 +00:00

  • mysql, clean_config_tables_on_core_startup=1 (/)
Thu Nov  1 15:02:29 2012 .679057 [001.2] [pid=14804] [tid=140451024152320] ido2db_query_insert_or_update_hostdefinition_definition_add() start
Thu Nov  1 15:02:29 2012 .679113 [001.2] [pid=14804] [tid=140451024152320] ido2db_db_query() start
Thu Nov  1 15:02:29 2012 .679198 [002.0] [pid=14804] [tid=140451024152320] UPDATE icinga_hosts SET alias='1066localhost', display_name='1066display_localhost', address='127\.0\.0\.1', check_command_object_id=88, check_command_args='', eventhandler_command_o
bject_id=0, eventhandler_command_args='', check_timeperiod_object_id=2, notification_timeperiod_object_id=98, failure_prediction_options='', check_interval=5.000000, retry_interval=1.000000, max_check_attempts=10, first_notification_delay=0.000000, notifica
tion_interval=120.000000, notify_on_down=1, notify_on_unreachable=1, notify_on_recovery=1, notify_on_flapping=0, notify_on_downtime=0, stalk_on_up=0, stalk_on_down=0, stalk_on_unreachable=0, flap_detection_enabled=1, flap_detection_on_up=1, flap_detection_o
n_down=1, flap_detection_on_unreachable=1, low_flap_threshold=0.000000, high_flap_threshold=0.000000, process_performance_data=1, freshness_checks_enabled=0, freshness_threshold=0, passive_checks_enabled=1, event_handler_enabled=1, active_checks_enabled=1, 
retain_status_information=1, retain_nonstatus_information=1, notifications_enabled=1, obsess_over_host=1, failure_prediction_enabled=1, notes='', notes_url='', action_url='', icon_image='s\.gif\' width=\'0\' height=\'0\' border=\'0\'>

Thu Nov  1 15:02:29 2012 .576181 [001.2] [pid=14804] [tid=140451024152320] ido2db_handle_contactgroupdefinition() start
Thu Nov  1 15:02:29 2012 .576193 [001.2] [pid=14804] [tid=140451024152320] ido2db_convert_standard_data_elements() start
Thu Nov  1 15:02:29 2012 .576208 [001.2] [pid=14804] [tid=140451024152320] ido2db_db_escape_string('Icinga Administrators') start
Thu Nov  1 15:02:29 2012 .576221 [001.2] [pid=14804] [tid=140451024152320] ido2db_db_escape_string end
Thu Nov  1 15:02:29 2012 .576234 [001.2] [pid=14804] [tid=140451024152320] ido2db_get_object_id_with_insert() start
Thu Nov  1 15:02:29 2012 .576247 [001.2] [pid=14804] [tid=140451024152320] ido2db_get_object_id() start
Thu Nov  1 15:02:29 2012 .576259 [001.2] [pid=14804] [tid=140451024152320] ido2db_get_cached_object_id() start
Thu Nov  1 15:02:29 2012 .576271 [001.2] [pid=14804] [tid=140451024152320] ido2db_object_hashfunc() start
Thu Nov  1 15:02:29 2012 .576283 [001.2] [pid=14804] [tid=140451024152320] ido2db_object_hashfunc() end
Thu Nov  1 15:02:29 2012 .576296 [001.2] [pid=14804] [tid=140451024152320] ido2db_get_cached_object_id(0) end
Thu Nov  1 15:02:29 2012 .576308 [001.2] [pid=14804] [tid=140451024152320] ido2db_db_escape_string('1stlevel') start
Thu Nov  1 15:02:29 2012 .576325 [001.2] [pid=14804] [tid=140451024152320] ido2db_db_escape_string end
Thu Nov  1 15:02:29 2012 .576343 [001.2] [pid=14804] [tid=140451024152320] ido2db_db_query() start
Thu Nov  1 15:02:29 2012 .576433 [002.0] [pid=14804] [tid=140451024152320] SELECT object_id FROM icinga_objects WHERE instance_id=1 AND objecttype_id=11 AND name1='1stlevel' AND name2 IS NULL
Thu Nov  1 15:02:29 2012 .576839 [001.2] [pid=14804] [tid=140451024152320] ido2db_db_query(0) end
Thu Nov  1 15:02:29 2012 .576868 [001.2] [pid=14804] [tid=140451024152320] ido2db_get_object_id(105) end
Thu Nov  1 15:02:29 2012 .576884 [001.2] [pid=14804] [tid=140451024152320] ido2db_set_object_as_active() start
Thu Nov  1 15:02:29 2012 .576899 [001.2] [pid=14804] [tid=140451024152320] ido2db_db_query() start
Thu Nov  1 15:02:29 2012 .576980 [002.0] [pid=14804] [tid=140451024152320] UPDATE icinga_objects SET is_active='1' WHERE instance_id=1 AND objecttype_id=11 AND object_id=105
Thu Nov  1 15:02:29 2012 .577623 [001.2] [pid=14804] [tid=140451024152320] ido2db_db_query(0) end
Thu Nov  1 15:02:29 2012 .577649 [001.2] [pid=14804] [tid=140451024152320] ido2db_set_object_as_active() end
Thu Nov  1 15:02:29 2012 .577663 [001.2] [pid=14804] [tid=140451024152320] ido2db_query_insert_or_update_contactgroupdefinition_definition_add() start
Thu Nov  1 15:02:29 2012 .577680 [001.2] [pid=14804] [tid=140451024152320] ido2db_db_query() start
Thu Nov  1 15:02:29 2012 .577775 [002.0] [pid=14804] [tid=140451024152320] UPDATE icinga_contactgroups SET alias='Icinga Administrators' WHERE instance_id=1 AND config_type=1 AND contactgroup_object_id=105
Thu Nov  1 15:02:29 2012 .578271 [001.2] [pid=14804] [tid=140451024152320] ido2db_db_query(0) end
Thu Nov  1 15:02:29 2012 .578299 [001.2] [pid=14804] [tid=140451024152320] ido2db_db_query() start
Thu Nov  1 15:02:29 2012 .578406 [002.0] [pid=14804] [tid=140451024152320] SELECT contactgroup_id FROM icinga_contactgroups WHERE instance_id=1 AND config_type=1 AND contactgroup_object_id=105
Thu Nov  1 15:02:29 2012 .578628 [001.2] [pid=14804] [tid=140451024152320] ido2db_db_query(0) end
Thu Nov  1 15:02:29 2012 .578656 [001.2] [pid=14804] [tid=140451024152320] ido2db_db_query() start
Thu Nov  1 15:02:29 2012 .578737 [002.0] [pid=14804] [tid=140451024152320] INSERT INTO icinga_contactgroups (instance_id, config_type, contactgroup_object_id, alias) VALUES (1, 1, 105, 'Icinga Administrators')
Thu Nov  1 15:02:29 2012 .579341 [001.2] [pid=14804] [tid=140451024152320] ido2db_db_query(0) end
Thu Nov  1 15:02:29 2012 .579365 [001.2] [pid=14804] [tid=140451024152320] ido2db_handle_contactgroupdefinition(122) group_id
Thu Nov  1 15:02:29 2012 .579380 [001.2] [pid=14804] [tid=140451024152320] ido2db_query_insert_or_update_contactgroupdefinition_definition_add() end
Thu Nov  1 15:02:29 2012 .579392 [001.2] [pid=14804] [tid=140451024152320] ido2db_handle_contactgroupdefinition() members start
Thu Nov  1 15:02:29 2012 .579405 [001.2] [pid=14804] [tid=140451024152320] ido2db_get_object_id_with_insert() start
Thu Nov  1 15:02:29 2012 .579417 [001.2] [pid=14804] [tid=140451024152320] ido2db_get_object_id() start
Thu Nov  1 15:02:29 2012 .579428 [001.2] [pid=14804] [tid=140451024152320] ido2db_get_cached_object_id() start
Thu Nov  1 15:02:29 2012 .579440 [001.2] [pid=14804] [tid=140451024152320] ido2db_object_hashfunc() start
Thu Nov  1 15:02:29 2012 .579452 [001.2] [pid=14804] [tid=140451024152320] ido2db_object_hashfunc() end
Thu Nov  1 15:02:29 2012 .579465 [001.2] [pid=14804] [tid=140451024152320] ido2db_get_cached_object_id(0) end
Thu Nov  1 15:02:29 2012 .579478 [001.2] [pid=14804] [tid=140451024152320] ido2db_db_escape_string('testconfig-admin') start
Thu Nov  1 15:02:29 2012 .579491 [001.2] [pid=14804] [tid=140451024152320] ido2db_db_escape_string end
Thu Nov  1 15:02:29 2012 .579509 [001.2] [pid=14804] [tid=140451024152320] ido2db_db_query() start
Thu Nov  1 15:02:29 2012 .579590 [002.0] [pid=14804] [tid=140451024152320] SELECT object_id FROM icinga_objects WHERE instance_id=1 AND objecttype_id=10 AND name1='testconfig-admin' AND name2 IS NULL
Thu Nov  1 15:02:29 2012 .579952 [001.2] [pid=14804] [tid=140451024152320] ido2db_db_query(0) end
Thu Nov  1 15:02:29 2012 .579980 [001.2] [pid=14804] [tid=140451024152320] ido2db_get_object_id(40) end
Thu Nov  1 15:02:29 2012 .579999 [001.2] [pid=14804] [tid=140451024152320] ido2db_db_query() start
Thu Nov  1 15:02:29 2012 .580080 [002.0] [pid=14804] [tid=140451024152320] INSERT INTO icinga_contactgroup_members (instance_id, contactgroup_id, contact_object_id) VALUES (1,122,40)
Thu Nov  1 15:02:29 2012 .580792 [001.2] [pid=14804] [tid=140451024152320] ido2db_db_query(0) end
Thu Nov  1 15:02:29 2012 .580815 [001.2] [pid=14804] [tid=140451024152320] ido2db_handle_contactgroupdefinition() end

Thu Nov  1 15:02:26 2012 .186799 [001.2] [pid=14804] [tid=140451024152320] ido2db_handle_timeperiodefinition() start
Thu Nov  1 15:02:26 2012 .186812 [001.2] [pid=14804] [tid=140451024152320] ido2db_convert_standard_data_elements() start
Thu Nov  1 15:02:26 2012 .186828 [001.2] [pid=14804] [tid=140451024152320] ido2db_db_escape_string('24 Hours A Day, 7 Days A Week') start
Thu Nov  1 15:02:26 2012 .186842 [001.2] [pid=14804] [tid=140451024152320] ido2db_db_escape_string end
Thu Nov  1 15:02:26 2012 .186854 [001.2] [pid=14804] [tid=140451024152320] ido2db_get_object_id_with_insert() start
Thu Nov  1 15:02:26 2012 .186866 [001.2] [pid=14804] [tid=140451024152320] ido2db_get_object_id() start
Thu Nov  1 15:02:26 2012 .186880 [001.2] [pid=14804] [tid=140451024152320] ido2db_get_cached_object_id() start
Thu Nov  1 15:02:26 2012 .186893 [001.2] [pid=14804] [tid=140451024152320] ido2db_object_hashfunc() start
Thu Nov  1 15:02:26 2012 .186906 [001.2] [pid=14804] [tid=140451024152320] ido2db_object_hashfunc() end
Thu Nov  1 15:02:26 2012 .186919 [001.2] [pid=14804] [tid=140451024152320] ido2db_get_cached_object_id(0) end
Thu Nov  1 15:02:26 2012 .186932 [001.2] [pid=14804] [tid=140451024152320] ido2db_db_escape_string('1066notification_period') start
Thu Nov  1 15:02:26 2012 .186946 [001.2] [pid=14804] [tid=140451024152320] ido2db_db_escape_string end
Thu Nov  1 15:02:26 2012 .186967 [001.2] [pid=14804] [tid=140451024152320] ido2db_db_query() start
Thu Nov  1 15:02:26 2012 .187070 [002.0] [pid=14804] [tid=140451024152320] SELECT object_id FROM icinga_objects WHERE instance_id=1 AND objecttype_id=9 AND name1='1066notification_period' AND name2 IS NULL
Thu Nov  1 15:02:26 2012 .187640 [001.2] [pid=14804] [tid=140451024152320] ido2db_db_query(0) end
Thu Nov  1 15:02:26 2012 .187678 [001.2] [pid=14804] [tid=140451024152320] ido2db_get_object_id(92) end
Thu Nov  1 15:02:26 2012 .187695 [001.2] [pid=14804] [tid=140451024152320] ido2db_set_object_as_active() start
Thu Nov  1 15:02:26 2012 .187711 [001.2] [pid=14804] [tid=140451024152320] ido2db_db_query() start
Thu Nov  1 15:02:26 2012 .187789 [002.0] [pid=14804] [tid=140451024152320] UPDATE icinga_objects SET is_active='1' WHERE instance_id=1 AND objecttype_id=9 AND object_id=92
Thu Nov  1 15:02:26 2012 .188902 [001.2] [pid=14804] [tid=140451024152320] ido2db_db_query(0) end
Thu Nov  1 15:02:26 2012 .188936 [001.2] [pid=14804] [tid=140451024152320] ido2db_set_object_as_active() end
Thu Nov  1 15:02:26 2012 .188967 [001.2] [pid=14804] [tid=140451024152320] ido2db_query_insert_or_update_timeperiodefinition_definition_add() start
Thu Nov  1 15:02:26 2012 .188999 [001.2] [pid=14804] [tid=140451024152320] ido2db_db_query() start
Thu Nov  1 15:02:26 2012 .189081 [002.0] [pid=14804] [tid=140451024152320] UPDATE icinga_timeperiods SET alias='24 Hours A Day, 7 Days A Week' WHERE instance_id=1 AND config_type=1 AND timeperiod_object_id=92
Thu Nov  1 15:02:26 2012 .189330 [001.2] [pid=14804] [tid=140451024152320] ido2db_db_query(0) end
Thu Nov  1 15:02:26 2012 .189361 [001.2] [pid=14804] [tid=140451024152320] ido2db_db_query() start
Thu Nov  1 15:02:26 2012 .189455 [002.0] [pid=14804] [tid=140451024152320] SELECT timeperiod_id FROM icinga_timeperiods WHERE instance_id=1 AND config_type=1 AND timeperiod_object_id=92
Thu Nov  1 15:02:26 2012 .189730 [001.2] [pid=14804] [tid=140451024152320] ido2db_db_query(0) end
Thu Nov  1 15:02:26 2012 .189759 [001.2] [pid=14804] [tid=140451024152320] ido2db_db_query() start
Thu Nov  1 15:02:26 2012 .189834 [002.0] [pid=14804] [tid=140451024152320] INSERT INTO icinga_timeperiods (instance_id, config_type, timeperiod_object_id, alias) VALUES (1, 1, 92, '24 Hours A Day, 7 Days A Week')
Thu Nov  1 15:02:26 2012 .190571 [001.2] [pid=14804] [tid=140451024152320] ido2db_db_query(0) end
Thu Nov  1 15:02:26 2012 .190596 [001.2] [pid=14804] [tid=140451024152320] ido2db_handle_timeperiodefinition(89) timeperiod_id
Thu Nov  1 15:02:26 2012 .190610 [001.2] [pid=14804] [tid=140451024152320] ido2db_query_insert_or_update_timeperiodefinition_definition_add() end
Thu Nov  1 15:02:26 2012 .190624 [001.2] [pid=14804] [tid=140451024152320] ido2db_handle_timeperiodefinition() timeranges start
Thu Nov  1 15:02:26 2012 .190659 [001.2] [pid=14804] [tid=140451024152320] ido2db_db_query() start
Thu Nov  1 15:02:26 2012 .190738 [002.0] [pid=14804] [tid=140451024152320] INSERT INTO icinga_timeperiod_timeranges (instance_id, timeperiod_id, day, start_sec, end_sec) VALUES (1,89,0,0,86400),(1,89,1,0,86400),(1,89,2,0,86400),(1,89,3,0,86400),(1,89,4,0,86400),(1,89,5,0,86400),(1,89,6,0,86400)
Thu Nov  1 15:02:26 2012 .191444 [001.2] [pid=14804] [tid=140451024152320] ido2db_db_query(0) end
Thu Nov  1 15:02:26 2012 .191468 [001.2] [pid=14804] [tid=140451024152320] ido2db_handle_timeperiodefinition() end
  • mysql, clean_config_tables_on_core_startup=0 (/)
Thu Nov  1 15:11:15 2012 .103528 [001.2] [pid=18511] [tid=140705264486144] ido2db_db_query(0) end
Thu Nov  1 15:11:15 2012 .103558 [001.2] [pid=18511] [tid=140705264486144] ido2db_get_object_id(98) end
Thu Nov  1 15:11:15 2012 .103584 [001.2] [pid=18511] [tid=140705264486144] ido2db_query_insert_or_update_hostdefinition_definition_add() start
Thu Nov  1 15:11:15 2012 .103629 [001.2] [pid=18511] [tid=140705264486144] ido2db_db_query() start
Thu Nov  1 15:11:15 2012 .103712 [002.0] [pid=18511] [tid=140705264486144] UPDATE icinga_hosts SET alias='1066localhost', display_name='1066display_localhost', address='127\.0\.0\.1', check_command_object_id=88, check_command_args='', eventhandler_command_o
bject_id=0, eventhandler_command_args='', check_timeperiod_object_id=2, notification_timeperiod_object_id=98, failure_prediction_options='', check_interval=5.000000, retry_interval=1.000000, max_check_attempts=10, first_notification_delay=0.000000, notifica
tion_interval=120.000000, notify_on_down=1, notify_on_unreachable=1, notify_on_recovery=1, notify_on_flapping=0, notify_on_downtime=0, stalk_on_up=0, stalk_on_down=0, stalk_on_unreachable=0, flap_detection_enabled=1, flap_detection_on_up=1, flap_detection_o
n_down=1, flap_detection_on_unreachable=1, low_flap_threshold=0.000000, high_flap_threshold=0.000000, process_performance_data=1, freshness_checks_enabled=0, freshness_threshold=0, passive_checks_enabled=1, event_handler_enabled=1, active_checks_enabled=1, 
retain_status_information=1, retain_nonstatus_information=1, notifications_enabled=1, obsess_over_host=1, failure_prediction_enabled=1, notes='', notes_url='', action_url='', icon_image='s\.gif\' width=\'0\' height=\'0\' border=\'0\'>

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2012-11-01 14:29:51 +00:00

up in 'test/ido' for futher tests.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2012-11-10 15:05:02 +00:00

in my dev environment, this runs like a charm, though, it slightly decreases performance due to the added select query after running an update. this only happens on startup, as those "last insert ids" are just for relating among config data, so it does not really touch the overall performance during runtime of ido2db.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2012-11-20 15:01:48 +00:00

  • Status changed from 7 to Resolved
  • Done % changed from 90 to 100

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2014-12-08 14:35:05 +00:00

  • Project changed from 18 to Core, Classic UI, IDOUtils
  • Category changed from 79 to IDOUtils
  • OS Version set to RHEL 6.3

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant