From 4547f33ddab891037b88bcf3c5bcea7fbcd7b057 Mon Sep 17 00:00:00 2001 From: Anthony Baccuet Date: Wed, 16 Jan 2019 10:39:36 +0100 Subject: [PATCH] Add error message to extinfo --- plugins/mysql/mysql_slave_threads | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/plugins/mysql/mysql_slave_threads b/plugins/mysql/mysql_slave_threads index 6669c85d..47a2091d 100755 --- a/plugins/mysql/mysql_slave_threads +++ b/plugins/mysql/mysql_slave_threads @@ -24,6 +24,19 @@ use strict; my $MYSQL = $ENV{mysql} || "mysql"; my $MYSQLOPTS = $ENV{mysqlopts} || ""; +my $status = `$MYSQL $MYSQLOPTS -e 'SHOW SLAVE STATUS\\G'`; + +my $sqlerror = ""; +my $ioerror = ""; + +if ($status =~ /Last_SQL_Error: (.+)/) { + $sqlerror = $1; +} +if ($status =~ /Last_IO_Error: (.+)/) { + $ioerror = $1; +} + + if(defined $ARGV[0] && $ARGV[0] eq 'config') { print <