• rex 切换到oracle用户执行脚本


      my @DBARR=('188.2.247.50','188.2.247.51','188.2.247.5','188.2.247.6','188.16.68.3','188.16.68.4','188.2.231.3','188.2.231.4','188.2.231.8','188.2.231.9','188.2.247.17','188.2.247.18','188.16.32.25','188.16.32.26','188.3.248.5','188.3.248.6');
     group DBARR=>@DBARR;
     task "check_lock", group=>"DBARR", sub {
       my $current_server = connection->server;
       chomp $current_server;
       say $current_server;
       file "/tmp/check_lock.sh",
       source => "/root/rexdb/rex/database/check_lock.sh",
       mode => 755,
       owner  => "oracle",
       group  => "dba";
       my @output = run "su - oracle -c /tmp/check_lock.sh";
       say @output;
       my $output;
       foreach $output (@output){
       $output=~s/[
    ]//;
       my @array=split /s+/,$output;
       say $array[-1];
       if ($array[-1] >= 5){
         &SendELK("DbLockWarning->${current_server}->$output");
       };
     };
    };

  • 相关阅读:
    p1706 全排列
    2089烤鸡(类似于选数问题)
    1036选数
    bfs
    A-E
    A-3
    百题A-2
    百题A-1
    二级概念题
    随记
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13349453.html
Copyright © 2020-2023  润新知