Gossamer Forum
Home : Products : DBMan : Customization :

Log issue

Quote Reply
Log issue
Hi !


I have now already for 3 months running dbman database and now I have noticed that in default.log there is missing from where (IP address) the users connect. Line looks like this:

"guest logged on at 11:12:07 on 27-Aug-2002 from"

Can someone help me ?
Quote Reply
Re: [atomant] Log issue In reply to
From my own experience I have noticed that not all logs do contain the host address. It could be due to a firewall or something. Are you having the problem with all records or just a few here and there?

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Log issue In reply to
It is the problem with all records.

Any idea?
Quote Reply
Re: [atomant] Log issue In reply to
Try using this fix that I use for several servers, including Hypermart which doesn't use remote host command.

----

Hypermart fix for auth.pl file.

It seems that Hypermart servers does not use the remote host command as needed by DBMan. This solution will let you log remote hosts:

In auth.pl file make the following changes:

Add the sub GetHost to your auth.pl file. In sub auth_logging,

After: my ($date) = &get_date(time);

which may have to be replaced with:

my ($date) = &get_date(time()); # in get_time and get_date.

Add:

my($host) = &GetHost; #### change for Hypermart servers

and then change:

print LOG "$uid $action at $time on $date from $ENV{'REMOTE_HOST'}\n";

To:

print LOG "$uid $action at $time on $date from $host\n";

Then add this sub at the end of your auth.pl file before the 1; line.

sub GetHost {
#----------------------------
if (($ENV{'REMOTE_HOST'} eq $ENV{'REMOTE_ADDR'}) && ($ENV{'REMOTE_ADDR'} =~/(\d+)\.(\d+)\.(\d+)\.(\d+)/)) {
$ip = pack('C4', $1, $2, $3, $4);
$DNS_Address = (gethostbyaddr($ip, 2))[0];
$ENV{'REMOTE_HOST'} = $DNS_Address if $DNS_Address; }
$ENV{'REMOTE_HOST'} =~ tr/[A-Z]/[a-z]/;
$hostname = gethostbyaddr pack ( 'C4' , split /\./, $ENV {REMOTE_ADDR} ) ,2;
}

Hope this helps

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Log issue In reply to
thanx, that works.