diff options
Diffstat (limited to 'manifests/server/nagios.pp')
-rw-r--r-- | manifests/server/nagios.pp | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/manifests/server/nagios.pp b/manifests/server/nagios.pp index 28e52bb..39af429 100644 --- a/manifests/server/nagios.pp +++ b/manifests/server/nagios.pp @@ -1,28 +1,21 @@ -# manifests/server/nagios.pp - class mysql::server::nagios { - case $nagios_mysql_password { - '': { fail("please specify \$nagios_mysql_password to enable nagios mysql check")} - } - # 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) { + if $mysql::server::nagios_notcp { + $nagios_mysql_user = 'nagios@localhost' + } else { $nagios_mysql_user = 'nagios@%' nagios::service::mysql { 'connection-time': - check_host => $fqdn, + check_host => $::fqdn, require => Mysql_grant[$nagios_mysql_user], } } - else { - $nagios_mysql_user = 'nagios@localhost' - } - + mysql_user{$nagios_mysql_user: - password_hash => mysql_password("${nagios_mysql_password}"), + password_hash => trocla("mysql_nagios_${::fqdn}",'mysql','length: 32'), require => Package['mysql'], } - + # repl_client_priv is needed to check the replication slave status # modes: slave-lag, slave-io-running and slave-sql-running mysql_grant{$nagios_mysql_user: |