This repository was archived by the owner on Mar 22, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -744,7 +744,7 @@ sub fetch_mysql_data {
744
744
745
745
# Older versions of MySQL may not have the File_size column in the
746
746
# results of the command.
747
- if (exists ($newrow {' file_size' })) {
747
+ if (exists ($newrow {' file_size' }) && $newrow { ' file_size ' } > 0 ) {
748
748
push (@binlogs , $newrow {' file_size' });
749
749
}
750
750
else {
@@ -753,6 +753,13 @@ sub fetch_mysql_data {
753
753
}
754
754
}
755
755
756
+ if (scalar @binlogs ) {
757
+ $status {' binary_log_space' } = 0;
758
+ foreach my $log (@binlogs ) {
759
+ $status {' binary_log_space' } += $log ;
760
+ }
761
+ }
762
+
756
763
# Get SHOW INNODB STATUS and extract the desired metrics from it.
757
764
if ($opt {innodb } && $status {' have_innodb' } eq ' YES' ) {
758
765
my $innodb_array = $dbh -> selectall_arrayref(" SHOW /*!50000 ENGINE*/ INNODB STATUS" ,{Slice => {}});
@@ -822,13 +829,6 @@ sub fetch_mysql_data {
822
829
}
823
830
}
824
831
825
- if (scalar @binlogs ) {
826
- $status {' binary_log_space' } = 0;
827
- foreach my $log (@binlogs ) {
828
- $status {' binary_log_space' } += $log ;
829
- }
830
- }
831
-
832
832
$dbh -> disconnect();
833
833
834
834
my %trans ;
You can’t perform that action at this time.
0 commit comments