Title: [opsview] [13205] truncate database in 900 (configdumpstart) instead of 200 (processdata) as it
- Revision
- 13205
- Author
- aburzynski
- Date
- 2013-08-12 16:26:31 +0100 (Mon, 12 Aug 2013)
Log Message
truncate database in 900 (configdumpstart) instead of 200 (processdata) as it
happens too early
Modified Paths
Modified: trunk/opsview-core/lib/Opsview/Utils/NDOLogsImporter.pm
===================================================================
--- trunk/opsview-core/lib/Opsview/Utils/NDOLogsImporter.pm 2013-08-12 11:29:15 UTC (rev 13204)
+++ trunk/opsview-core/lib/Opsview/Utils/NDOLogsImporter.pm 2013-08-12 15:26:31 UTC (rev 13205)
@@ -3447,6 +3447,58 @@
else {
$CURRENT_OBJECT_CONFIG_TYPE = 0;
}
+
+ my ( $state_time, $state_time_usec ) =
+ timeval( $event->[ NDO_DATA_TIMESTAMP() ] );
+
+ my $is_current = $state_time >= $LATEST_REALTIME_DATA_TIME;
+
+ if ($is_current) {
+
+ my @tables = qw(
+ nagios_programstatus
+ nagios_contactstatus
+ nagios_timedeventqueue
+ nagios_comments
+ nagios_runtimevariables
+ nagios_customvariablestatus
+ nagios_configfiles
+ nagios_configfilevariables
+ nagios_customvariables
+ nagios_commands
+ nagios_timeperiods
+ nagios_timeperiod_timeranges
+ nagios_contactgroups
+ nagios_contactgroup_members
+ nagios_hostgroups
+ nagios_hostgroup_members
+ nagios_servicegroups
+ nagios_servicegroup_members
+ nagios_hostescalations
+ nagios_hostescalation_contacts
+ nagios_serviceescalations
+ nagios_serviceescalation_contacts
+ nagios_hostdependencies
+ nagios_servicedependencies
+ nagios_contacts
+ nagios_contact_addresses
+ nagios_contact_notificationcommands
+ nagios_hosts
+ nagios_host_parenthosts
+ nagios_host_contacts
+ nagios_services
+ nagios_service_contacts
+ nagios_service_contactgroups
+ nagios_host_contactgroups
+ nagios_hostescalation_contactgroups
+ nagios_serviceescalation_contactgroups
+ );
+
+ db_clear_table($_) for @tables;
+
+ set_all_objects_as_inactive();
+ }
+
}
return 1;
@@ -3507,53 +3559,6 @@
my $is_current = $state_time >= $LATEST_REALTIME_DATA_TIME;
- if ( $type == NEBTYPE_PROCESS_PRELAUNCH() && $is_current ) {
-
- my @tables = qw(
- nagios_programstatus
- nagios_contactstatus
- nagios_timedeventqueue
- nagios_comments
- nagios_runtimevariables
- nagios_customvariablestatus
- nagios_configfiles
- nagios_configfilevariables
- nagios_customvariables
- nagios_commands
- nagios_timeperiods
- nagios_timeperiod_timeranges
- nagios_contactgroups
- nagios_contactgroup_members
- nagios_hostgroups
- nagios_hostgroup_members
- nagios_servicegroups
- nagios_servicegroup_members
- nagios_hostescalations
- nagios_hostescalation_contacts
- nagios_serviceescalations
- nagios_serviceescalation_contacts
- nagios_hostdependencies
- nagios_servicedependencies
- nagios_contacts
- nagios_contact_addresses
- nagios_contact_notificationcommands
- nagios_hosts
- nagios_host_parenthosts
- nagios_host_contacts
- nagios_services
- nagios_service_contacts
- nagios_service_contactgroups
- nagios_host_contactgroups
- nagios_hostescalation_contactgroups
- nagios_serviceescalation_contactgroups
- );
-
- db_clear_table($_) for @tables;
-
- set_all_objects_as_inactive();
-
- }
-
if (
(
$type == NEBTYPE_PROCESS_SHUTDOWN()
_______________________________________________
Opsview-checkins mailing list
Opsview-checkins@lists.opsview.org
http://lists.opsview.org/lists/listinfo/opsview-checkins