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/[\r\n]//;
my @array=split /\s+/,$output;
say $array[-1];
if ($array[-1] >= 5){
&SendELK("DbLockWarning->${current_server}->$output");
};
};
};
总结
如果觉得编程之家网站内容还不错,欢迎将编程之家网站推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。