Information: Forum is in read-only mode
For details and other support options see https://www.adiscon.com/news/support-forum-set-to-read-only-mode/

Problems connecting to MSSQL

Everything which is related to the installation of phpLogCon.

Moderator: alorbach

Google Ads


Problems connecting to MSSQL

Postby fdacke » Thu Jul 15, 2010 12:21 pm

Hi!

I have problems getting LogAnalyzer to read from the database. The backend is Ubuntu 10.04, running syslog-ng which sends the data to a MSSQL Database. For frontend I installed Loganalyzer on Ubuntu and have been trying to configure that to speak to the MSSQL Database.

First off I had to enable the database connection for LogAnalyzer. It complained about driver problems and I found that it was hardcoded with the standard Windows {SQL Server}-driver for ODBC. To get it working you had to "sudo apt-get install libdbd-freetdsphp5-sybase tdsodbc", create a /etc/odbcinst.ini with:
Code: Select all
[FreeTDS]
Description = FreeTDS Driver
Driver = /usr/lib/odbc/libtdsodbc.so
Setup = /usr/lib/odbc/libtdsS.so
FileUsage = 1
CPTimeout = 5
CPReuse = 5

And then you had to modify the file /var/www/loganalyzer/classes/logstreamconfigpdo.class.php on line ~100 changing {SQL Server} to FreeTDS.


That solved, I have created tables in my database according to the MonitorWare format at http://www.mwagent.com/step-by-step-gui ... formats-2/. When the table is empty, Loganalyzer reports "No syslog-logs found" correctly. When I populate the table, the index.php-page just goes blank. Nothing shows.

I tried creating another table with the "php-syslog-ng"-format. Same thing, it says "No syslog-logs found" and then goes blank when the table is populated.

I've used Wireshark to look at the packets going to the Databaseserver and the connection appears to be correct and the SELECT properly answered.

Why does the page go blank?
Where are the logs for LogAnalyzer?
What are the table definitions that LogAnalyzer are working with? The "php-syslog-ng"-format doesn't seem to be a standard...

Relevant config:
Code: Select all
$CFG['Sources']['Source1']['ID'] = 'Source1';
$CFG['Sources']['Source1']['Name'] = 'Database';
$CFG['Sources']['Source1']['ViewID'] = 'SYSLOG';
$CFG['Sources']['Source1']['SourceType'] = SOURCE_PDO;
$CFG['Sources']['Source1']['DBTableType'] = 'syslogng';
$CFG['Sources']['Source1']['DBType'] = DB_MSSQL;
$CFG['Sources']['Source1']['DBServer'] = '10.1.25.4';
$CFG['Sources']['Source1']['DBName'] = 'DBsyslogng';
$CFG['Sources']['Source1']['DBUser'] = 'LURWsyslogng';
$CFG['Sources']['Source1']['DBPassword'] = 'PASSWORD';
$CFG['Sources']['Source1']['DBTableName'] = 'logs';
$CFG['Sources']['Source1']['DBEnableRowCounting'] = false;


I've also tried setting up rsyslog but I can't get the database connection to work.

Thanks in advance!
Fredrik
fdacke
New
 
Posts: 2
Joined: Thu Jul 15, 2010 11:46 am

Urgent Question?

  • Pulling out your Hair?
  • Wasting Time and Money?
  • Deadline Approaching?

Re: Problems connecting to MSSQL

Postby Burn » Fri Jul 16, 2010 12:35 am

I think you should check your webserver logs
Burn
Frequent Poster
 
Posts: 60
Joined: Wed Jan 20, 2010 7:15 am

Re: Problems connecting to MSSQL

Postby fdacke » Mon Jul 19, 2010 7:28 am

I found /var/log/apache2/error.log and /var/log/apache2/access.log. The relevant log-notices was when I connected to http://server-ip/loganalyzer/index.php and it showed the empty page described above.

The interesting part is defenetly the "Segmentation fault". Where can I get more information on that? Are there more log-files than these?

Code: Select all
[Mon Jul 19 09:05:46 2010] [error] [client 192.168.12.104] File does not exist: /var/www/favicon.ico
[Mon Jul 19 09:05:47 2010] [notice] child pid 30262 exit signal Segmentation fault (11)
[Mon Jul 19 09:05:49 2010] [error] [client 192.168.12.104] File does not exist: /var/www/favicon.ico


Code: Select all
192.168.12.104 - - [19/Jul/2010:09:05:46 +0200] "GET /favicon.ico HTTP/1.1" 404 502 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.1; sv-SE; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5"
192.168.12.104 - - [19/Jul/2010:09:05:49 +0200] "GET /favicon.ico HTTP/1.1" 404 501 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.1; sv-SE; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5"


Thanks for your help!
fdacke
New
 
Posts: 2
Joined: Thu Jul 15, 2010 11:46 am

Re: Problems connecting to MSSQL

Postby alorbach » Fri Jul 30, 2010 8:39 am

The Apache-subprocess is failing. This is proberly a bug in the MSSQL Driver component you are using.
Not much we can do from loganalyzer point of view.

best regards,
Andre Lorbach
alorbach
Site Admin
 
Posts: 1627
Joined: Thu Feb 13, 2003 11:55 am

Re: Problems connecting to MSSQL

Postby JohnCoffe » Mon Oct 17, 2011 2:29 pm

Are there any new drivers for MS Sql works? :?:
JohnCoffe
New
 
Posts: 5
Joined: Fri Oct 14, 2011 9:30 am

Re: Problems connecting to MSSQL

Postby alorbach » Mon Oct 17, 2011 4:16 pm

I am sure there is a new version included in Ubuntu 11, have you considered a dist-upgrade to Ubuntu 11?

best regards,
Andre Lorbach
alorbach
Site Admin
 
Posts: 1627
Joined: Thu Feb 13, 2003 11:55 am

Re: Problems connecting to MSSQL

Postby JohnCoffe » Tue Oct 18, 2011 7:20 am

Hi,

I'm on debian 6.0, I use the drivers in freetds.org (version 0.91) and LogAnalyzer-3.2.1.

I reach the same result as "fdacke" :|
JohnCoffe
New
 
Posts: 5
Joined: Fri Oct 14, 2011 9:30 am

Re: Problems connecting to MSSQL

Postby SMiTTY » Wed Jan 25, 2012 9:26 pm

So I ran into this last night as well...Getting rsyslog to inject into MS SQL was a no brainer.

No matter what I did trying to configure the 'Source' it just wouldn't take.

After a while I opted to hard-code the following in classes/logstreampdo.class.php

$this->_dbhandle = new PDO ("dblib:host=10.xx.x.xxx:14332;dbname=SyslogDB","user","pass");

This is fine and dandy unless you want to add multiple sources (ie : multiple tables). I never could get the FreeTDS/odbc working. Though it works fine from command line with tsql or isql. Hope they fix it going forward.

I'd rather do MySQL and still may (that just works). But my boss asked me to see if I can access the MS SQL cluster and put it all there.
I'm on Ubuntu 11.10 server BTW
SMiTTY
New
 
Posts: 6
Joined: Wed Jan 25, 2012 8:59 pm

Google Ads



Return to Installation

Who is online

Users browsing this forum: No registered users and 0 guests

cron