diff options
author | Jerome Charaoui <jcharaoui@cmaisonneuve.qc.ca> | 2009-12-22 11:41:54 -0500 |
---|---|---|
committer | Jerome Charaoui <jcharaoui@cmaisonneuve.qc.ca> | 2009-12-22 11:41:54 -0500 |
commit | bd305f66b2daa377ef98e50e8632e1f22f4c426a (patch) | |
tree | bee93de364b3f0dd0caebf705ccb0e96ee177d37 /manifests | |
parent | b18a7ab8df99b4cf884ae186edd912c5e7ea2d69 (diff) |
adjust nagios mysql user to allow tcp connections
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/server/nagios.pp | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/manifests/server/nagios.pp b/manifests/server/nagios.pp index 147667f..4c1c153 100644 --- a/manifests/server/nagios.pp +++ b/manifests/server/nagios.pp @@ -4,25 +4,30 @@ class mysql::server::nagios { case $nagios_mysql_password { '': { fail("please specify \$nagios_mysql_password to enable nagios mysql check")} } - - mysql_user{'nagios@localhost': - password_hash => mysql_password("${nagios_mysql_password}"), - require => Package['mysql'], - } - - mysql_grant{'nagios@localhost': - privileges => 'select_priv', - require => [ Mysql_user['nagios@localhost'], Package['mysql'] ], - } # Flip this variable if you need to check MySQL through check_ssh or check_nrpe, # in that case you will have to manually define nagios::service::mysql if ($nagios_mysql_notcp != true) { + $nagios_mysql_user = 'nagios@%' nagios::service::mysql { 'mysql': check_hostname => $fqdn, check_username => 'nagios', check_password => $nagios_mysql_password, check_mode => 'tcp', + require => Mysql_grant[$nagios_mysql_user], } } + else { + $nagios_mysql_user = 'nagios@localhost' + } + + mysql_user{$nagios_mysql_user: + password_hash => mysql_password("${nagios_mysql_password}"), + require => Package['mysql'], + } + + mysql_grant{$nagios_mysql_user: + privileges => 'select_priv', + require => [ Mysql_user[$nagios_mysql_user], Package['mysql'] ], + } } |