【问题标题】:Is there a way via echo shell_exec to show in out ethernet connections from the server?有没有办法通过 echo shell_exec 显示来自服务器的以太网连接?
【发布时间】:2017-05-21 20:00:16
【问题描述】:

在我的 linux 服务器中,当我在终端中输入“iftop”时,它会进入一个显示网络流量的小程序...

我正在寻找一种通过 shell_exec 回显最后 10 或 20 个连接输入/输出的方法...

echo '<hr>IFTOP -> <pre>'.shell_exec("iftop").'</pre><br>';

但上面写着 sh:iftop: command not found...

我试过ntop.org,但不是我要找的,我必须打开3000端口...

是否可以通过 echo shell_exec 显示最后的服务器连接? 欢迎使用任何 iftop 替代方案。

【问题讨论】:

    标签: php network-traffic


    【解决方案1】:

    使用完整路径调用iftop 命令。您的 shell 命令中没有完整的环境。

    【讨论】:

    • 我找到了路径并修改为 shell_exec("/usr/sbin/iftop 2>&1") 但它显示一个关于权限的错误。还有其他命令可以实现吗?
    猜你喜欢
    • 2019-11-26
    • 1970-01-01
    • 1970-01-01
    • 2022-08-11
    • 2021-10-07
    • 1970-01-01
    • 1970-01-01
    • 2018-01-09
    • 1970-01-01
    相关资源
    最近更新 更多