Code

add new CLMSG to gosa-si-client
authorrettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 21 Feb 2008 14:03:52 +0000 (14:03 +0000)
committerrettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 21 Feb 2008 14:03:52 +0000 (14:03 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9021 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-si/gosa-si-client
gosa-si/modules/GosaPackages.pm
gosa-si/modules/SIPackages.pm
gosa-si/tests/client.php

index 0c962c8eac7aa2bb839a23f0d3786920f75ffe30..98a3844f77c6e39a2217c240c34436c9cf84d0ec 100755 (executable)
@@ -62,7 +62,7 @@ our $server_key;
 our $REGISTERED = 0;
 
 # path to fifo for non-gosa-si-client messages to gosa-si-server
-$gosa_si_client_fifo = "/tmp/gosa-si-client-fifo";
+$gosa_si_client_fifo = "/var/run/gosa-si-client.socket";
 %files_to_watch = (fifo => $gosa_si_client_fifo); 
 
 # in function register_at_gosa_si_server, after which period of seconds a new registration should be tried if a registration was 
index b0884efab047c6dbc393c0c91efca2fb8d5eb580..772955f122911d1ec279d508c37f70e678eccb36 100644 (file)
@@ -534,6 +534,8 @@ sub update_status_jobdb_entry {
         
 
         my $sql_statement = "UPDATE $table $update $where";
+print STDERR "================================================\n";
+print STDERR "$sql_statement\n";
         # execute db query
         my $db_res = $main::job_db->update_dbentry($sql_statement);
 
index d78915395eea8918a6c2e472dbd8792e6a2b3ff2..f00ffbd577feaaeb9bd259022bde844459964743 100644 (file)
@@ -906,124 +906,7 @@ sub new_ldap_config {
        return &build_msg("new_ldap_config", $server_address, $address, \%data);
 }
 
-#sub process_detected_hardware {
-#      my $msg_hash = shift;
-#      my $address = $msg_hash->{source}[0];
-#      my $gotoHardwareChecksum= $msg_hash->{detected_hardware}[0]->{gotoHardwareChecksum};
-#
-#    my $sql_statement= "SELECT * FROM known_clients WHERE hostname='$address'";
-#    my $res = $main::known_clients_db->select_dbentry( $sql_statement );
-#
-#    # check hit
-#    my $hit_counter = keys %{$res};
-#    if( not $hit_counter == 1 ) {
-#        &main::daemon_log("ERROR: more or no hit found in known_clients_db by query by '$address'", 1);
-#              return;
-#    }
-#
-#    my $macaddress = $res->{1}->{macaddress};
-#    my $hostkey = $res->{1}->{hostkey};
-#
-#    if (not defined $macaddress) {
-#        &main::daemon_log("ERROR: no mac address found for client $address", 1);
-#        return;
-#    }
-#    # Build LDAP connection
-#    my $ldap = Net::LDAP->new($ldap_uri);
-#    if( not defined $ldap ) {
-#        &main::daemon_log("ERROR: cannot connect to ldap: $ldap_uri", 1);
-#        return;
-#    } 
-#
-#    # Bind to a directory with dn and password
-#    my $mesg= $ldap->bind($ldap_admin_dn, password => $ldap_admin_password);
-#
-#    # Perform search
-#      $mesg = $ldap->search(
-#              base   => $ldap_base,
-#              scope  => 'sub',
-#              filter => "(&(objectClass=GOhard)(|(macAddress=$macaddress)(dhcpHWaddress=ethernet $macaddress)))"
-#      );
-#
-#      # We need to create a base entry first (if not done from ArpHandler)
-#      if($mesg->count == 0) {
-#              &main::daemon_log("Need to create a new LDAP Entry for client $address", 1);
-#              my $resolver=Net::DNS::Resolver->new;
-#              my $ipaddress= $1 if $address =~ /^([0-9\.]*?):.*$/;
-#              my $dnsresult= $resolver->search($ipaddress);
-#              my $dnsname= (defined($dnsresult))?$dnsresult->{answer}[0]->{ptrdname}:$ipaddress;
-#              my $cn = (($dnsname =~ /^(\d){1,3}\.(\d){1,3}\.(\d){1,3}\.(\d){1,3}/) ? $dnsname : sprintf "%s", $dnsname =~ /([^\.]+)\.?/);
-#              my $dn = "cn=$cn,ou=incoming,$ldap_base";
-#              &main::daemon_log("Creating entry for $dn",6);
-#              my $entry= Net::LDAP::Entry->new( $dn );
-#              $entry->dn($dn);
-#              $entry->add("objectClass" => "goHard");
-#              $entry->add("cn" => $cn);
-#              $entry->add("macAddress" => $macaddress);
-#              $entry->add("gotomode" => "locked");
-#              $entry->add("gotoSysStatus" => "new-system");
-#              $entry->add("ipHostNumber" => $ipaddress);
-#              if(defined($main::gosa_unit_tag) && length($main::gosa_unit_tag) > 0) {
-#                      $entry->add("objectClass" => "gosaAdministrativeUnit");
-#                      $entry->add("gosaUnitTag" => $main::gosa_unit_tag);
-#              }
-#              my $res=$entry->update($ldap);
-#              if(defined($res->{'errorMessage'}) &&
-#                      length($res->{'errorMessage'}) >0) {
-#                      &main::daemon_log("There was a problem adding the entries to LDAP:", 1);
-#                      &main::daemon_log($res->{'errorMessage'}, 1);
-#                      return;
-#              } else {
-#                      # Fill $mesg again
-#                      $mesg = $ldap->search(
-#                              base   => $ldap_base,
-#                              scope  => 'sub',
-#                              filter => "(&(objectClass=GOhard)(|(macAddress=$macaddress)(dhcpHWaddress=ethernet $macaddress)))"
-#                      );
-#              }
-#      }
-#      
-#      if($mesg->count == 1) {
-#              my $entry= $mesg->entry(0);
-#              $entry->changetype("modify");
-#              foreach my $attribute (
-#                      "gotoSndModule", "ghNetNic", "gotoXResolution", "ghSoundAdapter", "ghCpuType", "gotoXkbModel", 
-#                      "ghGfxAdapter", "gotoXMousePort", "ghMemSize", "gotoXMouseType", "ghUsbSupport", "gotoXHsync", 
-#                      "gotoXDriver", "gotoXVsync", "gotoXMonitor", "gotoHardwareChecksum") {
-#                      if(defined($msg_hash->{detected_hardware}[0]->{$attribute}) &&
-#                              length($msg_hash->{detected_hardware}[0]->{$attribute}) >0 ) {
-#                              if(defined($entry->get_value($attribute))) {
-#                                      $entry->delete($attribute);
-#                              }
-#                              &main::daemon_log("Adding attribute $attribute with value ".$msg_hash->{detected_hardware}[0]->{$attribute},1);
-#                              $entry->add($attribute => $msg_hash->{detected_hardware}[0]->{$attribute});     
-#                      }
-#              }
-#              foreach my $attribute (
-#                      "gotoModules", "ghScsiDev", "ghIdeDev") {
-#                      if(defined($msg_hash->{detected_hardware}[0]->{$attribute}) &&
-#                              length($msg_hash->{detected_hardware}[0]->{$attribute}) >0 ) {
-#                              if(defined($entry->get_value($attribute))) {
-#                                      $entry->delete($attribute);
-#                              }
-#                              foreach my $array_entry (@{$msg_hash->{detected_hardware}[0]->{$attribute}}) {
-#                                      $entry->add($attribute => $array_entry);
-#                              }
-#                      }
-#              }
-#
-#              my $res=$entry->update($ldap);
-#              if(defined($res->{'errorMessage'}) &&
-#                      length($res->{'errorMessage'}) >0) {
-#                      &main::daemon_log("There was a problem adding the entries to LDAP:", 1);
-#                      &main::daemon_log($res->{'errorMessage'}, 1);
-#              } else {
-#                      &main::daemon_log("Added Hardware configuration to LDAP", 4);
-#              }
-#
-#      }
-#      return;
-#}
+
 #===  FUNCTION  ================================================================
 #         NAME:  hardware_config
 #   PARAMETERS:  address - string - ip address and port of a host
index 0ff74479c92def5229b38dfef316087fd1d07666..42d1f7a63ffd373f6b088fe826955202ad12a61c 100755 (executable)
@@ -24,7 +24,7 @@ if($sock->connected()){
 #$data = "<xml> <header>gosa_delete_jobdb_entry</header><where><clause><phrase><id>3</id></phrase></clause></where></xml>";
 
 # update  
-#$data = "<xml> <header>gosa_update_status_jobdb_entry</header> <where><clause><phrase> <status>waiting</status></phrase></clause> </where> <update><status>processing</status> <result>update</result></update></xml>";
+$data = "<xml> <header>gosa_update_status_jobdb_entry</header> <source>GOSA</source><target>GOSA</target><where><clause><phrase> <status>waiting</status></phrase></clause> </where> <update><status>processing</status> <result>update</result></update></xml>";
 
 # query
 #$data = "<xml><header>gosa_query_jobdb</header><where><clause><connector>and</connector><phrase><operator>gt</operator><ROWID>0</ROWID></phrase><phrase><operator>le</operator><ROWID>5</ROWID></phrase></clause></where></xml>";
@@ -54,7 +54,7 @@ if($sock->connected()){
 
 
 #$data = "<xml><header>job_trigger_action_reinstall</header><source>GOSA</source><target>00:01:6c:9d:b9:fa</target><macaddress>00:01:6c:9d:b9:fa</macaddress><timestamp>20130101000000</timestamp></xml>";
-$data = "<xml><header>job_trigger_action_reinstall</header><source>GOSA</source><target>00:01:6c:9d:b9:fa</target><macaddress>00:01:6c:9d:b9:fa</macaddress></xml>";
+#$data = "<xml><header>job_trigger_action_reinstall</header><source>GOSA</source><target>00:01:6c:9d:b9:fa</target><macaddress>00:01:6c:9d:b9:fa</macaddress></xml>";
 
 
     $sock->write($data);