diff options
author | Micah Anderson <micah@riseup.net> | 2012-03-07 11:52:15 -0500 |
---|---|---|
committer | Micah Anderson <micah@riseup.net> | 2012-03-07 11:52:15 -0500 |
commit | 56c06019530d7eeddbd36d033a153b191e74b465 (patch) | |
tree | 8b54c4338a86647ec4bd5aa1149ef2360efddb4b | |
parent | 084f0cfb671c4f29a8ccf7261fba38b6cabd8435 (diff) | |
parent | d66e58c32560d6d2cedea169d798c1494d80e1af (diff) |
Merge branch 'shared'
-rw-r--r-- | files/munin/mysql_connections | 40 | ||||
-rw-r--r-- | manifests/server/base.pp | 4 | ||||
-rw-r--r-- | manifests/server/munin/default.pp | 16 |
3 files changed, 46 insertions, 14 deletions
diff --git a/files/munin/mysql_connections b/files/munin/mysql_connections index 658b401..8ba9ee2 100644 --- a/files/munin/mysql_connections +++ b/files/munin/mysql_connections @@ -1,5 +1,21 @@ #!/usr/bin/perl # +# Copyright (C) 2008 Rackspace US, Inc. <http://www.rackspace.com> +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; version 2 dated June, +# 1991. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see http://www.gnu.org/licenses/gpl.txt +# +# # This plugin is based off of the Connection Usage # section of the MySQL Connection Health Page # @@ -83,7 +99,7 @@ sub poll_variables { sub print_graph_information { print <<EOM; graph_title MySQL Connections -graph_args --base 1000 -l 0 +graph_args --base 1000 --lower-limit 0 graph_vlabel Connections graph_info The number of current connections with respect to the max_connections setting. graph_category mysql @@ -106,20 +122,20 @@ sub test_service { system ("$MYSQLADMIN --version >/dev/null 2>/dev/null"); if ($? == 0) { - system ("$TEST_COMMAND >/dev/null 2>/dev/null"); - if ($? == 0) - { - print "yes\n"; - $return = 0; - } - else - { - print "no (could not connect to mysql)\n"; - } + system ("$TEST_COMMAND >/dev/null 2>/dev/null"); + if ($? == 0) + { + print "yes\n"; + $return = 0; + } + else + { + print "no (could not connect to mysql)\n"; + } } else { - print "no (mysqladmin not found)\n"; + print "no (mysqladmin not found)\n"; } exit $return; } diff --git a/manifests/server/base.pp b/manifests/server/base.pp index 5b00ddc..07b26b8 100644 --- a/manifests/server/base.pp +++ b/manifests/server/base.pp @@ -55,8 +55,8 @@ class mysql::server::base { } exec { 'mysql_set_rootpw': - command => "/usr/local/sbin/setmysqlpass.sh", - unless => "/usr/bin/mysqladmin -uroot status > /dev/null", + command => '/usr/local/sbin/setmysqlpass.sh', + unless => '/usr/bin/mysqladmin -uroot status > /dev/null', require => [ File['mysql_setmysqlpass.sh'], Package['mysql-server'] ], refreshonly => true, } diff --git a/manifests/server/munin/default.pp b/manifests/server/munin/default.pp index 2660ea0..130f3dc 100644 --- a/manifests/server/munin/default.pp +++ b/manifests/server/munin/default.pp @@ -25,4 +25,20 @@ class mysql::server::munin::default inherits mysql::server::munin::base { config => "env.mysqlopts --user=munin --password=${munin_mysql_password} -h localhost", require => [ Mysql_grant['munin@localhost'], Mysql_user['munin@localhost'], Package['mysql'] ]; } + + Munin::Plugin::Deploy { + config => "env.mysqlopts --user=munin --password=$munin_mysql_password -h localhost", + require => + [ Mysql_grant['munin@localhost'], + Mysql_user['munin@localhost'], + Package['mysql'] ] + } + munin::plugin::deploy{ + 'mysql_connections': + source => 'mysql/munin/mysql_connections'; + 'mysql_qcache': + source => 'mysql/munin/mysql_qcache'; + 'mysql_qcache_mem': + source => 'mysql/munin/mysql_qcache_mem'; + } } |