Committer: ldoolan
add time and tz to output lineU trunk/bin/dbcheck.pl
Modified: trunk/bin/dbcheck.pl =================================================================== --- trunk/bin/dbcheck.pl 2010-12-09 16:07:44 UTC (rev 17892) +++ trunk/bin/dbcheck.pl 2010-12-09 16:37:52 UTC (rev 17893) @@ -150,10 +150,16 @@ return 0; } - my $tzone; - #(undef, $tzone) = $db->selectrow_array("show variables like 'timezone'"); + my ($tzone, $dtg); + (undef, $tzone) = $db->selectrow_array("show variables like 'time_zone'"); + if (lc($tzone) eq 'system') { + (undef, $tzone) = $db->selectrow_array("show variables like 'system_time_zone'"); + } $tzone ||= "???"; + ($dtg)= $db->selectrow_array("select date_format(now(), '%H:%i')"); + $dtg ||= 'xxx xxxxxxxxx hh:mm:ss'; + $sth = $db->prepare("SHOW PROCESSLIST"); $sth->execute; my $pcount_total = 0; @@ -219,7 +225,7 @@ } #print "$dbid of $d->{masterid}: $d->{name} ($roles)\n"; - printf("%4d %-18s %4s repl:%7s %4s conn:%4d/%4d $tzone \%s ($roles)\n", + printf("%4d %-18s %4s repl:%7s %4s conn:%4d/%4d $dtg $tzone \%s ($roles)\n", $dbid, $d->{name}, $d->{masterid} ? $d->{masterid} : "",