联系:手机/微信(+86 17813235971) QQ(107644445)
作者:惜分飞©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]
OS Watcher Black Box (OSWbb) 是一种 UNIX shell 脚本的集合,主要用于收集和归档操作系统和网络的度量,以便为诊断性能问题提供支持。OSWbb 作为服务器上的一组后台进程来运行,定期收集OS 数据,其调用 Unix 实用程序,如 vmstat、netstat 和 iostat 等。在最近的gi psu中已经把osw包含在tfa中了,但是默认不启用私网的监控,如果需要可以进行人工配置
OSWbb 使用 traceroute 命令获取这些私有网络的状态。每个操作系统对 traceroute 命令使用的参数都略有不同。基本 oswbb 目录中的示例Exampleprivate.net 文件中包含每个操作系统使用的语法。因此,这将导致在 UNIX 平台中的输出显示有所不同。OSWbb 按指定间隔运行 private.net 文件,并在归档目录下的 oswprvtnet 子目录中存储数据。数据存储在每小时归档的文件中。文件中的每个条目都包含一个时间戳,前缀为 ***,嵌入在顶部输出中。
tfa中含osw
[root@xifenfei01 ~]# ps -ef|grep osw grid 17673 1 0 Jan30 ? 00:00:07 /bin/sh ./OSWatcher.sh 30 48 NONE /u01/app/grid/tfa/repository/suptools/xifenfei01/oswbb/grid/archive grid 17841 17673 0 Jan30 ? 00:00:01 /bin/sh ./OSWatcherFM.sh 48 /u01/app/grid/tfa/repository/suptools/xifenfei01/oswbb/grid/archive root 64159 64120 0 00:30 pts/0 00:00:00 grep osw
测试prvtnet.sh
[root@xifenfei01 oswbb]# cd /u01/app/grid/tfa/repository/suptools/xifenfei01/oswbb/grid/oswbb [root@xifenfei01 oswbb]# more prvtnet.sh echo "zzz ***"`date` traceroute -r -F xifenfei01-priv traceroute -r -F xifenfei02-priv ###################################################################### # DO NOT DELETE THE FOLLOWING LINE!!!!!!!!!!!!!!!!!!!!! ###################################################################### rm locks/lock.file [root@xifenfei01 oswbb]# ./prvtnet.sh zzz ***Tue Jan 30 18:02:49 CST 2018 traceroute to xifenfei01-priv (192.168.102.11), 30 hops max, 60 byte packets 1 xifenfei01-priv (192.168.102.11) 0.010 ms 0.003 ms 0.002 ms traceroute to xifenfei02-priv (192.168.102.14), 30 hops max, 60 byte packets 1 xifenfei02-priv (192.168.102.14) 0.081 ms 0.076 ms 0.087 ms rm: cannot remove `locks/lock.file': No such file or directory
配置private.net正式收集私网信息
[root@xifenfei01 oswbb]# find . -name OSWatcher.sh | xargs grep -i "private" # Run traceroute for private networks if file private.net exists if [ -x private.net ]; then ./private.net >> $OSWBB_ARCHIVE_DEST/oswprvtnet/${hostn}_prvtnet_$hour 2>&1 &
这里重要的是:
./OSWatcher.sh:# Run traceroute for private networks if file private.net exists
表示,在OSWatcher.sh中调用的文件名称是private.net
将prvtnet.sh复制为供OSWatcher.sh脚本调用的文件名称
[root@xifenfei01 oswbb]# cp prvtnet.sh private.net [root@xifenfei01 oswbb]# chown grid:oinstall prvtnet.net [root@xifenfei01 oswbb]# chmod +x prvtnet.net
关注内容
示例 1: 接口处于启动和响应状态: traceroute to X.X.X.X, (X.X.X.X) 30 hops max, 1492 byte packets 1 X.X.X.X 1.015 ms 0.766 ms 0.755 ms 示例 2: 目标接口不是在直接连接的网络上,所以需要验证地址 是否正确或其插入的交换机是否位于相同的 VLAN 上(或其他问题): traceroute to X.X.X.X, (X.X.X.X) 30 hops max, 40 byte packets traceroute: host X.X.X.X is not on a directly-attached network 示例 3: 网络无法访问: traceroute to X.X.X.X, (X.X.X.X) 30 hops max, 40 byte packets Network is unreachable 示例 4: 网络无法访问: xifenfei01_prvtnet_18.01.30.2000.dat-zzz ***Tue Jan 30 20:27:43 CST 2018 xifenfei01_prvtnet_18.01.30.2000.dat-traceroute to xifenfei01-priv (192.168.102.11), 30 hops max, 60 byte packets xifenfei01_prvtnet_18.01.30.2000.dat- 1 xifenfei01-priv (192.168.102.11) 0.014 ms 0.004 ms 0.005 ms xifenfei01_prvtnet_18.01.30.2000.dat-traceroute to xifenfei02-priv (192.168.102.14), 30 hops max, 60 byte packets xifenfei01_prvtnet_18.01.30.2000.dat- 1 * * * xifenfei01_prvtnet_18.01.30.2000.dat- 2 * * * xifenfei01_prvtnet_18.01.30.2000.dat- 3 * * * xifenfei01_prvtnet_18.01.30.2000.dat- 4 * * * xifenfei01_prvtnet_18.01.30.2000.dat- 5 * * * xifenfei01_prvtnet_18.01.30.2000.dat- 6 * * * xifenfei01_prvtnet_18.01.30.2000.dat- 7 * * * xifenfei01_prvtnet_18.01.30.2000.dat- 8 * * * xifenfei01_prvtnet_18.01.30.2000.dat- 9 * * * xifenfei01_prvtnet_18.01.30.2000.dat-10 * * * xifenfei01_prvtnet_18.01.30.2000.dat-11 * * * xifenfei01_prvtnet_18.01.30.2000.dat-12 * * * xifenfei01_prvtnet_18.01.30.2000.dat-13 * * * xifenfei01_prvtnet_18.01.30.2000.dat-14 * * * xifenfei01_prvtnet_18.01.30.2000.dat-15 * * * xifenfei01_prvtnet_18.01.30.2000.dat-16 * * * xifenfei01_prvtnet_18.01.30.2000.dat-17 * * * xifenfei01_prvtnet_18.01.30.2000.dat-18 * * * xifenfei01_prvtnet_18.01.30.2000.dat-19 * * * xifenfei01_prvtnet_18.01.30.2000.dat-20 * * * xifenfei01_prvtnet_18.01.30.2000.dat-21 * * * xifenfei01_prvtnet_18.01.30.2000.dat-22 * * * xifenfei01_prvtnet_18.01.30.2000.dat-23 * * * xifenfei01_prvtnet_18.01.30.2000.dat-24 * * * xifenfei01_prvtnet_18.01.30.2000.dat-25 * * * xifenfei01_prvtnet_18.01.30.2000.dat-26 * * * xifenfei01_prvtnet_18.01.30.2000.dat-27 * * * xifenfei01_prvtnet_18.01.30.2000.dat-28 * * * xifenfei01_prvtnet_18.01.30.2000.dat-29 * * * xifenfei01_prvtnet_18.01.30.2000.dat-30 * * * xifenfei01_prvtnet_18.01.30.2000.dat:zzz ***Warning. Traceroute response is spanning snapshot intervals.