From f603bb9c16d96324fc43082ec4966f36b32a8107 Mon Sep 17 00:00:00 2001 From: rettenbe Date: Wed, 23 Jan 2008 16:55:40 +0000 Subject: [PATCH] upgrade of DBsqlite to more powerfull functions input parameter changes! git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8572 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/gosa-si-server | 46 ++--- gosa-si/modules/DBsqlite.pm | 189 +++++++------------- gosa-si/modules/GosaPackages.pm | 258 ++++++++++++++++++--------- gosa-si/modules/GosaSupportDaemon.pm | 27 +-- gosa-si/modules/ServerPackages.pm | 8 +- gosa-si/tests/client.php | 18 +- 6 files changed, 289 insertions(+), 257 deletions(-) diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server index 351878bc6..a34e5c97c 100755 --- a/gosa-si/gosa-si-server +++ b/gosa-si/gosa-si-server @@ -406,8 +406,8 @@ sub client_input { my $tmp = &{ $module."::process_incoming_msg" }($input.".".$heap->{remote_ip}."\n"); if (defined $tmp) { $answer = $tmp; + daemon_log("Got answer from module ".$module.": \n".$answer,8); } - daemon_log("Got answer from module ".$module.": ".$answer,8); } daemon_log("processing of msg finished", 5); @@ -427,19 +427,12 @@ sub watch_for_new_jobs { my ($kernel,$heap) = @_[KERNEL, HEAP]; # check gosa job queue for jobs with executable timestamp -# my ($seconds, $minutes, $hours, $monthday, $month, -# $year, $weekday, $yearday, $sommertime) = localtime(time); -# $hours = $hours < 10 ? $hours = "0".$hours : $hours; -# $minutes = $minutes < 10 ? $minutes = "0".$minutes : $minutes; -# $seconds = $seconds < 10 ? $seconds = "0".$seconds : $seconds; -# $month+=1; -# $month = $month < 10 ? $month = "0".$month : $month; -# $monthday = $monthday < 10 ? $monthday = "0".$monthday : $monthday; -# $year+=1900; -# my $timestamp = "$year$month$monthday$hours$minutes$seconds"; my $timestamp = &get_time(); - my $res = $job_db->select_dbentry( { table=>$job_queue_table_name, status=>'waiting', timestamp=>$timestamp } ); + my $sql_statement = "SELECT * FROM ".$job_queue_table_name. + " WHERE status='waiting' AND timestamp<'$timestamp'"; + + my $res = $job_db->select_dbentry( $sql_statement ); while( my ($id, $hit) = each %{$res} ) { @@ -447,19 +440,18 @@ sub watch_for_new_jobs { my $macaddress = $hit->{macaddress}; my $job_msg_hash = &transform_msg2hash($hit->{xmlmessage}); my $out_msg_hash = $job_msg_hash; - my $res_hash = $known_clients_db->select_dbentry( {table=>'known_clients', macaddress=>$macaddress} ); + my $sql_statement = "SELECT * FROM known_clients WHERE macaddress='$macaddress'"; + my $res_hash = $known_clients_db->select_dbentry( $sql_statement ); # expect macaddress is unique!!!!!! my $target = $res_hash->{1}->{hostname}; if (not defined $target) { &daemon_log("ERROR: no host found for mac address: $job_msg_hash->{mac}[0]", 1); &daemon_log("xml message: $hit->{xmlmessage}", 5); - my $update_hash = { table=>$job_queue_table_name, - update=> [ { status=>['error'], result=>["no host found for mac address"] } ], - where=> [ { id=>[$jobdb_id] } ], - }; - my $res = $job_db->update_dbentry($update_hash); - + my $sql_statement = "UPDATE $job_queue_table_name ". + "SET status='error', result='no host found for mac address' ". + "WHERE id='$jobdb_id'"; + my $res = $job_db->update_dbentry($sql_statement); next; } @@ -484,14 +476,15 @@ sub watch_for_new_jobs { my $error = &send_msg_hash2address($out_msg_hash, "$gosa_ip:$gosa_port", $gosa_passwd); if ($error == 0) { - my $sql = "UPDATE '$job_queue_table_name' SET status='processing', targettag='$target' WHERE id='$jobdb_id'"; - my $res = $job_db->exec_statement($sql); + my $sql_statement = "UPDATE $job_queue_table_name ". + "SET status='processing', targettag='$target' ". + "WHERE id='$jobdb_id'"; + my $res = $job_db->update_dbentry($sql_statement); } else { - my $update_hash = { table=>$job_queue_table_name, - update=> [ { status=>'error' } ], - where=> [ { id=>$jobdb_id } ], - }; - my $res = $job_db->update_dbentry($update_hash); + my $sql_statement = "UPDATE $job_queue_table_name ". + "SET status='error' ". + "WHERE id='$jobdb_id'"; + my $res = $job_db->update_dbentry($sql_statement); } } @@ -589,4 +582,3 @@ daemon_log("start socket for incoming xml messages at port '$server_port' ", 1); POE::Kernel->run(); exit; - diff --git a/gosa-si/modules/DBsqlite.pm b/gosa-si/modules/DBsqlite.pm index e03152960..031702871 100644 --- a/gosa-si/modules/DBsqlite.pm +++ b/gosa-si/modules/DBsqlite.pm @@ -173,94 +173,67 @@ sub add_dbentry { # 3 no restriction value ($restric_val) defined # 4 column name not known in table # 5 no column names to change specified +#sub update_dbentry { +# my $self = shift; +# my $arg = shift; +# +# +# # check completeness of function parameter +# # extract table statement from arg hash +# my $table = $arg->{table}; +# if (not defined $table) { +# return 1; +# } else { +# delete $arg->{table}; +# } +# +# # extract where parameter from arg hash +# my $where_statement = ""; +# if( exists $arg->{where} ) { +# my $where_hash = @{ $arg->{where} }[0]; +# if( 0 < keys %{ $where_hash } ) { +# my @where_list; +# while( my ($rest_pram, $rest_val) = each %{ $where_hash } ) { +# my $statement; +# if( $rest_pram eq 'timestamp' ) { +# $statement = "$rest_pram<'@{ $rest_val }[0]'"; +# } else { +# $statement = "$rest_pram='@{ $rest_val }[0]'"; +# } +# push( @where_list, $statement ); +# } +# $where_statement .= "WHERE ".join('AND ', @where_list); +# } +# } +# +# # extract update parameter from arg hash +# my $update_hash = @{ $arg->{update} }[0]; +# my $update_statement = ""; +# if( 0 < keys %{ $update_hash } ) { +# my @update_list; +# while( my ($rest_pram, $rest_val) = each %{ $update_hash } ) { +# my $statement = "$rest_pram='@{ $rest_val }[0]'"; +# push( @update_list, $statement ); +# } +# $update_statement .= join(', ', @update_list); +# } +# +# my $sql_statement = "UPDATE $table SET $update_statement $where_statement"; +# &create_lock($self,'update_dbentry'); +# my $db_answer = $self->{dbh}->do($sql_statement); +# &remove_lock($self,'update_dbentry'); +# return $db_answer; +#} sub update_dbentry { - my $self = shift; - my $arg = shift; - - - # check completeness of function parameter - # extract table statement from arg hash - my $table = $arg->{table}; - if (not defined $table) { - return 1; - } else { - delete $arg->{table}; - } - - # extract where parameter from arg hash - my $where_statement = ""; - if( exists $arg->{where} ) { - my $where_hash = @{ $arg->{where} }[0]; - if( 0 < keys %{ $where_hash } ) { - my @where_list; - while( my ($rest_pram, $rest_val) = each %{ $where_hash } ) { - my $statement; - if( $rest_pram eq 'timestamp' ) { - $statement = "$rest_pram<'@{ $rest_val }[0]'"; - } else { - $statement = "$rest_pram='@{ $rest_val }[0]'"; - } - push( @where_list, $statement ); - } - $where_statement .= "WHERE ".join('AND ', @where_list); - } - } - - # extract update parameter from arg hash - my $update_hash = @{ $arg->{update} }[0]; - my $update_statement = ""; - if( 0 < keys %{ $update_hash } ) { - my @update_list; - while( my ($rest_pram, $rest_val) = each %{ $update_hash } ) { - my $statement = "$rest_pram='@{ $rest_val }[0]'"; - push( @update_list, $statement ); - } - $update_statement .= join(', ', @update_list); - } - - my $sql_statement = "UPDATE $table SET $update_statement $where_statement"; - &create_lock($self,'update_dbentry'); - my $db_answer = $self->{dbh}->do($sql_statement); - &remove_lock($self,'update_dbentry'); + my ($self, $sql)= @_; + my $db_answer= &exec_statement($self, $sql); return $db_answer; -} +} sub del_dbentry { - my $self = shift; - my $arg = shift; - - - # check completeness of function parameter - # extract table statement from arg hash - my $table = $arg->{table}; - if (not defined $table) { - return 1; - } else { - delete $arg->{table}; - } - - # collect select statements - my @del_list; - while (my ($pram, $val) = each %{$arg}) { - if ( $pram eq 'timestamp' ) { - push(@del_list, "$pram < '$val'"); - } else { - push(@del_list, "$pram = '$val'"); - } - } - - my $where_statement; - if( not @del_list ) { - $where_statement = ""; - } else { - $where_statement = "WHERE ".join(' AND ', @del_list); - } - - my $sql_statement = "DELETE FROM $table $where_statement"; - &create_lock($self,'del_dbentry'); - my $db_res = $self->{dbh}->do($sql_statement); - &remove_lock($self,'del_dbentry'); + my ($self, $sql)= @_;; + my $db_res= &exec_statement($self, $sql); return $db_res; } @@ -284,55 +257,26 @@ sub get_table_columns { } -sub select_dbentry { - my $self = shift; - my $arg = shift; - - - # check completeness of function parameter - # extract table statement from arg hash - my $table = $arg->{table}; - if (not defined $table) { - return 1; - } else { - delete $arg->{table}; - } - - # collect select statements - my @select_list; - my $sql_statement; - while (my ($pram, $val) = each %{$arg}) { - if ( $pram eq 'timestamp' ) { - push(@select_list, "$pram < '$val'"); - } else { - push(@select_list, "$pram = '$val'"); - } - } - if (@select_list == 0) { - $sql_statement = "SELECT * FROM '$table'"; - } else { - $sql_statement = "SELECT * FROM '$table' WHERE ".join(' AND ', @select_list); - } +sub select_dbentry { + my ($self, $sql)= @_; - # query db - &create_lock($self,'select_dbentry'); - my $query_answer = $self->{dbh}->selectall_arrayref($sql_statement); - &remove_lock($self,'select_dbentry'); + my $db_answer= &exec_statement($self, $sql); # fetch column list of db and create a hash with column_name->column_value of the select query + $sql =~ /FROM ([\S]*?) /g; + my $table = $1; my $column_list = &get_table_columns($self, $table); my $list_len = @{ $column_list } ; my $answer = {}; my $hit_counter = 0; - - foreach my $hit ( @{ $query_answer }) { + foreach my $hit ( @{ $db_answer }) { $hit_counter++; for ( my $i = 0; $i < $list_len; $i++) { $answer->{ $hit_counter }->{ @{ $column_list }[$i] } = @{ $hit }[$i]; } } - + return $answer; } @@ -354,12 +298,15 @@ sub show_table { sub exec_statement { my $self = shift; my $sql_statement = shift; + &create_lock($self,'exec_statement'); - my @res = @{$self->{dbh}->selectall_arrayref($sql_statement)}; + my @db_answer = @{$self->{dbh}->selectall_arrayref($sql_statement)}; &remove_lock($self, 'exec_statement'); - return \@res; + + return \@db_answer; } + sub get_time { my ($seconds, $minutes, $hours, $monthday, $month, $year, $weekday, $yearday, $sommertime) = localtime(time); diff --git a/gosa-si/modules/GosaPackages.pm b/gosa-si/modules/GosaPackages.pm index 6872485d5..88b5b65e0 100644 --- a/gosa-si/modules/GosaPackages.pm +++ b/gosa-si/modules/GosaPackages.pm @@ -13,6 +13,15 @@ use Data::Dumper; use GOSA::DBsqlite; use MIME::Base64; +my $op_hash = { + 'eq' => '=', + 'ne' => '!=', + 'ge' => '>=', + 'gt' => '>', + 'le' => '<=', + 'lt' => '<', +}; + BEGIN{} END{} @@ -304,7 +313,7 @@ sub process_incoming_msg { } else { &main::daemon_log("ERROR: $header is not a valid GosaPackage-header, need a 'job_' or a 'gosa_' prefix"); } - + if (not defined $out_msg) { return; } @@ -321,6 +330,7 @@ sub process_incoming_msg { my $out_cipher = &create_ciphering($gosa_passwd); $out_msg = &encrypt_msg($out_msg, $out_cipher); + return $out_msg; } @@ -398,7 +408,7 @@ sub process_job_msg { } &main::daemon_log("GosaPackages: $header job successfully added to job queue", 3); - return "<1>$res"; + return "$res"; } @@ -433,24 +443,105 @@ sub db_res_2_xml { ## CORE FUNCTIONS ############################################################ +sub get_where_statement { + my ($msg, $msg_hash)= @_; + my $error= 0; + + my $clause_str= ""; + if( not exists @{$msg_hash->{'where'}}[0]->{'clause'} ) { $error++; }; + if( $error == 0 ) { + my @clause_l; + my @where = @{@{$msg_hash->{'where'}}[0]->{'clause'}}; + foreach my $clause (@where) { + my $connector = $clause->{'connector'}[0]; + if( not defined $connector ) { $connector = "AND"; } + $connector = uc($connector); + delete($clause->{'connector'}); + + my @phrase_l ; + foreach my $phrase (@{$clause->{'phrase'}}) { + my $operator = "="; + if( exists $phrase->{'operator'} ) { + my $op = $op_hash->{$phrase->{'operator'}[0]}; + if( not defined $op ) { + &main::daemon_log("Can not translate operator '$operator' in where ". + "statement to sql valid syntax. Please use 'eq', ". + "'ne', 'ge', 'gt', 'le', 'lt' in xml message\n", 1); + &main::daemon_log($msg, 8); + $op = "="; + } + $operator = $op; + delete($phrase->{'operator'}); + } + + my @xml_tags = keys %{$phrase}; + my $tag = $xml_tags[0]; + my $val = $phrase->{$tag}[0]; + push(@phrase_l, "$tag$operator'$val'"); + } + my $clause_str .= join(" $connector ", @phrase_l); + push(@clause_l, $clause_str); + } + + if( not 0 == @clause_l ) { + $clause_str = join(" AND ", @clause_l); + $clause_str = "WHERE $clause_str "; + } + } + + return $clause_str; +} + +sub get_select_statement { + my ($msg, $msg_hash)= @_; + my $select = "*"; + if( exists $msg_hash->{'select'} ) { + my $select_l = \@{$msg_hash->{'select'}}; + $select = join(' AND ', @{$select_l}); + } + return $select; +} + + +sub get_update_statement { + my ($msg, $msg_hash) = @_; + my $error= 0; + my $update_str= ""; + my @update_l; + + if( not exists $msg_hash->{'update'} ) { $error++; }; + + if( $error == 0 ) { + my $update= @{$msg_hash->{'update'}}[0]; + while( my ($tag, $val) = each %{$update} ) { + my $val= @{$update->{$tag}}[0]; + push(@update_l, "$tag='$val'"); + } + if( 0 == @update_l ) { $error++; }; + } + + if( $error == 0 ) { + $update_str= join(', ', @update_l); + $update_str= "SET $update_str "; + } + + return $update_str; +} + sub query_jobdb { my ($msg) = @_; my $msg_hash = &transform_msg2hash($msg); # prepare query sql statement - my @where = @{$msg_hash->{where}}; - my $where_hash = {table=>$main::job_queue_table_name }; - foreach my $where_pram (@where) { - my $where_val = @{$msg_hash->{$where_pram}}[0]; - if (defined $where_val) { - $where_hash->{$where_pram} = $where_val; - } - } - - # execute db query - my $res_hash = $main::job_db->select_dbentry($where_hash); + my $select= &get_select_statement($msg, $msg_hash); + my $table= $main::job_queue_table_name; + my $where= &get_where_statement($msg, $msg_hash); + my $sql_statement= "SELECT $select FROM $table $where"; + # execute db query + my $res_hash = $main::job_db->select_dbentry($sql_statement); my $out_xml = &db_res_2_xml($res_hash); + return $out_xml; } @@ -459,17 +550,12 @@ sub delete_jobdb_entry { my $msg_hash = &transform_msg2hash($msg); # prepare query sql statement - my @where = @{$msg_hash->{where}}; - my $where_hash = {table=>$main::job_queue_table_name }; - foreach my $where_pram (@where) { - my $where_val = @{$msg_hash->{$where_pram}}[0]; - if (defined $where_val) { - $where_hash->{$where_pram} = $where_val; - } - } + my $table= $main::job_queue_table_name; + my $where= &get_where_statement($msg, $msg_hash); + my $sql_statement = "DELETE FROM $table $where"; # execute db query - my $db_res = $main::job_db->del_dbentry($where_hash); + my $db_res = $main::job_db->del_dbentry($sql_statement); my $res; if( $db_res > 0 ) { @@ -484,95 +570,93 @@ sub delete_jobdb_entry { } + sub clear_jobdb { my ($msg) = @_ ; my $msg_hash = &transform_msg2hash($msg); + my $error= 0; + my $out_xml= "1"; + + my $table= $main::job_queue_table_name; - my $where_hash = {table=>$main::job_queue_table_name }; + my $sql_statement = "DELETE FROM $table"; + my $db_res = $main::job_db->del_dbentry($sql_statement); + if( not $db_res > 0 ) { $error++; }; - # execute db query - my $db_res = $main::job_db->del_dbentry($where_hash); - print STDERR "db_res=$db_res\n"; - my $res; - if( $db_res eq '0E0' ) { - $res = 0 ; - } else { - $res = 1; + if( $error == 0 ) { + $out_xml = "0"; } - - # prepare xml answer - my $out_xml = "$res"; + return $out_xml; } + sub update_status_jobdb_entry { my ($msg) = @_ ; my $msg_hash = &transform_msg2hash($msg); - - # prepare query sql statement - my $update_hash = {table=>$main::job_queue_table_name }; - if( exists $msg_hash->{where} ) { - $update_hash->{where} = $msg_hash->{where}; - } else { - $update_hash->{where} = []; - } - - if( not exists $msg_hash->{update}[0]->{status} ) { - return "1"; - } - $update_hash->{update} = [ { status=>$msg_hash->{update}[0]->{status} } ]; + my $error= 0; + my $out_xml= "1"; - # execute db query - my $db_res = $main::job_db->update_dbentry($update_hash); - - # transform db answer to error returnment - my $res; - if( $db_res > 0 ) { - $res = 0 ; - } else { - $res = 1; - } - - # prepare xml answer - my $out_xml = "$res"; - return $out_xml; -} - -sub update_timestamp_jobdb_entry { - my ($msg) = @_ ; - my $msg_hash = &transform_msg2hash($msg); + my @len_hash = keys %{$msg_hash}; + if( 0 == @len_hash) { $error++; }; # prepare query sql statement - my $update_hash = {table=>$main::job_queue_table_name }; - if( exists $msg_hash->{where} ) { - $update_hash->{where} = $msg_hash->{where}; - } else { - $update_hash->{where} = []; - } + if( $error == 0) { + my $table= $main::job_queue_table_name; + my $where= &get_where_statement($msg, $msg_hash); + my $update= &get_update_statement($msg, $msg_hash); - if( not exists $msg_hash->{update}[0]->{timestamp} ) { - return "1"; - } + my $sql_statement = "UPDATE $table $update $where"; - $update_hash->{update} = [ { timestamp=>$msg_hash->{update}[0]->{timestamp} } ]; + # execute db query + my $db_res = $main::job_db->update_dbentry($sql_statement); - # execute db query - my $db_res = $main::job_db->update_dbentry($update_hash); + # check success of db update + if( not $db_res > 0 ) { $error++; }; + } - # transform db answer to error returnment - my $res; - if( $db_res > 0 ) { - $res = 0 ; - } else { - $res = 1; + if( $error == 0) { + $out_xml = "0"; } - # prepare xml answer - my $out_xml = "$res"; return $out_xml; - } +#sub update_timestamp_jobdb_entry { +# my ($msg) = @_ ; +# my $msg_hash = &transform_msg2hash($msg); +# +# # prepare query sql statement +# my $update_hash = {table=>$main::job_queue_table_name }; +# if( exists $msg_hash->{where} ) { +# $update_hash->{where} = $msg_hash->{where}; +# } else { +# $update_hash->{where} = []; +# } +# +# if( not exists $msg_hash->{update}[0]->{timestamp} ) { +# return "1"; +# } +# +# $update_hash->{update} = [ { timestamp=>$msg_hash->{update}[0]->{timestamp} } ]; +# +# # execute db query +# my $db_res = $main::job_db->update_dbentry($update_hash); +# +# # transform db answer to error returnment +# my $res; +# if( $db_res > 0 ) { +# $res = 0 ; +# } else { +# $res = 1; +# } +# +# # prepare xml answer +# my $out_xml = "$res"; +# return $out_xml; +# +#} + 1; diff --git a/gosa-si/modules/GosaSupportDaemon.pm b/gosa-si/modules/GosaSupportDaemon.pm index cf26ca49f..62e2a3caa 100644 --- a/gosa-si/modules/GosaSupportDaemon.pm +++ b/gosa-si/modules/GosaSupportDaemon.pm @@ -60,20 +60,25 @@ sub transform_msg2hash { # xml tags without a content are created as an empty hash # substitute it with an empty list - while( my ($xml_tag, $xml_content) = each %{ $hash } ) { - if( 1 == @{ $xml_content } ) { - # there is only one element in xml_content list ... - my $element = @{ $xml_content }[0]; - if( ref($element) eq "HASH" ) { - # and this element is an hash ... - my $len_element = keys %{ $element }; - if( $len_element == 0 ) { - # and this hash is empty, then substitute the xml_content - # with an empty string in list - $hash->{$xml_tag} = [ "none" ]; + eval { + while( my ($xml_tag, $xml_content) = each %{ $hash } ) { + if( 1 == @{ $xml_content } ) { + # there is only one element in xml_content list ... + my $element = @{ $xml_content }[0]; + if( ref($element) eq "HASH" ) { + # and this element is an hash ... + my $len_element = keys %{ $element }; + if( $len_element == 0 ) { + # and this hash is empty, then substitute the xml_content + # with an empty string in list + $hash->{$xml_tag} = [ "none" ]; + } } } } + }; + if( $@ ) { + $hash = undef; } return $hash; diff --git a/gosa-si/modules/ServerPackages.pm b/gosa-si/modules/ServerPackages.pm index cb7c976f9..80ce0ada7 100644 --- a/gosa-si/modules/ServerPackages.pm +++ b/gosa-si/modules/ServerPackages.pm @@ -358,7 +358,9 @@ sub process_incoming_msg { # check wether incoming msg is from a known_server if( not defined $msg ) { - my $query_res = $main::known_server_db->select_dbentry( {table=>'known_server'} ); + #my $query_res = $main::known_server_db->select_dbentry( {table=>'known_server'} ); + my $sql_statement= "SELECT * FROM known_server"; + my $query_res = $main::known_server_db->select_dbentry( $sql_statement ); while( my ($hit_num, $hit) = each %{ $query_res } ) { $host_name = $hit->{hostname}; if( not $host_name =~ "^$host") { @@ -387,7 +389,9 @@ sub process_incoming_msg { # check wether incoming msg is from a known_client if( not defined $msg ) { - my $query_res = $main::known_clients_db->select_dbentry( {table=>'known_clients'} ); + #my $query_res = $main::known_clients_db->select_dbentry( {table=>'known_clients'} ); + my $sql_statement= "SELECT * FROM known_clients"; + my $query_res = $main::known_clients_db->select_dbentry( $sql_statement ); while( my ($hit_num, $hit) = each %{ $query_res } ) { $host_name = $hit->{hostname}; if( not $host_name =~ "^$host") { diff --git a/gosa-si/tests/client.php b/gosa-si/tests/client.php index a673db58c..f095d31a1 100755 --- a/gosa-si/tests/client.php +++ b/gosa-si/tests/client.php @@ -13,23 +13,23 @@ if($sock->connected()){ # add #$data = "
gosa_ping
10.89.1.155:2008210.89.1.155:20080
"; -# $data = "
job_ping
10.89.1.155:2008300:1B:77:04:8A:6C 19700101000000
"; -# $data = "
job_sayHello
10.89.1.155:2008300:1B:77:04:8A:6C 20130102133900
"; -# $data = "
job_ping
10.89.1.155:2008300:1B:77:04:8A:6C 20130102133900
"; +#$data = "
job_ping
10.89.1.155:2008300:1B:77:04:8A:6C 19700101000000
"; +#$data = "
job_sayHello
10.89.1.155:2008300:1B:77:04:8A:6C 20130102133900
"; +$data = "
job_ping
10.89.1.155:2008300:1B:77:04:8A:6C 20130102133900
"; # delete - #$data = "
gosa_delete_jobdb_entry
headertag sayHello
"; +#$data = "
gosa_delete_jobdb_entry
error
"; # update - #$data = "
gosa_update_status_jobdb_entry
waiting processing
"; - #$data = "
gosa_update_status_jobdb_entry
waiting
"; - #$data = "
gosa_update_timestamp_jobdb_entry
20130123456789
"; +#$data = "
gosa_update_status_jobdb_entry
waiting processing update
"; # query -$data = "
gosa_query_jobdb
statuserror
"; +#$data = "
gosa_query_jobdb
andgt2le4
"; +#$data= "
gosa_query_jobdb
waiting
"; + # clear - #$data = "
gosa_clear_jobdb
"; +#$data = "
gosa_clear_jobdb
"; $sock->write($data); $answer = "nothing"; -- 2.30.2