保险shell

vmstat如果在结果中添加系统时间列

我想写个shell监控系统资源情况,使用vmstat 5 每隔5秒收集一次,目前希望在结果中增加一个系统时间列,当出现系统问题时能知道是什么时间发生的。AIX 6的操作系统。
参与7

6同行回答

chenlw2chenlw2系统工程师trustfar
学习了显示全部
学习了收起
互联网服务 · 2013-11-19
浏览755
tsgmqtsgmq项目经理中科软科技股份有限公司
回复 3# tsgmq     vmstat -t 5这样就可以每隔5秒收集一次,最后一列是有时间信息的。显示全部
回复 3# tsgmq


    vmstat -t 5
这样就可以每隔5秒收集一次,最后一列是有时间信息的。

vmstat.bmp

收起
保险 · 2013-11-14
浏览869
sashasasha数据库管理员宇信易诚
#!/bin/kshwhile true      do      echo $(date "+%F %T")"  \c"      vmstat 5 1 |sed -n  '7p'done显示全部
#!/bin/ksh

while true
      do
      echo $(date "+%F %T")"  \c"
      vmstat 5 1 |sed -n  '7p'
done收起
互联网服务 · 2013-11-12
浏览755
sashasasha数据库管理员宇信易诚
写个shell脚本吧#!/bin/kshwhile true      do      echo $(date "+%F %T")      vmstat 5 1 |sed -n  '6,7p'done显示全部
写个shell脚本吧

#!/bin/ksh

while true
      do
      echo $(date "+%F %T")
      vmstat 5 1 |sed -n  '6,7p'
done收起
互联网服务 · 2013-11-12
浏览808
tsgmqtsgmq项目经理中科软科技股份有限公司
vmstat 5 | awk '{print "'`date +%Y/%m/%d-%H:%M:%S`'", $0}'显示全部
vmstat 5 | awk '{print "'`date +%Y/%m/%d-%H:%M:%S`'", $0}'收起
保险 · 2013-11-12
浏览814
drdb2drdb2系统工程师se
To display time-stamp next to each column of output of vmstat, enter:vmstat -t  m [n]显示全部
To display time-stamp next to each column of output of vmstat, enter:

vmstat -t  m [n]收起
互联网服务 · 2013-11-12
浏览811

提问者

tsgmq
项目经理中科软科技股份有限公司

相关问题

相关资料

相关文章

问题状态

  • 发布时间:2013-11-12
  • 关注会员:1 人
  • 问题浏览:4371
  • 最近回答:2013-11-19
  • X社区推广