Russell-IO / php-syslog-ng

Automatically exported from code.google.com/p/php-syslog-ng
1 stars 0 forks source link

dbgen.pl works and insert data but db_insert.pl insert nothing ... #164

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi, I have succeed to install php-syslog-ng 2.9.9.n and to insert fake data
with dbgen.pl but, after configure syslog-ng.conf, db_insert.pl log nothing
in the database ...

If I open the log file, I have only this type of log message :
Starting /var/log/logzilla/db_insert.log for
/var/www/html/logzilla/scripts/db_insert.pl at pid 24131
Using Database: syslog

I have try to upgrade my version to 2.9.9 o but, the problem is the same.
In /var/log/messages, I have a lot of mark line and sometimes Broken pipe
error : 

Dec  9 11:54:31 DB-1 syslog-ng[12275]: I/O error occurred while writing;
fd='5', error='Broken pipe (32)'
Dec  9 11:54:31 DB-1 syslog-ng[12275]: Suspending write operation because
of an I/O error; fd='5', time_reopen='60'
Dec  9 10:55:35 DB-1 -- MARK --
Dec  9 10:59:49 DB-1 -- MARK --
Dec  9 11:01:50 DB-1 -- MARK --
Dec  9 11:03:56 DB-1 -- MARK --
Dec  9 11:05:17 DB-1 -- MARK --
Dec  9 11:12:03 DB-1 -- MARK --
Dec  9 11:14:30 DB-1 -- MARK --
Dec  9 11:15:35 DB-1 -- MARK --
Dec  9 11:19:49 DB-1 -- MARK --
Dec  9 11:21:50 DB-1 -- MARK --
Dec  9 11:23:56 DB-1 -- MARK --
Dec  9 11:25:17 DB-1 -- MARK --
Dec  9 11:32:03 DB-1 -- MARK --
Dec  9 11:34:30 DB-1 -- MARK --
Dec  9 11:35:35 DB-1 -- MARK --
Dec  9 11:39:49 DB-1 -- MARK --
Dec  9 11:41:50 DB-1 -- MARK --
Dec  9 11:43:56 DB-1 -- MARK --
Dec  9 11:45:17 DB-1 -- MARK --
Dec  9 11:52:03 DB-1 -- MARK --
Dec  9 11:54:30 DB-1 -- MARK --
Dec  9 11:55:35 DB-1 -- MARK --
Dec  9 11:59:49 DB-1 -- MARK --
Dec  9 12:01:50 DB-1 -- MARK --
Dec  9 12:03:56 DB-1 -- MARK --
Dec  9 12:05:17 DB-1 -- MARK --
Dec  9 12:12:03 DB-1 -- MARK --
Dec  9 12:14:30 DB-1 -- MARK --
Dec  9 12:15:35 DB-1 -- MARK --
Dec  9 12:19:49 DB-1 -- MARK --
Dec  9 12:21:50 DB-1 -- MARK --
Dec  9 12:23:56 DB-1 -- MARK --
Dec  9 12:25:17 DB-1 -- MARK --
Dec  9 12:32:03 DB-1 -- MARK --
Dec  9 12:34:30 DB-1 -- MARK --
Dec  9 12:35:35 DB-1 -- MARK --
Dec  9 12:39:49 DB-1 -- MARK --
Dec  9 12:41:50 DB-1 -- MARK --
Dec  9 12:43:56 DB-1 -- MARK --
Dec  9 12:45:17 DB-1 -- MARK --
Dec  9 12:52:03 DB-1 -- MARK --
Dec  9 12:54:30 DB-1 -- MARK --
Dec  9 12:55:35 DB-1 -- MARK --
Dec  9 12:59:49 DB-1 -- MARK --
Dec  9 13:01:50 DB-1 -- MARK --
Dec  9 13:03:56 DB-1 -- MARK --
Dec  9 13:05:17 DB-1 -- MARK --
Dec  9 13:12:03 DB-1 -- MARK --
Dec  9 13:14:30 DB-1 -- MARK --
Dec  9 13:15:35 DB-1 -- MARK --
Dec  9 13:19:49 DB-1 -- MARK --
Dec  9 13:21:50 DB-1 -- MARK --
Dec  9 13:23:56 DB-1 -- MARK --
Dec  9 13:25:17 DB-1 -- MARK --

I have verify and I have the package :
perl-DBI and perl-DBD-mysql

I have place in joint file my file "syslog-ng.conf"

I appreciate some help.
Thanks a lot.

Original issue reported on code.google.com by ecolpa...@gmail.com on 9 Dec 2009 at 1:39

Attachments:

GoogleCodeExporter commented 9 years ago
Two things:
1. Your syslog-ng.conf has two definitions for sources - try removing the 
"remote"
definition and opening udp in the source "s_sys"
2. Turn debug on in your logzilla config.php and restart syslog-ng

Original comment by cdu...@gmail.com on 23 Dec 2009 at 2:21

GoogleCodeExporter commented 9 years ago
try to change next line in config.php
define('DBHOST', 'localhost'); -> define('DBHOST', '127.0.0.1');

Original comment by dejancug...@gmail.com on 21 Jan 2010 at 12:20

GoogleCodeExporter commented 9 years ago
Nothing change, I have always "broken pipe error."
Moreover, this is not a problem of database connection, because connection via
database works fine, just insert_pl not insert data, when, it is called by
syslog-ng.conf, despite the fact that, insert_pl insert correctly data, when I 
called
it in command line.

Precision : syslog-ng is installed on a redhat 5.

Thanks for your help.

Original comment by ecolpa...@gmail.com on 22 Jan 2010 at 3:38

GoogleCodeExporter commented 9 years ago
If you're using syslog-ng v3.x, you need to change db_insert.pl to point 
sirectly to
the socket. I don't know why this is happening, but it seems to be a syslog-ng 
3.x
problem?
Here's more information:
http://code.google.com/p/php-syslog-ng/issues/detail?id=151&q=connect%20to%20mys
ql

Original comment by cdu...@gmail.com on 22 Jan 2010 at 3:45

GoogleCodeExporter commented 9 years ago
I'm using this version :
rpm -q syslog-ng
=> syslog-ng-2.1.4-1.el5

Original comment by ecolpa...@gmail.com on 22 Jan 2010 at 3:51

GoogleCodeExporter commented 9 years ago
Here are a few things to try:
1. Enable DEBUG in your config.php
2. stop syslog-ng
3. ps -ef | grep syslog and make sure no processes are running for
syslog-ng or db_insert
4. start syslog-ng
5. run scripts/db_insert.pl -s to generate a self test
6. check the contents of /var/log/logzilla/db_insert.log

Original comment by cdu...@gmail.com on 22 Jan 2010 at 4:08

GoogleCodeExporter commented 9 years ago
1. Enable DEBUG in your config.php
=> already done

2. stop syslog-ng
=> done

3. ps -ef | grep syslog and make sure no processes are running for
syslog-ng or db_insert
=> return nothing concerned syslog-ng, but I keep syslog alive on server, in 
case of
... : 
ps -ef | grep syslog
    root      2626     1  0 Jan22 ?        00:00:02 syslogd -m 0

    root     31900 31798  0 09:56 pts/1    00:00:00 grep syslog

4. start syslog-ng
=> done

5. run scripts/db_insert.pl -s to generate a self test
=> done : 
perl db_insert.pl 
Debug level: 1
Table: logs
Adminuser: syslogadmin
PW: admin
DB: syslog
DB Host: localhost
DB Port: 3306
Squeeze Feature = FALSE
Logging results to /var/log/logzilla/db_insert.log

6. check the contents of /var/log/logzilla/db_insert.log
I made a mistake, in my bug declaration, this is db-gen script (perl
logzilla/scripts/contrib/dbgen/dbgen.pl) which works correctly but not 
db_insert.pl :S
Anyway => cat /var/log/logzilla/db_insert.log
return nothing ... :S

Original comment by ecolpa...@gmail.com on 25 Jan 2010 at 9:41

GoogleCodeExporter commented 9 years ago
That's odd, db_insert.pl should be showing something like this:

PERFORMING SELF TEST USING COMMAND:
./db_insert.pl -d 1 -v 

2010-01-25 09:49:25
Starting /var/log/logzilla/db_insert.log for /www/logzilla/scripts/db_insert.pl 
at
pid 10432
Using Database: syslog
Debug level: 1
Table: logs
Adminuser: syslogadmin
PW: syslogadmin
DB: syslog
DB Host: localhost
DB Port: 3306
Squeeze Feature = TRUE
Logging results to /var/log/logzilla/db_insert.log
Printing results to screen (STDOUT)
Waiting for child on PID 10433 to exit...

INCOMING MESSAGE:
host    local7  err     err     test    2010-01-25      09:49:24        
DB_INSERT
Test  12345: %SYS-5-CONFIG_I: Configured from 172.16.0.123 by Fred Flinstone

HOST: host
FAC: local7
PRI: err
LVL: err
TAG: test
DAT: 2010-01-25
TME: 09:49:25
PRG: DB_INSERT Test
SEQ: 12345
MSG: %SYS-5-CONFIG_I: Configured from 172.16.0.123 by Fred Flinstone

Starting insert: 09:49:25
Ending insert: 09:49:25
Total processing time was 0 wallclock secs ( 0.00 usr  0.01 sys +  0.04 cusr  
0.05
csys =  0.10 CPU) seconds

SELF TEST COMPLETE!

Also note: dbgen.pl is no longer used, you should use logreplay instead.

Original comment by cdu...@gmail.com on 25 Jan 2010 at 2:54

GoogleCodeExporter commented 9 years ago
I try to reinstall, logzilla_v2.9.9o.tgz, because, I don't remember, all the
installation, I tried to install it a long time ago.

1- I have a problem with ./fixpath.sh file, and now, I remember to have the same
problem during my first installation : 

Indeed my install path directory is /var/www/html/logzilla/ ... and not
/var/www/logzilla, in due of that, the regex of replace included in 
./fixpath.sh, is
not correct with my environment : 

[root@servername scripts]# ./fixpaths.sh
Updating all files with a base path of /var/www/logzilla
Modifying ../scripts/contrib/system_configs/crontab
Modifying ../scripts/contrib/system_configs/syslog-ng.conf
Modifying ../scripts/contrib/system_configs/logzilla.apache
Modifying ../scripts/contrib/dbgen/dbgen.pl
Modifying ../scripts/contrib/loggen/find_missing_sequences.pl
Modifying ../scripts/db_insert.pl
Modifying ../scripts/lpdcache.php
Modifying ../scripts/resetusers.sh
Modifying ../scripts/reloadcache.php
Modifying ../scripts/logrotate.php

perl db_insert.pl 
Can't open config file "/var/www/logzilla/html/config/config.php" : No such 
file or
directory
Try db_insert.pl -h

So I must to modify ./fixpath.sh to continue.

I modify it, I execute it, on a clean install, and i verify paths in files. The 
paths
are fine. 

2- After, I try to call again db_insert.pl, (without, call dbgen.pl or logreplay
before), and now : the shell not give me the hand back ... nothing happened, 
just, I
can't have a return back. Argh.

Original comment by ecolpa...@gmail.com on 25 Jan 2010 at 4:55

GoogleCodeExporter commented 9 years ago
Please email me provate at cdukes @ cdukes.com and I'll set up a screen sharing
session to help you.

Original comment by cdu...@gmail.com on 25 Jan 2010 at 5:02

GoogleCodeExporter commented 9 years ago
Is there an install.pl included on version 2.9.9o? If so, you don't need to run
fixpaths.sh (I can't rmember since I've been working on v3.0 for so long now).

Original comment by cdu...@gmail.com on 27 Jan 2010 at 7:20