Chinaunix首页 | 论坛 | 博客
  • 博客访问: 277444
  • 博文数量: 64
  • 博客积分: 1758
  • 博客等级: 上尉
  • 技术积分: 543
  • 用 户 组: 普通用户
  • 注册时间: 2010-11-25 11:13
文章分类
文章存档

2011年(54)

2010年(10)

我的朋友

分类: Python/Ruby

2011-03-29 23:06:32

#!/usr/bin/perl

use strict;
my @hrFSRMP1;
my @hrFSMP1;

while() {
        chomp;
        my $ip = $_;
        print "$ip\n";
        my @hrFSRMP = `snmpwalk -Os -v 2c -c L97iDuba $ip hrFSRemoteMountPoint`;
        my @hrFSMP = `snmpwalk -Os -v 2c -c L97iDuba  $ip hrFSMountPoint`;

        for(my $i=0; $i<=$#hrFSRMP; $i++) {
                chomp;
                if($hrFSRMP[$i] =~ /hrFSRemoteMountPoint\.\d+ = (?:STRING: )?"(.*)"/) {
                        push @hrFSRMP1, $1;
                }
        }

        for(my $j=0; $j<=$#hrFSMP; $j++) {
                chomp;
                if($hrFSMP[$j] =~ /hrFSMountPoint\.\d+ = STRING: "(.*)"/) {
                        push @hrFSMP1, $1;
                }
        }

        for(my $k=5; $k<=$#hrFSRMP1; $k++) {
                print "mount -o rsize=32768,wsize=32768,tcp,noatime,timeo=22,retrans=5 $hrFSRMP1[$k] $hrFSMP1[$k]\n";
        }
        print "----------------------------------------------------------------------------------------------------------------------\n";
        @hrFSRMP1=();
        @hrFSMP1=();
}

阅读(1412) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~