From 2d567bc6296bc210bd42ac37b4c76244ef07fe85 Mon Sep 17 00:00:00 2001 From: Arne Teuke Date: Mon, 31 Jul 2017 17:26:23 +0100 Subject: [PATCH] added parameter to enable or disable swap checking, as this can now be done better through cd_swap --- README.md | 2 +- manifests/client/target.pp | 3 +++ manifests/params.pp | 9 +++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 310badb..a7875a3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ |Repo Name| version | Build Status| |---|---|---|---| -|`cd_nagios`| 0.0.1.5 | [![Build Status](https://jenkins.confdroid.com/buildStatus/icon?job=cd_nagios)](https://jenkins.confdroid.com/job/cd_nagios/)| +|`cd_nagios`| 0.0.1.6 | [![Build Status](https://jenkins.confdroid.com/buildStatus/icon?job=cd_nagios)](https://jenkins.confdroid.com/job/cd_nagios/)| ### Synopsis Nagios is a powerful open source software solution for monitoring your IT environments. diff --git a/manifests/client/target.pp b/manifests/client/target.pp index 450af5e..56eeee7 100644 --- a/manifests/client/target.pp +++ b/manifests/client/target.pp @@ -63,6 +63,8 @@ class cd_nagios::client::target ( mode => '0640', } + if $ng_enable_swap_check == true { + @@nagios_service { "Swap_Usage_${::hostname}": ensure => $ng_swap_ensure, check_command => "check_nrpe!check_swap!${ng_swap_warn}!${ng_swap_crit}", @@ -77,6 +79,7 @@ class cd_nagios::client::target ( group => $ng_user, mode => '0640', } + } @@nagios_service { "Local_Users_${::hostname}": ensure => $ng_users_ensure, diff --git a/manifests/params.pp b/manifests/params.pp index 9f441fa..2b39230 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -644,6 +644,11 @@ # rampup_change - # of jobs to add to jobs_limit when ramping up # @param [string] ng_nrpe_port the port for NRPE. used by firewall and in # configuration file. +# @param [boolean] ng_enable_swap_check Whether to enable the declaration of +# the swap check. Disabling thi smakes sense when you use the `cd_swap` +# Puppet module and have enabled the check declaration from there, so the +# Nagios check is properly aligned to the Puppet module controlling the +# particular item. ############################################################################### class cd_nagios::params ( @@ -896,6 +901,10 @@ $ng_host_down_svc_checks = '0', $ng_enable_load_ctl_options = false, $ng_loadctl_options = 'jobs_max=100;backoff_limit=10;rampup_change=5', +# single nagios checks +$ng_enable_swap_check = true, + + ) { # installation section