summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 36479a9)
raw | patch | inline | side by side (parent: 36479a9)
author | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 19 Mar 2008 08:24:30 +0000 (08:24 +0000) | ||
committer | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 19 Mar 2008 08:24:30 +0000 (08:24 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9936 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/gosa-si-server | patch | blob | history | |
gosa-si/tests/log-parser.pl | patch | blob | history |
diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server
index 52bd3181ac179285f30cd9053391314c9c648871..54b36fd008caa71ac8bd7b334183b06eb135d873 100755 (executable)
--- a/gosa-si/gosa-si-server
+++ b/gosa-si/gosa-si-server
sub refresh_ldap_handle {
+ my ($session_id) = @_ ;
+ if (not defined $session_id) { $session_id = 0; }
+
my $mesg;
- daemon_log("DEBUG: Trying to create a connection to URI $ldap_uri", 5);
+ daemon_log("$session_id DEBUG: Trying to create a connection to URI '$ldap_uri'", 7);
# Get an ldap handle, if we don't have one
if( ! defined $ldap_handle ){
$ldap_handle = Net::LDAP->new( $ldap_uri );
}
# Still not defined?
if( ! defined $ldap_handle ) {
- daemon_log( "ch $$: Net::LDAP constructor failed: $!\n" );
+ daemon_log( "$session_id ERROR: ch $$: Net::LDAP constructor failed: $!\n" );
return 0;
}
if( 0 != $mesg->code ) {
undef( $ldap_handle ) if( 81 == $mesg->code );
- daemon_log( "ch $$: LDAP bind: error (". $mesg->code . ') - ' . $mesg->error . "\n", 1);
+ daemon_log( "$session_id ERROR: ch $$: LDAP bind: error (". $mesg->code . ') - ' . $mesg->error . "\n", 1);
return 0;
}
-
+ daemon_log("$session_id DEBUG: create a new connection to URI '$ldap_uri'", 7);
return 1;
}
index 59912a8bfca98225a73f1341d1b9b9499c7652e9..79885bbabd0be1f00f85893197f5d9f4137b15ac 100755 (executable)
use Getopt::Long;
my $log_file = "/var/log/gosa-si-server.log";
+my $within_log_session = 0;
my $session;
GetOptions("s|session=s" => \$session);
# Read lines
my $line;
while ($line = <FILE>){
- next if $line =~ /^\s/;
chomp($line);
my @line_list = split(" ", $line);
- next if not $line_list[4];
+ if (not $line_list[4]) {
+ if ($within_log_session) {
+ print "$line\n";
+ }
+ next;
+ }
if($line_list[4] eq $session) {
-
print "$line\n";
-
- }
+ $within_log_session = 1;
+
+ } else {
+ $within_log_session = 0;
+ }
}