文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>oracle中infiniband的状态查看

oracle中infiniband的状态查看

时间:2010-08-31  来源:osdba

cat /proc/driver/ics_sdp/stats
cat /proc/driver/ics_sdp/config
cat /proc/driver/rds/info
cat /proc/driver/rds/stats
cat /proc/drivers/ipoib/interfaces/ib1

查看infiniband的rds的流量信息的脚本:

#!/usr/bin/perl

#****************************************************************#

# ScriptName: rdsstat

# Author: tangcheng

# Create Date: 2010-07-19

# Modify Author: tangcheng

# Modify Date: 2010-07-19

# Function:

#***


use POSIX qw(strftime);
use Time::Local;

$argc = @ARGV;

if($argc != 2)
{
    usage();
    exit(1);
}


$interval=$ARGV[0];
$count=$ARGV[1];


if($interval <=0 or $count <=0)
{
    usage();
    exit(1);
}

my @rdsstats;
my @prerdsstats;
my $i;
my $strtime;

@prerdsstats=getstats();
print " time Xmit bytes Xmit packets Recv bytes Recv packets\n";
print "------------------- ------------ ------------ ------------ ------------\n";

$i=0;
for(;$i<$count;$i++)
{
    sleep($interval);
    @rdsstats=getstats();
    $strtime= strftime "%Y-%m-%d %H:%M:%S", localtime();
    printf("%19s %12d %12d %12d %12d\n",
           $strtime,
           ($rdsstats[0]-$prerdsstats[0])/$interval,
           ($rdsstats[1]-$prerdsstats[1])/$interval,
           ($rdsstats[2]-$prerdsstats[2])/$interval,
           ($rdsstats[3]-$prerdsstats[3])/$interval);
    $prerdsstats[0]=$rdsstats[0];
    $prerdsstats[1]=$rdsstats[1];
    $prerdsstats[2]=$rdsstats[2];
    $prerdsstats[3]=$rdsstats[3];
    if( ($i+1) % 10 == 0)
    {
        print " time Xmit bytes Xmit packets Recv bytes Recv packets\n";
        print "------------------- ------------ ------------ ------------ ------------\n";
    }
}
exit 0;

sub usage
{
    print "Usage: rdsstat <interval> <count>\n";
    print "Example: rdsstat 1 10000\n";
}


sub getstats
{
    my @res;
    my $rdsinfo;
    my $line;
    my @lines;
    my @cells;
    my $cellcnt;

    $rdsinfo=`cat /proc/driver/rds/stats`;

    @lines = split("\n", $rdsinfo);
    foreach $line(@lines)
    {
        chomp($line);
        $line =~ s/^\s+//;
        $line =~ s/\s+$//;

        @cells=split(/\s+/,$line);
        $cellcnt=@cells;
        if($cellcnt != 3)
        {
         next;
        }
        if($cells[0] eq "Xmit" and $cells[1] eq "bytes")
        {
         $res[0]=$cells[2];
        }
        elsif($cells[0] eq "Xmit" and $cells[1] eq "packets")
        {
         $res[1]=$cells[2];
        }
        elsif($cells[0] eq "Recv" and $cells[1] eq "bytes")
        {
         $res[2]=$cells[2];
        }
        elsif($cells[0] eq "Recv" and $cells[1] eq "packets")
        {
         $res[3]=$cells[2];
        }
    }
    return @res;
    
}


相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载