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");
};
};
};