Code

* gosa-si-server-nobus
authorrettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 20 May 2008 09:39:07 +0000 (09:39 +0000)
committerrettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 20 May 2008 09:39:07 +0000 (09:39 +0000)
* under construction

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10966 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-si/gosa-si-server-nobus
gosa-si/server/events/server_server_com.pm

index 012794178bf1076f0294489795c1008d83c2552d..f1c7629668ebf55d6474571c0c63fd44aa304bce 100755 (executable)
@@ -932,7 +932,7 @@ sub send_msg_to_target {
     $res = $known_clients_db->select_dbentry($sql_statement);
     if( keys(%$res) > 0) {
         $act_status = $res->{1}->{'status'};
-        if( $act_status eq "down" ) {
+        if ($act_status eq "down" && $new_status eq "down") {
             $sql_statement = "DELETE FROM known_clients WHERE hostname='$address'";
             $res = $known_clients_db->del_dbentry($sql_statement);
             daemon_log("$session_id WARNING: failed 2x to send msg to host '$address', delete host from known_clients", 3);
@@ -948,11 +948,12 @@ sub send_msg_to_target {
     }
 
     # known_server
-    $sql_statement = "SELECT * FROM known_server WHERE hostname='$address'";
+    $sql_statement = "SELECT * FROM $known_server_tn WHERE hostname='$address'";
     $res = $known_server_db->select_dbentry($sql_statement);
+print STDERR Dumper($res);    
     if( keys(%$res) > 0 ) {
         $act_status = $res->{1}->{'status'};
-        if( $act_status eq "down" ) {
+        if ($act_status eq "down" && $new_status eq "down") {
             $sql_statement = "DELETE FROM known_server WHERE hostname='$address'";
             $res = $known_server_db->del_dbentry($sql_statement);
             daemon_log("$session_id WARNING: failed 2x to send a message to host '$address', delete host from known_server", 3);
index 7618c3908f811aeeec0d29799523ff99b3d132b7..56b7f2a13e16980ebbfe03e9c0b9813f0934bf38 100644 (file)
@@ -58,7 +58,7 @@ sub new_server {
     # build confirm_new_server message
     my %data = ( key=>$key );
     my $out_msg = &build_msg('confirm_new_server', $main::server_address, $source, \%data);
-    my $error =  &main::send_msg_to_target($out_msg, $source, $main::Serverpackages_key, 'confirm_new_server', $session_id); 
+    my $error =  &main::send_msg_to_target($out_msg, $source, $main::ServerPackages_key, 'confirm_new_server', $session_id); 
     
 
 }
@@ -66,9 +66,6 @@ sub new_server {
 
 sub confirm_new_server {
     my ($msg, $msg_hash, $session_id) = @_ ;
-
-print STDERR Dumper($msg_hash);
-
     my $header = @{$msg_hash->{'header'}}[0];
     my $source = @{$msg_hash->{'source'}}[0];
     my $key = @{$msg_hash->{'key'}}[0];