Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
Open sidebar
Helmo
ISPConfig 3
Commits
4188c227
Commit
4188c227
authored
May 23, 2018
by
Marius Burkard
Browse files
- backported some more code from old vlogger
parent
5b051c99
Changes
1
Hide whitespace changes
Inline
Side-by-side
server/scripts/vlogger
View file @
4188c227
...
...
@@ -33,7 +33,7 @@
#
1.4
p2
implemented
anonymization
in
error
log
part
#
1.4
p3
implemented
stronger
anonymization
#
1.4
p4
implemented
re
-
opening
on
externally
rotated
error
.
log
#
1.4
p5
backported
old
ISPConfig
changes
(
improved
DBI
error
handling
)
#
1.4
p5
backported
old
ISPConfig
changes
(
improved
DBI
error
handling
,
naming
)
#
#
#
TODO
:
...
...
@@ -566,21 +566,21 @@ sub dump_tracker {
my $dbh = DBI->connect( $DBI_DSN, $DBI_USER, $DBI_PASS )
or warn "
DBI
Error
:
$
!";
foreach
my
$
key
(
keys
(%
tracker
)
)
{
my
$
ts
=
time2str
(
"%
m%d%Y
"
,
time
()
);
my
$
ts
=
time2str
(
"%
Y-%m-%d
"
,
time
()
);
my
$
sth
=
$
dbh
->
prepare
(
"select * from w
wwusage
where
v
host='"
.
$
key
.
"' and
l
date='"
.
$
ts
.
"'"
);
$
dbh
->
prepare
(
"select * from w
eb_traffic
where host
name
='"
.
$
key
.
"' and
traffic_
date='"
.
$
ts
.
"'"
);
$
sth
->
execute
;
if
(
$
sth
->
rows
)
{
my
$
query
=
"update w
wwusage set bytes=
bytes+"
"update w
eb_traffic set traffic_bytes=traffic_
bytes+"
.
$
tracker
{$
key
}
.
" where
v
host='"
.
$
key
.
"' and
l
date='"
.
$
ts
.
"'"
;
.
" where host
name
='"
.
$
key
.
"' and
traffic_
date='"
.
$
ts
.
"'"
;
$
dbh
->
do
($
query
);
}
else
{
my
$
query
=
"insert into w
wwusage
(
v
host
, ldate,
bytes) values ('$key', '$ts', '$tracker{$key}')"
;
my
$
query
=
"insert into w
eb_traffic
(host
name, traffic_date, traffic_
bytes) values ('$key', '$ts', '$tracker{$key}')"
;
$
dbh
->
do
($
query
);
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment