ps aux 结果显示不全
来源:互联网 发布:下载itunes软件 编辑:程序博客网 时间:2024/05/01 08:15
最近在用nagios,写了个检查系统服务的插件,其中用到了如下的perl代码:
system "ps aux | grep $proc_command > /tmp/$file_name_ps"; # ps aux | grep $proc_command 输出重定向到 /tmp/$file_name_ps 中
但是发现输出文件中没有要显示的服务,尝试使用
system "ps aux > /tmp/$file_name_ps";发现输出文件中的结果不全,比如:
对于apache2 服务,完全显示出来应该是下面这样:
root 1372 0.0 0.2 207156 12016 ? Ss 08:57 0:00 /usr/sbin/apache2 -k startwww-data 1497 0.0 0.2 208340 8972 ? S 08:57 0:00 /usr/sbin/apache2 -k start
在命令行执行这个命令显示结果是完全的;
但是,nagios调用这个插件时,结果只显示一部分,如下:
root 1372 0.0 0.2 207156 12016 ? Ss 08:57 0:00 /usr/sbin/apach后面的内容不能显示,导致插件的输出没有。
解决办法:
在插件代码中不使用 ps aux,而使用 ps auxwww ,这样就会显示全部结果。
1 0
- ps aux 结果显示不全
- linux ps aux 结果解释
- linx ps aux显示的信息
- ps aux
- ps -aux
- ps aux
- PS -AUX
- ps aux
- ps aux
- ps -aux出来的stat结果Ss,Sl,SN~~
- ps -ef | ps -aux
- linux ps 显示不全宽度不足
- 关于ps aux命令中的USER列显示UID问题
- ps aux命令显示的状态列中的状态(转)
- ps -aux ps -ef 命令
- ps -aux ps -ef 命令
- ps -aux ps -ef 命令
- ps -l与ps -aux
- 提高SQL执行效率的16种方法
- HDU 又一版 A+B
- Eclipse安装Maven插件
- 基础练习2_01字串
- C++,视觉交互,算法,vs2012,matlab2014a,opencv,Android,come on!20141010-理解c++
- ps aux 结果显示不全
- android开发中WebView的使用(附完整程序)
- ViewPage :Required method instantiateItem was not overridde
- 表单--form标签
- QT多线程
- Farpoint_Spread5_WinForm中文帮助文档
- split STL string by chars
- How much memory does malloc(0) allocate?
- PHP制作验证码