V
V
Vitaly Abrosimov2015-12-23 17:17:53
linux
Vitaly Abrosimov, 2015-12-23 17:17:53

ODBC in 3proxy and a web snout for analyzing logs? how to implement under linux?

The question of such a plan.
There are several proxy servers that live on 3proxy.
I would very much like to make a normal log analyzer, and with online access (so that the bosses of subordinates can watch a case).
Has anyone used ODBC in 3proxy (under linux) and does anyone have a ready-made web-muzzle for viewing statistics from the podtgreSQL / mySQL database filled using ODBC?
I will accept any tips on setting up this miracle.

I'm adding information.
1) compiled and installed 3proxy with the ability to write logs using ODBC enabled.
2) installed UnixODBC, PostgreSQL, psqlODBC.
3) configured the ini file in ODBC, checked the connection via isql "base name" - it works
[proxy]
Description = PostgreSQL connection to 3proxy
Driver = PSQL
Database = proxy
Servername = 127.0.0.1
UserName = postgres
Port = 5432
ReadOnly = No
RowVersioning = No
ShowSystemTables = No
ConnSettings =

4) added a line for logs in the config file:
log &proxy
logformat "Insert into log ("time", bytesin, bytesout, username, url, host, port, service) values ​​('%Y-%m-%d %H:%M:%S'::timestamp without time zone, %I, %I, '%T', '%T', '%T', %I, %I);"

checked this query in the database - it works, executed this query through isql - it works
But 3proxy itself does not write anything to the database, for that it saves a file called &proxy to the root directory and writes a log there in the request format, and in the place of variables - real data.
where is the joint? (

Answer the question

In order to leave comments, you need to log in

3 answer(s)
W
wetalya92, 2016-06-05
@wetalya92

idea-vopros.ru/index.php/3/lightsquid-3proxy
here is the man in the subject

V
Vladimir Dubrovin, 2015-12-24
@z3apa3a

Alternatively, you can use any squid log analyzer, for example, by setting a compatible logging format in 3proxy: 3proxy.ru/howtor.asp#LOGANALIZERS

V
Vitaly Abrosimov, 2016-01-18
@Wetalya

rearranged everything anew, ODBC earned! it remains to close up the web face :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question