使用PHP获取Linux当前的带宽使用情况

I have a server with OpenVZ installed and virtual machines with a public IPv4 for every machine. I need to get the bandwidth usage of each separate virtual machine (mbps or kbps) from PHP. My idea is to install iftop on the host machine and run it from PHP function exec(), the command "iftop -n -F AA.BB.CC.DD/32". The problem is that is an application iftop "top" style, and is made to run on a real terminal and is updated with new data. I can not install anything on the VMs, should be clean. Nor has a network interface each VM and I can not change it. I wonder what other options I have or how to carry out my idea. Sorry for my english

查看全部
duansanzi5265
duansanzi5265
2010/11/01 01:03
  • linux
  • php
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

1个回复