你好,游客 登录 注册 搜索
背景:
阅读新闻

使用OS Watcher监控操作系统

[日期:2013-02-26] 来源:Linux社区  作者:realkid4 [字体:大 中 小]

2、程序运行和性能数据收集

 

OS Watcher的本质就是借助操作系统自身的性能数据收集接口,定期以作业的方式调用程序,并且收集数据。OS Watcher基于的几个常用性能监控程序,如topas,vmstat,iostat。我们调用OS Watcher的时候,一定要注意调用用户的权限情况,要有权限执行这几个程序。

 

开启监控过程,我们需要调用startOSWbb.sh脚本,输入监控时间参数信息之后,监控过程就自动开始了。

 

startOSWbb.sh参数有四个,头两个是我们最常使用的,监控收集间隔和运行时间。OS Watcher会在后台运行,在特定间隔启动收集,并且将数据收集在OS Watcher的归档archive信息库中。间隔时间的参数单位是秒。运行时间设置程序运行的时间,单位是小时,经过了这个时间,OS Watcher自动终止。

 

 

第三个参数是存储数据格式,如果收集时间很长,收集数据可能需要压缩。第三个参数就是设置压缩格式的。最后一个不经常需要设置,就是数据收集的目录。如果我们不设置,会选择在oswbb下创建一个archive目录进行保存。

 

下面我们尝试启动程序。

 

 

--30s收集一次,运行1小时

[Oracle@bspdev oswbb]$./startOSWbb.sh 30 1 gzip

[oracle@bspdev oswbb]$ Info...Zip option IS specified.

Info...OSW will use gzip to compress files.

Setting the archive log directory to/osw/oswbb/archive

 

--工具确认

Testing for discovery of OS Utilities...

VMSTAT found on your system.

IOSTAT found on your system.

MPSTAT found on your system.

NETSTAT found on your system.

TOP found on your system.

 

Testing for discovery of OS CPU COUNT

oswbb is looking for the CPU COUNT on your system

CPU COUNT will be used by oswbba to automatically look for cpu problems

 

CPU COUNT found on your system.

CPU COUNT = 1

 

Discovery completed.

 

 

Starting OSWatcher Black Box v6.0.1 on Fri Feb 22 15:04:30 CST 2013

With SnapshotInterval = 30

With ArchiveInterval = 1

 

OSWatcher Black Box - Written by Carl Davis, Center of Expertise,

Oracle Corporation

For questions on install/usage please go to MOS (Note:301137.1)

If you need further assistance or have comments or enhancement

requests you can email me Carl.Davis@Oracle.com

 

Data is stored in directory: /osw/oswbb/archive

 

Starting Data Collection...

 

--开始收集

oswbb heartbeat:Fri Feb 22 15:04:35 CST 2013

 

 

从工具检测上,OS Watcher涉及到CPU、IO Disk、内存和网络多个方面。一般OS层面的性能测试基本已经涵盖。

 

每隔一个时间间隔,OS Watcher就会在后台启动收集信息。

 

 

 

oswbb heartbeat:Fri Feb 22 15:04:35 CST 2013

oswbb heartbeat:Fri Feb 22 15:05:10 CST 2013

oswbb heartbeat:Fri Feb 22 15:05:44 CST 2013

oswbb heartbeat:Fri Feb 22 15:06:19 CST 2013

 

(后台运行)

 

[oracle@bspdev oswbb]$ ps -ef | grep OSW

oracle  2573    1 0 15:04 pts/0  00:00:01 /bin/sh ./OSWatcher.sh 30 1 gzip

oracle  2726 2573 0 15:04 pts/0  00:00:00 /bin/sh ./OSWatcherFM.sh 1 /osw/oswbb/archive

oracle  5266 2525 0 15:07 pts/0  00:00:00 grep OSW

[oracle@bspdev oswbb]$

 

 

除了经过设置时间终止监控外,OS Watcher还可以通过stopOSWbb.sh脚本来终止执行。

 

 

[oracle@bspdev oswbb]$./stopOSWbb.sh

[oracle@bspdev oswbb]$ ps -ef | grep OSW

oracle  3042 2435 0 15:47 pts/2  00:00:00 grep OSW

 

 

统计收集的数据,都在archive目录下分类保存。

 

 

[oracle@bspdev osw]$ du

4      ./oswbb/gif

228    ./oswbb/docs/OSWatcher_Black_Box

776    ./oswbb/docs/The_Analyzer

1008  ./oswbb/docs

4      ./oswbb/tmp

4      ./oswbb/locks

20    ./oswbb/archive/oswmpstat

276    ./oswbb/archive/oswslabinfo

4      ./oswbb/archive/oswprvtnet

20    ./oswbb/archive/oswmeminfo

20    ./oswbb/archive/oswiostat

152    ./oswbb/archive/oswps

12    ./oswbb/archive/oswvmstat

32    ./oswbb/archive/oswnetstat

76    ./oswbb/archive/oswtop

616    ./oswbb/archive

76    ./oswbb/src

4      ./oswbb/profile

4      ./oswbb/analysis

2040  ./oswbb

3360  .

 

 

在目录下的确有数据收集到。下面我们一起来看看如何进行数据的分析处理。

linux
相关资讯       OS Watcher 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款