summaryrefslogtreecommitdiff
path: root/manifests/server/nagios.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/server/nagios.pp')
-rw-r--r--manifests/server/nagios.pp48
1 files changed, 25 insertions, 23 deletions
diff --git a/manifests/server/nagios.pp b/manifests/server/nagios.pp
index 26644db..40bd0ee 100644
--- a/manifests/server/nagios.pp
+++ b/manifests/server/nagios.pp
@@ -1,28 +1,30 @@
# manifests/server/nagios.pp
-class mysql::server::nagios {
- # 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 (hiera('nagios_mysql_notcp',false) != true) {
- $nagios_mysql_user = 'nagios@%'
- nagios::service::mysql { 'connection-time':
- check_hostname => $::fqdn,
- require => Mysql_grant[$nagios_mysql_user],
- }
- }
- else {
- $nagios_mysql_user = 'nagios@localhost'
- }
+class mysql::server::nagios (
+ $nagios_mysql_notcp = hiera('nagios_mysql_notcp',false)
+) {
+ # 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 { 'connection-time':
+ check_hostname => $::fqdn,
+ require => Mysql_grant[$nagios_mysql_user],
+ }
+ }
+ else {
+ $nagios_mysql_user = 'nagios@localhost'
+ }
- mysql_user{$nagios_mysql_user:
- password_hash => trocla("mysql_nagios_${::fqdn}",'mysql','length: 32'),
- require => Package['mysql'],
- }
+ mysql_user{$nagios_mysql_user:
+ 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:
- privileges => [ 'select_priv', 'repl_client_priv' ],
- require => [ Mysql_user[$nagios_mysql_user], 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:
+ privileges => [ 'select_priv', 'repl_client_priv' ],
+ require => [ Mysql_user[$nagios_mysql_user], Package['mysql'] ],
+ }
}