2010-11-08 Sergio Martin <srgio.martin@artica.es>
* util/pandora_sync_db.pl: Added two special synchronization cases git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3558 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
242c07f0a6
commit
ce5aeffd30
|
@ -1,3 +1,8 @@
|
||||||
|
2010-11-08 Sergio Martin <srgio.martin@artica.es>
|
||||||
|
|
||||||
|
* util/pandora_sync_db.pl: Added two special
|
||||||
|
synchronization cases
|
||||||
|
|
||||||
2010-11-08 Sergio Martin <sergio.martin@artica.es>
|
2010-11-08 Sergio Martin <sergio.martin@artica.es>
|
||||||
|
|
||||||
* util/pandora_sync_db.pl: Fixed array pass
|
* util/pandora_sync_db.pl: Fixed array pass
|
||||||
|
|
|
@ -158,6 +158,14 @@ sub pandora_sync_main ($$$) {
|
||||||
my @types;
|
my @types;
|
||||||
|
|
||||||
print "\n[*] Cleaning destination database.\n";
|
print "\n[*] Cleaning destination database.\n";
|
||||||
|
|
||||||
|
# Mixed and special cases deletion
|
||||||
|
empty_table($dbh_dest, 'tlayout_data');
|
||||||
|
if($sync_data == 1) {
|
||||||
|
empty_table($dbh_dest, 'tevento');
|
||||||
|
}
|
||||||
|
empty_table($dbh_dest, 'treport_content');
|
||||||
|
empty_table($dbh_dest, 'treport_content_sla_combined');
|
||||||
|
|
||||||
for(my $i = 0; $i <= $#{$tables_data[0]}; $i++) {
|
for(my $i = 0; $i <= $#{$tables_data[0]}; $i++) {
|
||||||
empty_table($dbh_dest, $tables_data[0]->[$i]) unless !defined $tables_data[0]->[$i];
|
empty_table($dbh_dest, $tables_data[0]->[$i]) unless !defined $tables_data[0]->[$i];
|
||||||
|
@ -175,12 +183,6 @@ sub pandora_sync_main ($$$) {
|
||||||
|
|
||||||
print "\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b[*] $percent % Completed" unless $percent > 100;
|
print "\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b[*] $percent % Completed" unless $percent > 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Mixed cases
|
|
||||||
empty_table($dbh_dest, 'tlayout_data');
|
|
||||||
if($sync_data == 1) {
|
|
||||||
empty_table($dbh_dest, 'tevento');
|
|
||||||
}
|
|
||||||
|
|
||||||
print "\n\n";
|
print "\n\n";
|
||||||
|
|
||||||
|
@ -199,6 +201,14 @@ sub pandora_sync_main ($$$) {
|
||||||
enterprise_hook('sync_clone_table', [$dbh_source, $dbh_dest, 'tevento', \@columns, \@types, \@id_agent_comparation, \@id_agentmodule_comparation, \@id_server_export_comparation, \@id_server_comparation]);
|
enterprise_hook('sync_clone_table', [$dbh_source, $dbh_dest, 'tevento', \@columns, \@types, \@id_agent_comparation, \@id_agentmodule_comparation, \@id_server_export_comparation, \@id_server_comparation]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@columns = ('id_agent_module', 'id_agent');
|
||||||
|
@types = ('module', 'agent');
|
||||||
|
enterprise_hook('sync_clone_table', [$dbh_source, $dbh_dest, 'treport_content', \@columns, \@types, \@id_agent_comparation, \@id_agentmodule_comparation, \@id_server_export_comparation, \@id_server_comparation]);
|
||||||
|
|
||||||
|
#Special
|
||||||
|
#This case is not mixed but is here to respect the foreing key
|
||||||
|
enterprise_hook('sync_clone_table', [$dbh_source, $dbh_dest, 'treport_content_sla_combined', 'id_agent_module', 'module', \@id_agent_comparation, \@id_agentmodule_comparation, \@id_server_export_comparation, \@id_server_comparation]);
|
||||||
|
|
||||||
my $errors = $errors_agents + $errors_modules + $errors_servers + $errors_exportservers;
|
my $errors = $errors_agents + $errors_modules + $errors_servers + $errors_exportservers;
|
||||||
|
|
||||||
if($errors == 0) {
|
if($errors == 0) {
|
||||||
|
|
Loading…
Reference in New Issue