diff --git a/Ceph/Script/cephHealth.pl b/Ceph/Script/cephHealth.pl index ef0fba619bcd00d8db782c810500dd79f5ef1ce2..0cf12647e46407baf7504ee32d87498f8dc152b7 100755 --- a/Ceph/Script/cephHealth.pl +++ b/Ceph/Script/cephHealth.pl @@ -79,6 +79,8 @@ if (@ARGV > 0) { "k=s"=>\$opt_keyring, "m=s"=>\$opt_monhost, "status" =>\$opt_status, + "slowosd" =>\$opt_slow_osd, + "slowreq" =>\$opt_slow_req, "od" =>\$opt_object_degraded, "om" =>\$opt_object_misplaced, "f" =>\$opt_fraction, @@ -119,6 +121,14 @@ my $doStatus = 0; if (defined $opt_status) { $doStatus = 1; } +my $doSlowOsd = 0; +if (defined $opt_slow_osd) { + $doSlowOsd = 1; +} +my $doSlowReq = 0; +if (defined $opt_slow_req) { + $doSlowReq = 1; +} my $doObjectDeg = 0; if (defined $opt_object_degraded) { $doObjectDeg = 1; @@ -144,9 +154,9 @@ if (defined $opt_filter) { @matchStr = split(/,/,$opt_filter); } # -my $sumDo = $doStatus + $doObjectDeg + $doObjectMis + $doOsdFull + $doOsdNearFull; +my $sumDo = $doStatus + $doSlowOsd + $doSlowReq + $doObjectDeg + $doObjectMis + $doOsdFull + $doOsdNearFull; if ($sumDo > 1) { - fail_usage "Either status or objectsDeg/objectsMis or OSD_full/OSD_nearfull."; + fail_usage "Either status or slow_requests/osds or objectsDeg/objectsMis or OSD_full/OSD_nearfull."; } # Fetch the data and put it in an array @@ -162,6 +172,8 @@ my %statusHash = ( 'HEALTH_ERR' => 2, ); my $status = 0; +my $numSlowReq = 0; +my $numSlowOsd = 0; my $objDegraded = 0; my $objDegradedFrac = 0; my $objMisplaced = 0; @@ -183,6 +195,12 @@ foreach my $_line (@_data) } else { $status = 2; } + if ($_line =~ m/ (\d+) requests are blocked/) { + $numSlowReq = $1; + } + if ($_line =~ m/ (\d+) osds have slow requests/) { + $numSlowOsd = $1; + } if ($_line =~ m/ (\d+)\/(\d+) objects misplaced \(([-+]?[0-9]*\.?[0-9]+)\%\)/) { $objMisplaced = $1; $objMisplacedFrac = $3; @@ -215,6 +233,10 @@ if (defined $opt_status) { } else { print $objMisplaced."\n"; } +} elsif (defined $opt_slow_req) { + print $numSlowReq."\n"; +} elsif (defined $opt_slow_osd) { + print $numSlowOsd."\n"; } elsif (defined $opt_nearfull) { print $osdNearFull."\n"; } elsif (defined $opt_full) {