summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 85e6d0d)
raw | patch | inline | side by side (parent: 85e6d0d)
author | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 3 Jun 2008 14:43:30 +0000 (14:43 +0000) | ||
committer | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 3 Jun 2008 14:43:30 +0000 (14:43 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11177 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/gosa-si-server | patch | blob | history | |
gosa-si/server/events/gosaTriggered.pm | patch | blob | history |
diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server
index cbf152842b36b94f2682386e6bef3f50c83b9602..14918ba322fa4033516072eccf19424d3555e585 100755 (executable)
--- a/gosa-si/gosa-si-server
+++ b/gosa-si/gosa-si-server
our $cfg_file;
our ($ldap_uri, $ldap_base, $ldap_admin_dn, $ldap_admin_password, $ldap_server_dn);
-# Where should new systems be placed
-our $new_systems_ou;
# specifies the verbosity of the daemon_log
$verbose = 0 ;
"job-queue-loop-delay" => [\$job_queue_loop_delay, 3],
"messaging-db-loop-delay" => [\$messaging_db_loop_delay, 3],
"key" => [\$GosaPackages_key, "none"],
- "new-systems-ou" => [\$new_systems_ou, "ou=systems"],
},
"ClientPackages" => {
"key" => [\$ClientPackages_key, "none"],
my $client_answer = "";
# prepare all variables needed to process message
+ #my $msg = $task->{'xmlmessage'};
my $msg = &decode_base64($task->{'xmlmessage'});
my $incoming_id = $task->{'id'};
my $module = $task->{'module'};
if ($mesg->count) {
my @entries = $mesg->entries;
+ if (0 == @entries) {
+ daemon_log("$session_id ERROR: ldap search failed: ldap_base=$ldap_base, filter=$search", 1);
+ }
+
foreach my $entry (@entries) {
# Only modify entry if it is not set to '$state'
if ($entry->get_value("FAIstate") ne "$state"){
daemon_log("$session_id DEBUG FAIstate at host '".$entry->dn."' already at state '$st'", 7);
}
}
+ } else {
+ daemon_log("$session_id ERROR: LDAP search failed: ldap_base=$ldap_base, filter=$search", 1);
}
+
# if no ldap handle defined
} else {
daemon_log("$session_id ERROR: no LDAP handle defined for update FAIstate", 1);
}
+ return;
}
}
}
- }
+ } else {
+ daemon_log("$session_id ERROR: LDAP search failed: ldap_base=$ldap_base, filter=$search", 1);
+ }
}
}
index 11bd7417ce8e09de13dba97e468b25b0a452d4f3..1b278a52b943d0f6772e69ff356d24b111b6ddd2 100644 (file)
sub trigger_action_faireboot {
my ($msg, $msg_hash, $session_id) = @_;
- my $macaddress = @{$msg_hash->{target}}[0];
+ my $macaddress = @{$msg_hash->{macaddress}}[0];
my $source = @{$msg_hash->{source}}[0];
my @out_msg_l;
$msg =~ s/<header>gosa_trigger_action_faireboot<\/header>/<header>trigger_action_faireboot<\/header>/;
push(@out_msg_l, $msg);
- &main::change_goto_state('locked', \@{$msg_hash->{target}}, $session_id);
- &main::change_fai_state('install', \@{$msg_hash->{target}}, $session_id);
+ &main::change_goto_state('locked', \@{$msg_hash->{macaddress}}, $session_id);
+ &main::change_fai_state('install', \@{$msg_hash->{macaddress}}, $session_id);
# delete all jobs from jobqueue which correspond to fai
my $sql_statement = "DELETE FROM $main::job_queue_tn WHERE (macaddress='$macaddress' AND ".
sub trigger_action_lock {
my ($msg, $msg_hash, $session_id) = @_;
- my $macaddress = @{$msg_hash->{target}}[0];
+ my $macaddress = @{$msg_hash->{macaddress}}[0];
my $source = @{$msg_hash->{source}}[0];
- &main::change_goto_state('locked', \@{$msg_hash->{target}}, $session_id);
+ &main::change_goto_state('locked', \@{$msg_hash->{macaddress}}, $session_id);
my $jobdb_id = @{$msg_hash->{'jobdb_id'}}[0];
if( defined $jobdb_id) {
my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=jobdb_id";
sub trigger_action_activate {
my ($msg, $msg_hash, $session_id) = @_;
- my $macaddress = @{$msg_hash->{target}}[0];
+ my $macaddress = @{$msg_hash->{macaddress}}[0];
my $source = @{$msg_hash->{source}}[0];
- &main::change_goto_state('active', \@{$msg_hash->{target}}, $session_id);
+ &main::change_goto_state('active', \@{$msg_hash->{macaddress}}, $session_id);
my $jobdb_id = @{$msg_hash->{'jobdb_id'}}[0];
if( defined $jobdb_id) {
my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=jobdb_id";
sub trigger_action_localboot {
my ($msg, $msg_hash, $session_id) = @_;
$msg =~ s/<header>gosa_trigger_action_localboot<\/header>/<header>trigger_action_localboot<\/header>/;
- &main::change_fai_state('localboot', \@{$msg_hash->{target}}, $session_id);
+ &main::change_fai_state('localboot', \@{$msg_hash->{macaddress}}, $session_id);
my $jobdb_id = @{$msg_hash->{'jobdb_id'}}[0];
if( defined $jobdb_id) {
my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=jobdb_id";
my ($msg, $msg_hash, $session_id) = @_;
$msg =~ s/<header>gosa_trigger_action_halt<\/header>/<header>trigger_action_halt<\/header>/;
- &main::change_fai_state('halt', \@{$msg_hash->{target}}, $session_id);
+ &main::change_fai_state('halt', \@{$msg_hash->{macaddress}}, $session_id);
my $jobdb_id = @{$msg_hash->{'jobdb_id'}}[0];
if( defined $jobdb_id) {
my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=jobdb_id";
my ($msg, $msg_hash, $session_id) = @_;
$msg =~ s/<header>gosa_trigger_action_reboot<\/header>/<header>trigger_action_reboot<\/header>/;
- &main::change_fai_state('reboot', \@{$msg_hash->{target}}, $session_id);
+ &main::change_fai_state('reboot', \@{$msg_hash->{macaddress}}, $session_id);
my $jobdb_id = @{$msg_hash->{'jobdb_id'}}[0];
if( defined $jobdb_id) {
my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=jobdb_id";
my ($msg, $msg_hash, $session_id) = @_ ;
$msg =~ s/<header>gosa_trigger_action_memcheck<\/header>/<header>trigger_action_memcheck<\/header>/;
- &main::change_fai_state('memcheck', \@{$msg_hash->{target}}, $session_id);
+ &main::change_fai_state('memcheck', \@{$msg_hash->{macaddress}}, $session_id);
my $jobdb_id = @{$msg_hash->{'jobdb_id'}}[0];
if( defined $jobdb_id) {
my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=jobdb_id";
my ($msg, $msg_hash, $session_id) = @_;
$msg =~ s/<header>gosa_trigger_action_reinstall<\/header>/<header>trigger_action_reinstall<\/header>/;
- &main::change_fai_state('reinstall', \@{$msg_hash->{target}}, $session_id);
+ &main::change_fai_state('reinstall', \@{$msg_hash->{macaddress}}, $session_id);
- my %data = ( 'macAddress' => \@{$msg_hash->{target}} );
+ my %data = ( 'macAddress' => \@{$msg_hash->{macaddress}} );
my $wake_msg = &build_msg("trigger_wake", "GOSA", "KNOWN_SERVER", \%data);
my @out_msg_l = ($wake_msg, $msg);
return @out_msg_l;
my ($msg, $msg_hash, $session_id) = @_;
$msg =~ s/<header>gosa_trigger_action_update<\/header>/<header>trigger_action_update<\/header>/;
- &main::change_fai_state('update', \@{$msg_hash->{target}}, $session_id);
+ &main::change_fai_state('update', \@{$msg_hash->{macaddress}}, $session_id);
- my %data = ( 'macAddress' => \@{$msg_hash->{target}} );
+ my %data = ( 'macAddress' => \@{$msg_hash->{macaddress}} );
my $wake_msg = &build_msg("trigger_wake", "GOSA", "KNOWN_SERVER", \%data);
my @out_msg_l = ($wake_msg, $msg);
return @out_msg_l;
my ($msg, $msg_hash, $session_id) = @_;
$msg =~ s/<header>gosa_trigger_action_instant_update<\/header>/<header>trigger_action_instant_update<\/header>/;
- &main::change_fai_state('update', \@{$msg_hash->{target}}, $session_id);
+ &main::change_fai_state('update', \@{$msg_hash->{macaddress}}, $session_id);
my $jobdb_id = @{$msg_hash->{'jobdb_id'}}[0];
if( defined $jobdb_id) {
my $res = $main::job_db->exec_statement($sql_statement);
}
- my %data = ( 'macAddress' => \@{$msg_hash->{target}} );
+ my %data = ( 'macAddress' => \@{$msg_hash->{macaddress}} );
my $wake_msg = &build_msg("trigger_wake", "GOSA", "KNOWN_SERVER", \%data);
my @out_msg_l = ($wake_msg, $msg);
return @out_msg_l;
my ($msg, $msg_hash, $session_id) = @_;
$msg =~ s/<header>gosa_trigger_action_sysinfo<\/header>/<header>trigger_action_sysinfo<\/header>/;
- &main::change_fai_state('sysinfo', \@{$msg_hash->{target}}, $session_id);
+ &main::change_fai_state('sysinfo', \@{$msg_hash->{macaddress}}, $session_id);
my $jobdb_id = @{$msg_hash->{'jobdb_id'}}[0];
if( defined $jobdb_id) {
my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=jobdb_id";
}
- my %data = ( 'macAddress' => \@{$msg_hash->{target}} );
+ my %data = ( 'macAddress' => \@{$msg_hash->{macaddress}} );
my $out_msg = &build_msg("trigger_wake", "GOSA", "KNOWN_SERVER", \%data);
my @out_msg_l = ($out_msg);
return @out_msg_l;