From 052a3fdf73173365085c9a54a7d511478709d7d11d6628deb13d43d390457fa4 Mon Sep 17 00:00:00 2001 From: Wolfgang Rosenauer Date: Tue, 24 Nov 2015 12:27:57 +0000 Subject: [PATCH] Accepting request 346039 from home:wrosenauer:devel OBS-URL: https://build.opensuse.org/request/show/346039 OBS-URL: https://build.opensuse.org/package/show/server:monitoring/munin?expand=0&rev=24 --- munin.changes | 5 +++ munin.spec | 2 + mysql55.patch | 109 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 116 insertions(+) create mode 100644 mysql55.patch diff --git a/munin.changes b/munin.changes index 56ff921..d3de708 100644 --- a/munin.changes +++ b/munin.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Nov 24 12:11:20 UTC 2015 - wr@rosenauer.org + +- apply upstream change to work correctly for MySQL >= 5.5 + ------------------------------------------------------------------- Tue Sep 1 11:54:04 UTC 2015 - dimstar@opensuse.org diff --git a/munin.spec b/munin.spec index c5799d1..d06734f 100644 --- a/munin.spec +++ b/munin.spec @@ -47,6 +47,7 @@ Source12: nginx-munin.zip Source13: gsa-munin.zip # https://svn.koumbit.net/koumbit/trunk/munin-plugins/quota-usage Patch: munin-plugin-quota_usage_warnings.patch +Patch2: mysql55.patch BuildRequires: html2text BuildRequires: perl-HTML-Template BuildRequires: perl-Log-Log4perl @@ -151,6 +152,7 @@ cp %{SOURCE1} . unzip %{SOURCE12} unzip %{SOURCE13} %patch +%patch2 -p1 %build %__make diff --git a/mysql55.patch b/mysql55.patch new file mode 100644 index 0000000..937db5d --- /dev/null +++ b/mysql55.patch @@ -0,0 +1,109 @@ +From 9f53020cc7aa5338b9983cab3c1f233ffd349576 Mon Sep 17 00:00:00 2001 +From: y-ken +Date: Sat, 22 Jun 2013 01:47:20 +0900 +Subject: [PATCH 1/4] Add support for MySQL 5.5/5.6 + +The mysql plugin named "mysql_" have a problem. So It could not work +fine with MySQL 5.5 or 5.6. +I have make a patch for "INDIVIDUAL BUFFER POOL INFO" section as +skipped to work. + +## all of symlinked mysql_ pluugin gets error like below. +```sh +$ /etc/munin/plugins/mysql_connections +Unknown section: INDIVIDUAL BUFFER POOL INFO at +/etc/munin/plugins/mysql_connections line 1098. +``` + +## related issue +https://github.com/kjellm/munin-mysql/commit/111293966ccd6e8df6c1347cb0f +9a8b4025c0266 + +diff --git a/plugins/node.d/mysql_.in b/plugins/node.d/mysql_.in +index 76c214a..3914e92 100644 +--- a/plugins/node.d/mysql_.in ++++ b/plugins/node.d/mysql_.in +@@ -9,7 +9,7 @@ mysql_ - Munin plugin to display misc MySQL server status + + =head1 APPLICABLE SYSTEMS + +-Any MySQL platform, tested by the author on MySQL 5.1.29 and 5.0.51 ++Any MySQL platform, tested by the author on MySQL 5.6.12 and 5.5.32, 5.1.29, 5.0.51 + + =head1 CONFIGURATION + +@@ -882,8 +882,11 @@ sub show { + if $graph_name =~ /innodb_/ && $data->{_innodb_disabled}; + + for my $ds (@{$graph->{data_sources}}) { +- printf "%s.value %s\n", +- clean_fieldname($ds->{name}), $data->{$ds->{name}}; ++ my $value = exists $ds->{value} ++ ? $ds->{value}($data) ++ : $data->{$ds->{name}}; ++ ++ printf "%s.value %s\n", clean_fieldname($ds->{name}), defined($value) ? $value : 'U'; + } + + return 0; +@@ -1071,17 +1074,18 @@ sub parse_innodb_status { + + my %section_map = ( + +- 'BUFFER POOL AND MEMORY' => \&parse_buffer_pool_and_memory, +- 'FILE I/O' => \&parse_file_io, ++ 'BUFFER POOL AND MEMORY' => \&parse_buffer_pool_and_memory, ++ 'INDIVIDUAL BUFFER POOL INFO' => \&skip, ++ 'FILE I/O' => \&parse_file_io, + 'INSERT BUFFER AND ADAPTIVE HASH INDEX' + => \&parse_insert_buffer_and_adaptive_hash_index, +- 'LATEST DETECTED DEADLOCK' => \&skip, +- 'LATEST FOREIGN KEY ERROR' => \&skip, +- 'LOG' => \&parse_log, +- 'ROW OPERATIONS' => \&skip, +- 'SEMAPHORES' => \&parse_semaphores, +- 'TRANSACTIONS' => \&parse_transactions, +- 'BACKGROUND THREAD' => \&skip, ++ 'LATEST DETECTED DEADLOCK' => \&skip, ++ 'LATEST FOREIGN KEY ERROR' => \&skip, ++ 'LOG' => \&parse_log, ++ 'ROW OPERATIONS' => \&skip, ++ 'SEMAPHORES' => \&parse_semaphores, ++ 'TRANSACTIONS' => \&parse_transactions, ++ 'BACKGROUND THREAD' => \&skip, + ); + + skip_heading(); +@@ -1213,12 +1217,26 @@ sub parse_file_io { + sub parse_insert_buffer_and_adaptive_hash_index { + parse_section( + sub { +- m/\G(\d+) inserts, (\d+) merged recs, (\d+) merges\n/gc && do { +- $data->{ib_ibuf_inserts} = $1; +- $data->{ib_ibuf_merged_rec} = $2; +- $data->{ib_ibuf_merges} = $3; +- return 1; +- }; ++ # MySQL < 5.5 ++ m/\G(\d+) inserts, (\d+) merged recs, (\d+) merges\n/gc && do { ++ $data->{ib_ibuf_inserts} = $1; ++ $data->{ib_ibuf_merged_rec} = $2; ++ $data->{ib_ibuf_merges} = $3; ++ return 1; ++ }; ++ # MySQL >= 5.5 ++ m/\Gmerged operations:\n insert (\d+), delete mark \d+, delete \d+\ndiscarded operations:\n insert (\d+), delete mark \d+, delete \d+\n/gc && do { ++ $data->{ib_ibuf_inserts} = $1; ++ $data->{ib_ibuf_merged_rec} = $1 + $2; ++ return 1; ++ }; ++ m/\GIbuf: size (\d+), free list len (\d+), seg size (\d+),(?: (\d+) merges)?\n/gc && do { ++ $data->{ib_ibuf_size} = $1; ++ $data->{ib_ibuf_free_len} = $2; ++ $data->{ib_ibuf_seg_size} = $3; ++ $data->{ib_ibuf_merges} = $4 if defined $4; # MySQL >= 5.5 ++ return 1; ++ }; + } + ); + }