我应该执行什么命令来完成此任务:

我应该执行什么命令来完成此任务:
Open connections: 
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME 
php 3075 lemorpa 3u IPv4 1111738938 0t0 TCP 174.120.62.130:60602->98.139.169.19:80 (ESTABLISHED) 

Recent Site Requests: 

    1.202.218.68 *.mortgagenewshomeloans.com /a/a/Investment/p/p/Loans/Mortgage/News/Home/Loans/szh/home 
    1.202.218.73 onlinemortgagemoiywi.lendersmor /tag/county/ 
    1.202.219.3 *.mortgagenewshomeloans.com /Investments/Mortgage/News/Home/Loans/szh/Business-English- 
    1.202.219.3 *.mortgagenewshomeloans.com /o/w/w/Mortgage/News/Home/Loans/Forex/szh/1 
    1.202.219.5 *.morgagemortgagebanker.com /Loan/szh/selectcity/yellowpages/ 
    1.202.219.5 *.morgagemortgagebanker.com /Loan/szh/selectcity/yellowpages/ 
    1.202.219.6 ratesmortgagemoroito.lendersmor /Contract/Contract_List.asp 
    1.202.219.6 ratesmortgagemoroito.lendersmor /s/a/Rates/Rates/Mortgage/Mortgage/1st/szh/1 

当 Hostgator 对我的 CPU 使用率感到愤怒时,他们经常向我发送此信息。我想知道他们用什么命令来显示这个

答案1

第一行是命令的摘录lsof。也许是一个

其他行可能是从日志中收集的,但我不确定。

答案2

lsof第一个是显示开放网络连接的单个 PID的输出:

lsof -p 3075 -a -i TCP

第二个是来自网络服务器日志的额外内容,其形式如下:

client-ip vhost-name URI-path

CustomLog您可以使用and/or让 Apache 直接以该格式登录LogFormat

LogFormat "%a %v %U"

尽管它几乎肯定是grep | awk更全面的日志格式(或等效格式)。

相关内容