From: rettenbe Date: Thu, 21 Feb 2008 14:03:52 +0000 (+0000) Subject: add new CLMSG to gosa-si-client X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1224ef3997e0c2c3e9edbdf61ad444e49af6fcfa;p=gosa.git add new CLMSG to gosa-si-client git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9021 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/gosa-si-client b/gosa-si/gosa-si-client index 0c962c8ea..98a3844f7 100755 --- a/gosa-si/gosa-si-client +++ b/gosa-si/gosa-si-client @@ -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 diff --git a/gosa-si/modules/GosaPackages.pm b/gosa-si/modules/GosaPackages.pm index b0884efab..772955f12 100644 --- a/gosa-si/modules/GosaPackages.pm +++ b/gosa-si/modules/GosaPackages.pm @@ -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); diff --git a/gosa-si/modules/SIPackages.pm b/gosa-si/modules/SIPackages.pm index d78915395..f00ffbd57 100644 --- a/gosa-si/modules/SIPackages.pm +++ b/gosa-si/modules/SIPackages.pm @@ -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 diff --git a/gosa-si/tests/client.php b/gosa-si/tests/client.php index 0ff74479c..42d1f7a63 100755 --- a/gosa-si/tests/client.php +++ b/gosa-si/tests/client.php @@ -24,7 +24,7 @@ if($sock->connected()){ #$data = "
gosa_delete_jobdb_entry
3
"; # update -#$data = "
gosa_update_status_jobdb_entry
waiting processing update
"; +$data = "
gosa_update_status_jobdb_entry
GOSAGOSA waiting processing update
"; # query #$data = "
gosa_query_jobdb
andgt0le5
"; @@ -54,7 +54,7 @@ if($sock->connected()){ #$data = "
job_trigger_action_reinstall
GOSA00:01:6c:9d:b9:fa00:01:6c:9d:b9:fa20130101000000
"; -$data = "
job_trigger_action_reinstall
GOSA00:01:6c:9d:b9:fa00:01:6c:9d:b9:fa
"; +#$data = "
job_trigger_action_reinstall
GOSA00:01:6c:9d:b9:fa00:01:6c:9d:b9:fa
"; $sock->write($data);