summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0ab8461)
raw | patch | inline | side by side (parent: 0ab8461)
author | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 4 Nov 2008 15:26:29 +0000 (15:26 +0000) | ||
committer | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 4 Nov 2008 15:26:29 +0000 (15:26 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12900 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/server/events/gosaTriggered.pm | patch | blob | history |
index 551dfb343b3f55ca642e243b0f7001467dfc2ee1..d4f321b7dc39af41f439c837677907916beef1c5 100644 (file)
}
my $out_msg = &create_xml_string($out_hash);
- my %data = ( 'macaddress' => \@{$msg_hash->{macaddress}} );
- my $wake_msg = &build_msg("trigger_wake", "GOSA", "KNOWN_SERVER", \%data);
- &main::server_server_com::trigger_wake($msg, $msg_hash, $session_id);
-
- my @out_msg_l = ($wake_msg, $out_msg);
+ my @out_msg_l = ($out_msg);
return @out_msg_l;
}
return ( $out_msg );
}
+ my %data = ( 'macaddress' => \@{$msg_hash->{macaddress}} );
+ my $wake_msg = &build_msg("trigger_wake", "GOSA", "KNOWN_SERVER", \%data);
+ &main::server_server_com::trigger_wake($msg, $msg_hash, $session_id);
+
sub trigger_activate_new {
my ($msg, $msg_hash, $session_id) = @_;
my $dhcp_statement= (defined($msg_hash->{'dhcp'}))?@{$msg_hash->{'dhcp'}}[0]:undef;
my $jobdb_id= (defined($msg_hash->{'jobdb_id'}))?@{$msg_hash->{'jobdb_id'}}[0]:undef;
+ # In case that the client is sleeping, wake it up
+ my %data = ( 'macaddress' => $mac );
+ my $wake_msg = &build_msg("trigger_wake", "GOSA", "KNOWN_SERVER", \%data);
+ &main::server_server_com::trigger_wake($msg, $msg_hash, $session_id);
+ my $sql_statement= "SELECT * FROM $known_server_tn";
+ my $query_res = $main::known_server_db->select_dbentry( $sql_statement );
+ while( my ($hit_num, $hit) = each %{ $query_res } ) {
+ my $host_name = $hit->{hostname};
+ my $host_key = $hit->{hostkey};
+ $wake_msg =~ s/<target>\S+<\/target>/<target>$host_name<\/target>/g;
+ my $error = &main::send_msg_to_target($wake_msg, $host_name, $host_key, $header, $session_id);
+ }
+
+
+
my $ldap_handle = &main::get_ldap_handle();
my $ldap_entry;
my $ogroup_entry;
} elsif ($ldap_mesg->count == 0) {
&main::daemon_log("$session_id WARNING: No System with mac address '$mac' was found in base '".$main::ldap_base."'! Re-queuing job.", 4);
- $main::job_db->exec_statement("UPDATE ".$main::job_queue_tn." SET status = 'waiting' WHERE id = $jobdb_id");
- $main::job_db->exec_statement("UPDATE ".$main::job_queue_tn." SET timestamp = '".(&calc_timestamp(&get_time(), 'plus', 60))."' WHERE id = $jobdb_id");
+ my $sql_statement = "UPDATE ".$main::job_queue_tn.
+ ." SET status='waiting', timestamp = '".(&calc_timestamp(&get_time(), 'plus', 60))."' ".
+ ." WHERE id = $jobdb_id";
+ $main::job_db->exec_statement($sql_statement);
return undef;
}