mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
Add error message to extinfo
This commit is contained in:
parent
a535a5df53
commit
4547f33dda
1 changed files with 15 additions and 2 deletions
|
@ -24,6 +24,19 @@ use strict;
|
||||||
my $MYSQL = $ENV{mysql} || "mysql";
|
my $MYSQL = $ENV{mysql} || "mysql";
|
||||||
my $MYSQLOPTS = $ENV{mysqlopts} || "";
|
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') {
|
if(defined $ARGV[0] && $ARGV[0] eq 'config') {
|
||||||
print <<EOC
|
print <<EOC
|
||||||
graph_title MySQL Slave Threads
|
graph_title MySQL Slave Threads
|
||||||
|
@ -32,18 +45,18 @@ graph_category db
|
||||||
graph_args -l 0
|
graph_args -l 0
|
||||||
io.label I/O Thread
|
io.label I/O Thread
|
||||||
io.critical 1:1
|
io.critical 1:1
|
||||||
|
io.extinfo $ioerror
|
||||||
sql.label SQL Thread
|
sql.label SQL Thread
|
||||||
sql.critical 1:1
|
sql.critical 1:1
|
||||||
|
sql.extinfo $sqlerror
|
||||||
EOC
|
EOC
|
||||||
;
|
;
|
||||||
exit 0;
|
exit 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
my $status = `$MYSQL $MYSQLOPTS -e 'SHOW SLAVE STATUS\\G'`;
|
|
||||||
|
|
||||||
$status =~ /Slave_IO_Running: (\w+)/;
|
$status =~ /Slave_IO_Running: (\w+)/;
|
||||||
print 'io.value '.($1 eq 'Yes' ? 1 : 0)."\n";
|
print 'io.value '.($1 eq 'Yes' ? 1 : 0)."\n";
|
||||||
$status =~ /Slave_SQL_Running: (\w+)/;
|
$status =~ /Slave_SQL_Running: (\w+)/;
|
||||||
print 'sql.value '.($1 eq 'Yes' ? 1 : 0)."\n";
|
print 'sql.value '.($1 eq 'Yes' ? 1 : 0)."\n";
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue