* [Sysadmins] [script] какие тянут файлы с ftp
@ 2010-03-18 16:19 Michael Shigorin
0 siblings, 0 replies; only message in thread
From: Michael Shigorin @ 2010-03-18 16:19 UTC (permalink / raw)
To: sysadmins
[-- Attachment #1.1: Type: text/plain, Size: 505 bytes --]
Здравствуйте.
В аттаче совсем быстрый наколенный хак для выяснения,
какому именно файлу, отдаваемому vsftpd, соответствует
видимый в iftop -BP порт сервера, болтающийся в топе.
Сделано для снижения расходов времени на спорадическое
любопытство, _не_ учитывает httpd/rsync, но вдруг кому
сгодится в качестве полезной отправной точки.
Принимает один аргумент (порт), запускается из-под sudo.
--
---- WBR, Michael Shigorin <mike@altlinux.ru>
------ Linux.Kiev http://www.linux.kiev.ua/
[-- Attachment #1.2: portfile --]
[-- Type: text/plain, Size: 262 bytes --]
#!/bin/sh
[ $# = 1 ] || exit 1
PID="$(netstat -pan | fgrep ":$1 " | sed -n 's,^.*ESTABLISHED \([0-9]\+\).*$,\1,p')"
# vsftpd behaviour hardwired,
readlink /proc/$PID/fd/7
# or do like this:
#ls -l /proc/$PID/fd/* | fgrep /var/ftp | cut -f12- -d" "
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-03-18 16:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-18 16:19 [Sysadmins] [script] какие тянут файлы с ftp Michael Shigorin
ALT Linux sysadmins discussion
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/sysadmins/0 sysadmins/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 sysadmins sysadmins/ http://lore.altlinux.org/sysadmins \
sysadmins@lists.altlinux.org sysadmins@lists.altlinux.ru sysadmins@lists.altlinux.com
public-inbox-index sysadmins
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.sysadmins
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git