Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-admin-essentials
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
etersoft-admin-essentials
Commits
e6ef2474
Commit
e6ef2474
authored
Feb 16, 2020
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit new azbyka_stat files
parent
ee7c85ac
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
88 additions
and
0 deletions
+88
-0
make_fail2ban_stat.sh
web/azbyka_stat/make_fail2ban_stat.sh
+14
-0
make_nginx_azbyka-audio.sh
web/azbyka_stat/make_nginx_azbyka-audio.sh
+40
-0
make_nginx_azbyka-http.sh
web/azbyka_stat/make_nginx_azbyka-http.sh
+34
-0
No files found.
web/azbyka_stat/make_fail2ban_stat.sh
0 → 100755
View file @
e6ef2474
#!/bin/sh
NS
=
/var/local/nginx-stat/fail2ban_stat.txt
echo
"Fail2ban logs "
>
$NS
date
>>
$NS
TODAY
=
$(
date
"+%Y-%m-%d"
)
filter_today
()
{
grep
"^
$TODAY
"
}
cat
/var/log/fail2ban.log | filter_today |
grep
-E
"(Ban|Unban)"
>>
$NS
web/azbyka_stat/make_nginx_azbyka-audio.sh
0 → 100755
View file @
e6ef2474
#!/bin/sh
IN
=
"/var/log/nginx/azbyka_audio-access-redir*.log"
NS
=
/var/local/nginx-stat/nginx-azbyka-audio.txt
echo
"Stat for audio azbyka requests, generated by
$0
"
>
$NS
date
>>
$NS
format
()
{
xargs
printf
"%5d %-100s %s
\n
"
}
for
i
in
$IN
;
do
echo
>>
$NS
echo
>>
$NS
case
$(
basename
$i
)
in
azbyka_audio-access-redir1.log
)
N
=
A01
;;
azbyka_audio-access-redir2.log
)
N
=
Telros
;;
azbyka_audio-access-redir3.log
)
N
=
"A03 (znakomstva)"
;;
azbyka_audio-access-redir4.log
)
N
=
"A04 (audio)"
;;
azbyka_audio-access-redir5.log
)
N
=
"DE01 (etersoft)"
;;
*
)
N
=
Unknown
;;
esac
echo
"--
$N
$(
basename
$i
)
------------------------------------------------------"
>>
$NS
#cat $i |
tail
$i
-n3000
| perl
-p
-e
's|.*"GET (.*) HTTP.*|\1|g'
|
sort
|
uniq
-c
|
sort
-n
-r
|
head
-n
15 |
sed
-e
"s|/audio/audio1||g"
>>
$NS
echo
>>
$NS
tail
$i
-n3000
| perl
-p
-e
's|.*"GET (.*) HTTP.*|\1|g'
| xargs
-r
dirname
|
sort
|
uniq
-c
|
sort
-n
-r
|
head
-n
15 |
sed
-e
"s|/audio/audio1||g"
>>
$NS
echo
>>
$NS
tail
$i
-n3000
| perl
-p
-e
's|.*"GET (.*) HTTP.*|\1|g'
| xargs
-r
dirname
| xargs
-r
dirname
|
sort
|
uniq
-c
|
sort
-n
-r
|
head
-n
15 |
sed
-e
"s|/audio/audio1||g"
>>
$NS
done
web/azbyka_stat/make_nginx_azbyka-http.sh
0 → 100755
View file @
e6ef2474
#!/bin/sh
NS
=
/var/local/nginx-stat/nginx-azbyka-http.txt
echo
"Stat for azbyka http requests, generated by
$0
"
>
$NS
date
>>
$NS
format
()
{
xargs
printf
"%5d %-100s %s
\n
"
}
echo
>>
$NS
echo
'--------------------------------------------------------'
>>
$NS
HA
=
/var/log/nginx/azbyka.ru-http-access.log
echo
"requests from azbyka.ru pages"
>>
$NS
echo
"(stats by last 3000 lines)"
>>
$NS
echo
"0 from to"
| format
>>
$NS
tail
$HA
-n3000
|
grep
-E
'from "https?://azbyka.ru'
| perl
-p
-e
's|.*"GET (.*) HTTP.* from "(http.*?)".*|\2 http://azbyka.ru\1|g'
|
sort
|
uniq
-c
|
sort
-n
-r
| format
>>
$NS
echo
>>
$NS
echo
'--------------------------------------------------------'
>>
$NS
echo
"requests from other pages"
>>
$NS
echo
"(stats by last 3000 lines)"
>>
$NS
echo
"0 from to"
| format
>>
$NS
tail
$HA
-n3000
|
grep
-v
'from "-"'
|
grep
-E
-v
'from "https?://azbyka.ru'
| perl
-p
-e
's|.*"GET (.*) HTTP.* from "(http.*?)".*|\2 http://azbyka.ru\1|g'
|
sort
|
uniq
-c
|
sort
-n
-r
| format
>>
$NS
echo
>>
$NS
echo
'--------------------------------------------------------'
>>
$NS
for
i
in
/var/log/nginx/azbyka.ru-http-access.log
;
do
[
-s
"
$i
"
]
||
continue
echo
echo
"
$i
(last 1000 lines)"
tail
"
$i
"
-n1000
done
>>
$NS
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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