通过其他程序或脚本在非交互式模式下调用top命令,经常会出现:
top: failed tty get 错误
解决办法:加个-b 选项皆可
-b : Batch mode operation
Starts top in <A1><AF>Batch mode<A1><AF>, which could be useful for sending output from top to other programs or to a file. In this mode, top will not accept input and runs until the iterations limit you<A1><AF>ve set with the <A1><AF>-n<A1><AF> command-line option or until killed.
例如执行:
top -bn 1
监控某个进程的状态:
top -bn 1 -p 14370 | grep cmdname>>stats.log
来源:http://phpor.net/blog/post/819/
用top命令看一下有下边四个进程吗?有的话ok了!(top -b -d 5)
fmsmaster fmsedge fmscore fmsadmin
别忘记打开linux的防火墙端口!!!!
top: failed tty get 错误
解决办法:加个-b 选项皆可
-b : Batch mode operation
Starts top in <A1><AF>Batch mode<A1><AF>, which could be useful for sending output from top to other programs or to a file. In this mode, top will not accept input and runs until the iterations limit you<A1><AF>ve set with the <A1><AF>-n<A1><AF> command-line option or until killed.
例如执行:
top -bn 1
监控某个进程的状态:
top -bn 1 -p 14370 | grep cmdname>>stats.log
来源:http://phpor.net/blog/post/819/
用top命令看一下有下边四个进程吗?有的话ok了!(top -b -d 5)
fmsmaster fmsedge fmscore fmsadmin
别忘记打开linux的防火墙端口!!!!
作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:http://jackxiang.com/post/4518/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!
最后编辑: jackxiang 编辑于2011-8-18 00:00
评论列表