dtr53557 2010-12-15 14:34
浏览 100
已采纳

使用PHP获取UNIX服务器每月带宽使用率

Is there anyway i can get the servers monthly bandwidth usage using php ? Thank you .

  • 写回答

2条回答 默认 最新

  • douyue1926 2010-12-15 14:42
    关注

    your best bet is to parse number of packets that passed ethX inteface command that keeps track of bytes passed is /sbin/ifconfig Keep in mind that counters are reset if you reboot your linux box

    eth0      
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:32363649 errors:0 dropped:0 overruns:0 frame:0
              TX packets:35133219 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:2813232645 (2.6 GiB)  TX bytes:1696525681 (1.5 GiB)
              Interrupt:16 Memory:f4000000-f4012700 
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 python:excel数据写入多个对应word文档
  • ¥60 全一数分解素因子和素数循环节位数
  • ¥15 ffmpeg如何安装到虚拟环境
  • ¥188 寻找能做王者评分提取的
  • ¥15 matlab用simulink求解一个二阶微分方程,要求截图
  • ¥30 乘子法解约束最优化问题的matlab代码文件,最好有matlab代码文件
  • ¥15 写论文,需要数据支撑
  • ¥15 identifier of an instance of 类 was altered from xx to xx错误
  • ¥100 反编译微信小游戏求指导
  • ¥15 docker模式webrtc-streamer 无法播放公网rtsp