Skip to content

Commit

Permalink
Merge pull request #324 from t-8ch/mysql_innodb
Browse files Browse the repository at this point in the history
Add innodbstats and slavenotifications for mysql
  • Loading branch information
blkperl committed Sep 4, 2015
2 parents 662e6e7 + d7386ae commit e4e906e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
28 changes: 19 additions & 9 deletions manifests/plugin/mysql/database.pp
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
#
define collectd::plugin::mysql::database (
$ensure = 'present',
$database = $name,
$host = 'UNSET',
$username = 'UNSET',
$password = 'UNSET',
$port = '3306',
$masterstats = false,
$slavestats = false,
$socket = undef,
$ensure = 'present',
$database = $name,
$host = 'UNSET',
$username = 'UNSET',
$password = 'UNSET',
$port = '3306',
$masterstats = false,
$slavestats = false,
$socket = undef,
$innodbstats = undef,
$slavenotifications = undef,
) {
include collectd::params
include collectd::plugin::mysql
Expand All @@ -21,6 +23,14 @@
validate_string($socket)
}

if $innodbstats != undef {
validate_bool($innodbstats)
}

if $slavenotifications != undef {
validate_bool($slavenotifications)
}

if ($masterstats == true and $slavestats == true) {
fail('master and slave statistics are mutually exclusive.')
}
Expand Down
6 changes: 6 additions & 0 deletions templates/mysql-database.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
SlaveStats <%= @slavestats %>
<%- if @socket -%>
Socket "<%= @socket %>"
<%- end -%>
<%- if not @innodbstats.nil? -%>
InnodbStats <%= @innodbstats %>
<%- end -%>
<%- if not @slavenotifications.nil? -%>
SlaveNotifications <%= @slavenotifications %>
<%- end -%>
</Database>
</Plugin>

0 comments on commit e4e906e

Please sign in to comment.