sub repl { #print "********REPLICATION STATUS********\n\n"; my $rs = $dbh->prepare("show status like 'slave_running'"); my $rrdbs = $dbh->prepare("show variables like 'read_rnd_buffer_size'"); $rs->execute(); $rrdbs->execute(); while(my @vall = $rs->fetchrow_array()) {print " "; # print "Replication Slave Status: $vall[1]\n"; if($vall[1] eq 'ON') { #print "The system is configured as Mysql Replication SLAVE\n"; #print " The following is the Slave Status\n"; my $mas_hos = $dbh->prepare("show slave status"); $mas_hos->execute(); while ( my @val = $mas_hos->fetchrow_array() ) { print ""; print ""; print ""; print ""; #print ""; print "\n" } print "
Slave_IO_State Master_host Slave_IO_Running Slave_SQL_Running
$val[0]$val[1]$val[10]$val[11]$val[33]
\n";