Community discussions

MikroTik App
 
User avatar
tete
newbie
Topic Author
Posts: 44
Joined: Mon Jul 07, 2008 9:50 am
Location: Granada (Spain)
Contact:

Proxylizer not working with WIKI configuration - NEW PROBLEM

Thu Nov 18, 2010 11:24 am

Hello,

That the case, I have a fresh Ubuntu 10.10 Server install and I have follow the Proxylizer Installation Method 1 as indicated in the WIKI.

Step by step I have all the components working but Proxylizer is not processing data, after some debug I can see the /home/proxylizer/mysql.pipe is working OK
cat /home/proxylizer/mysql.pipe
203.0.113.3 2010-11-18 10:02:57 192.168.133.160 GET http://m.facebook.com/  action=allow cache=MISS
203.0.113.3 2010-11-18 10:03:34 192.168.133.160 GET http://www.yahoo.com/  action=allow cache=MISS
203.0.113.3 2010-11-18 10:03:43 192.168.133.160 GET http://www.wikipedia.org/  action=allow cache=MISS
However in the file /var/log/proxylizer/webproxytodb_debug.log there is a error.
tail webproxytodb_debug.log 
2010-11-18 09:44 | Not valid web proxy log!!!
2010-11-18 09:44 | Not valid web proxy log!!!
2010-11-18 09:44 | Not valid web proxy log!!!
2010-11-18 09:44 | Not valid web proxy log!!!
I have been making some debug and I could find the error string in the file /var/www/proxylizer/webproxylogtomysql.php
if ($rawlog['3'] == 'web-proxy,account') {
                            $host = ip2long($rawlog['0']);
                            list(, $host) = unpack('l', pack('l', $host));
                            if ($host === false) echo date("Y-m-d H:i | ") .  "Invalid Host IP address";
                            $IP = eregIP($rawlog['4']);
                            if ($IP !== false) {
                                $IP = ip2long($rawlog['4']);
                                if ($IP !== false) {
                                    list(, $IP) = unpack('l', pack('l', $IP));
                                    parseURL($rawlog['6']);
                                    parseDomain($fulldomain);
                                    parseAction($rawlog['7']);
                                    parseCache($line);
                                    //echo "Action = {$action}\n";
                                    //echo "Cache = {$cache}\n";
                                    if(insertLine($db));
                                } else {
                                    echo date("Y-m-d H:i | ") . "Invalid IP address!!!\n";
                                }
                            } else {
                                echo date("Y-m-d H:i | ") . "Invalid IP address!!!\n";
                            }
                        } else {
                            echo date("Y-m-d H:i | ") . "Not valid web proxy log!!!\n";
                        }
I think it could be a possible bug due to new version of the Operating System packages. It is possible someone from Mikrotik to browse this problem?.

I can send you the VM image file and make the test you need.

Best regards
Last edited by tete on Fri Nov 19, 2010 12:40 pm, edited 2 times in total.
 
User avatar
tete
newbie
Topic Author
Posts: 44
Joined: Mon Jul 07, 2008 9:50 am
Location: Granada (Spain)
Contact:

Re: Proxylizer not working with WIKI configuration - SOLVED

Thu Nov 18, 2010 2:28 pm

I have solved this issue.

This is the solution if you are getting troubles with "Not valid web proxy log!!!"

After debug the code and see the mysql.pipe file the problem is that the last version of Syslog-NG don't project the string "web-proxy,account" to the pipe, so the $rawlog[] depending variables are bad setted.

The modifications were done in /var/www/proxylizer/webproxylogtomysql.php

Locate the line
if ($rawlog['3'] == 'web-proxy,account') {
Change it for
if ($rawlog['3'] != 'web-proxy,account') {
This modification changes the condition to enter the MySQL insert routine and avoid the Syslog-NG problem.

As $rawlog['3'] does not exists you have to change all the references to a ['n-1'], so you have to do the next modifications;
Locate the lines
$IP = eregIP($rawlog['4']);
$IP = ip2long($rawlog['4']);
parseURL($rawlog['6']);
parseAction($rawlog['7']);
Change it for
$IP = eregIP($rawlog['3']);
$IP = ip2long($rawlog['3']);
parseURL($rawlog['5']);
parseAction($rawlog['6']);
And that's all. I have it running.

Greetings
 
User avatar
tete
newbie
Topic Author
Posts: 44
Joined: Mon Jul 07, 2008 9:50 am
Location: Granada (Spain)
Contact:

Re: Proxylizer not working with WIKI configuration - NEW PRO

Fri Nov 19, 2010 12:42 pm

Ok.

After debug and repair the problems with the Syslog parsing there are more problem related to email delivery.

This is the log:
PHP Notice:  Undefined index: weekdays in /var/www/proxylizer/mail_send.php on line 118
PHP Notice:  Undefined variable: rec_limit_query in /var/www/proxylizer/mail_send.php on line 150
PHP Notice:  Undefined variable: datafilter in /var/www/proxylizer/functions.php on line 566
PHP Notice:  Undefined index: weekdays in /var/www/proxylizer/functions.php on line 579
PHP Notice:  Undefined variable: seconds in /var/www/proxylizer/functions.php on line 509
PHP Notice:  Undefined variable: seconds in /var/www/proxylizer/functions.php on line 509
PHP Notice:  Undefined variable: ipusername in /var/www/proxylizer/functions.php on line 324
PHP Notice:  Undefined variable: tbody in /var/www/proxylizer/functions.php on line 162
PHP Notice:  Undefined variable: datafilter in /var/www/proxylizer/functions.php on line 566
PHP Notice:  Undefined index: weekdays in /var/www/proxylizer/functions.php on line 579
PHP Notice:  Undefined variable: seconds in /var/www/proxylizer/functions.php on line 509
PHP Notice:  Undefined variable: seconds in /var/www/proxylizer/functions.php on line 509
PHP Notice:  Undefined variable: ipusername in /var/www/proxylizer/functions.php on line 324
PHP Notice:  Undefined variable: tbody in /var/www/proxylizer/functions.php on line 162
PHP Notice:  Undefined variable: tbody in /var/www/proxylizer/functions.php on line 162
PHP Notice:  Undefined variable: ipusername in /var/www/proxylizer/functions.php on line 324
PHP Notice:  Undefined variable: tbody in /var/www/proxylizer/functions.php on line 162
PHP Notice:  Undefined variable: ipusername in /var/www/proxylizer/functions.php on line 324
PHP Notice:  Undefined variable: tbody in /var/www/proxylizer/functions.php on line 162
PHP Notice:  Undefined variable: ipusername in /var/www/proxylizer/functions.php on line 324
PHP Notice:  Undefined variable: tbody in /var/www/proxylizer/functions.php on line 162
PHP Notice:  Undefined variable: ipusername in /var/www/proxylizer/functions.php on line 324
PHP Notice:  Undefined variable: tbody in /var/www/proxylizer/functions.php on line 162
PHP Notice:  Undefined index: week in /var/www/proxylizer/mail_send.php on line 323
PHP Notice:  Undefined index: ipname in /var/www/proxylizer/mail_send.php on line 328
PHP Notice:  Undefined variable: counter in /var/www/proxylizer/ufpdf/ufpdf_extended.php on line 24
PHP Notice:  Undefined variable: istolong in /var/www/proxylizer/functions.php on line 727
PHP Notice:  Undefined variable: counter in /var/www/proxylizer/ufpdf/ufpdf_extended.php on line 37
PHP Notice:  Undefined variable: istolong in /var/www/proxylizer/functions.php on line 727
PHP Notice:  Undefined variable: istolong in /var/www/proxylizer/functions.php on line 727
PHP Notice:  Undefined variable: istolong in /var/www/proxylizer/functions.php on line 727
PHP Notice:  Undefined variable: istolong in /var/www/proxylizer/functions.php on line 727
PHP Notice:  Undefined variable: istolong in /var/www/proxylizer/functions.php on line 727
PHP Notice:  Undefined variable: istolong in /var/www/proxylizer/functions.php on line 727
PHP Notice:  Undefined variable: istolong in /var/www/proxylizer/functions.php on line 727
PHP Notice:  Undefined variable: widths in /var/www/proxylizer/ufpdf/ufpdf.php on line 197
PHP Notice:  Undefined variable: s in /var/www/proxylizer/ufpdf/ufpdf.php on line 209
PHP Notice:  Uninitialized string offset: 2 in /var/www/proxylizer/ufpdf/ufpdf.php on line 308
PHP Notice:  Undefined index: ipname in /var/www/proxylizer/mail_send.php on line 356
It seems the includes are not aplying.

Some help?

Best Regards
 
User avatar
sergejs
MikroTik Support
MikroTik Support
Posts: 6697
Joined: Thu Mar 31, 2005 3:33 pm
Location: Riga, Latvia
Contact:

Re: Proxylizer not working with WIKI configuration - NEW PRO

Fri Nov 19, 2010 2:34 pm

Make detailed report about your problem and send it to support (support@mikrotik.com).
 
soulreaver1
just joined
Posts: 22
Joined: Tue May 11, 2010 12:19 pm
Location: Warsaw, Poland

Re: Proxylizer not working with WIKI configuration - SOLVED

Thu Mar 10, 2011 10:53 am

I have solved this issue.

This is the solution if you are getting troubles with "Not valid web proxy log!!!"

After debug the code and see the mysql.pipe file the problem is that the last version of Syslog-NG don't project the string "web-proxy,account" to the pipe, so the $rawlog[] depending variables are bad setted.

The modifications were done in /var/www/proxylizer/webproxylogtomysql.php

Locate the line
if ($rawlog['3'] == 'web-proxy,account') {
Change it for
if ($rawlog['3'] != 'web-proxy,account') {
This modification changes the condition to enter the MySQL insert routine and avoid the Syslog-NG problem.

As $rawlog['3'] does not exists you have to change all the references to a ['n-1'], so you have to do the next modifications;
Locate the lines
$IP = eregIP($rawlog['4']);
$IP = ip2long($rawlog['4']);
parseURL($rawlog['6']);
parseAction($rawlog['7']);
Change it for
$IP = eregIP($rawlog['3']);
$IP = ip2long($rawlog['3']);
parseURL($rawlog['5']);
parseAction($rawlog['6']);
And that's all. I have it running.

Greetings

Thanks, your input was the milestone with fixing issue on my Debian Squeeze.
 
fe4r
newbie
Posts: 34
Joined: Mon Feb 25, 2008 7:02 pm

Re: Proxylizer not working with WIKI configuration - NEW PRO

Wed Apr 13, 2011 11:47 pm

Hello,

What Mikrotik version is working with proxylizer?


Here, I didn't need to change the webproxylogtomysql.php, but in webproxytodb_debug.log shows that:
2011-04-13 19:18 | Invalid IP address!!!
2011-04-13 19:18 | Invalid IP address!!!
2011-04-13 19:18 | Invalid IP address!!!
2011-04-13 19:18 | Invalid IP address!!!

In mysql.pipe there are:
proxylizer:/var/www/proxylizer# cat /home/proxylizer/mysql.pipe
189.29.2.15 2011-04-13 19:21:27 192.168.11.252 GET http://profile.ak.fbcdn.net/hprofile-ak ... 8338_q.jpg action=allow cache=MISS

How can I fix this?
thanks.
 
cfarina
just joined
Posts: 3
Joined: Wed Aug 17, 2011 1:34 am

Re: Proxylizer not working with WIKI configuration - NEW PRO

Wed Aug 17, 2011 1:54 am

I got the same error, in my case I configured the mktk box to send a Prefix in every transaction to be logged into Proxylizer. It seems that proxylizer does not expects to receive that Prefix, instead of that expects an IP format "field".
The problem was fixed disabling the Prefix in the mktk System/Logging feature.
Specting this may give you some help, regards,
Manuk
(sorry about my basic english)
 
digicomtech
Frequent Visitor
Frequent Visitor
Posts: 77
Joined: Fri Apr 20, 2007 5:03 pm
Location: Alma, Qc, Canada
Contact:

Re: Proxylizer not working with WIKI configuration - NEW PRO

Thu Sep 01, 2011 5:17 pm

For the syslog-ng that cut the web-proxy, account string, you can simply add in syslog-ng.conf:
# MySQL
destination d_mysql {
pipe("/home/proxylizer/mysql.pipe"
template("$HOST $YEAR-$MONTH-$DAY $HOUR:$MIN:$SEC [b]web-proxy,account[/b] $MSG\n") template-escape(yes));
};
That's all !