diff --git a/README.md b/README.md index 3001aa3..bcd7bf5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ |Repo Name| version | Build Status| |---|---|---|---| -|`cd_apache`| 0.0.1.7 | [![Build Status](https://pipelines.confdroid.com/buildStatus/icon?job=cd_apache)](https://pipelines.confdroid.com/job/cd_apache/)| +|`cd_apache`| 0.0.1.8 | [![Build Status](https://pipelines.confdroid.com/buildStatus/icon?job=cd_apache)](https://pipelines.confdroid.com/job/cd_apache/)| ### Synopsis `Apache httpd` is a very powerful and widely used web server. @@ -40,7 +40,7 @@ Configuration * file system permissions * selinux context * manage firewall settings (optional) - +* manage nagios monitoring (optional) Maintenance * manage the service diff --git a/manifests/main/config.pp b/manifests/main/config.pp index 4e18fcc..c23d2e7 100644 --- a/manifests/main/config.pp +++ b/manifests/main/config.pp @@ -26,5 +26,5 @@ class cd_apache::main::config ( ) inherits cd_apache::params { include cd_apache::server::service - + include cd_apache::monitoring::target } diff --git a/manifests/monitoring/target.pp b/manifests/monitoring/target.pp new file mode 100644 index 0000000..3ce65af --- /dev/null +++ b/manifests/monitoring/target.pp @@ -0,0 +1,47 @@ +## cd_apache::monitoring::target.pp +# Module name: cd_apache +# Author: Arne Teuke (arne_teuke@puppetsoft.com) +# License: +# This file is part of cd_apache. +# +# cd_apache is used for providing automatic configuration of +# +# Copyright (C) 2014 PuppetSoft (copyright@puppetsoft.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, either version 3 of the License, or +# (at your option) any later version. +# +# 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 . +# @summary class manages exports for nagios monitoring +############################################################################## +class cd_apache::monitoring::target ( + +) inherits cd_apache::params { + + case $ae_incl_target { + + false: { notify {'Nagios Service target for check_httpd has been disabled via parameters / ENC override': } + } + default: { + @@nagios_service { "check_http_${::hostname}": + check_command => 'check_http', + use => 'generic-service', + host_name => $::fqdn, + notification_period => '24x7', + service_description => "${::hostname}_check_http", + target => $ae_target_service, + owner => 'nagios', + group => 'nagios', + mode => '6640', + contacts => 'ops', + } + } + } +} diff --git a/manifests/params.pp b/manifests/params.pp index caee414..62ea1c6 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -54,6 +54,7 @@ # @param [boolean] ae_allow_user_dirs Whether or not to allow user directories # should be allowed to share content through httpd. Usually this is a security # problem and as such should be disabled. +# @param [boolean] ae_incl_target whether or not to allow nagios monitoring. ############################################################################## class cd_apache::params ( @@ -73,6 +74,10 @@ $ae_manage_cfg = false, $ae_manage_dirs = true, $ae_allow_user_dirs = false, +# nagios +$ae_incl_target = true, +$ae_target_service = '/etc/nagios/conf.d/httpd_service.cfg', + ) { # installation section