diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f1790e..f10e16f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,16 @@ Changelog of Git Changelog.

No issue

+0564cc970be1899 Jenkins Server 2017-07-26 14:27:43 +

+

recommit for updates in build 105

+ +

+12f835aa4ff29bd Arne Teuke 2017-07-26 14:27:16 +

+

added and linked base contactgroups

+ +

af34a0587d9f48e Jenkins Server 2017-07-26 13:05:02

recommit for updates in build 104

diff --git a/REPOSTRUCTURE.md b/REPOSTRUCTURE.md index 503e65a..0f2b935 100644 --- a/REPOSTRUCTURE.md +++ b/REPOSTRUCTURE.md @@ -20,6 +20,7 @@ | | |-- cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_contact_rules.html | | |-- cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Acommands.html | | |-- cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aconfig.html +| | |-- cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Acontactgroups.html | | |-- cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Acontacts.html | | |-- cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Atemplate_rules.html | | |-- cd_nagios_3A_3Aparams.html @@ -53,6 +54,8 @@ | | `-- user.pp | |-- nagios | | `-- objects +| | |-- add_contactgroups.pp +| | |-- add_contactgroups_rules.pp | | |-- add_contact.pp | | |-- add_contact_rules.pp | | |-- commands.pp @@ -81,7 +84,9 @@ | | `-- nagios_ssl_vhost.erb | |-- nagios | | |-- cgi_cfg.erb -| | |-- contacts_cfg.erb +| | |-- contactgroups_cfg_head.erb +| | |-- contactgroups_cfg_rule.erb +| | |-- contacts.cfg | | |-- contacts_cfg_head.erb | | |-- contacts_cfg_rule.erb | | |-- htpasswd_rule.erb @@ -101,4 +106,4 @@ |-- README.md `-- REPOSTRUCTURE.md -20 directories, 81 files +20 directories, 86 files diff --git a/doc/_index.html b/doc/_index.html index 09f03f3..8478f55 100644 --- a/doc/_index.html +++ b/doc/_index.html @@ -113,6 +113,11 @@ +
  • + cd_nagios::nagios::objects::add_contactgroups_rules + +
  • +
  • cd_nagios::nagios::objects::commands @@ -188,6 +193,11 @@
  • +
  • + cd_nagios::nagios::objects::add_contactgroups + +
  • +
  • cd_nagios::nagios::objects::templates @@ -226,7 +236,7 @@ diff --git a/doc/file.README.html b/doc/file.README.html index 6cf1c19..7dce3b7 100644 --- a/doc/file.README.html +++ b/doc/file.README.html @@ -352,7 +352,7 @@ environments.

    diff --git a/doc/index.html b/doc/index.html index 52fc89e..29e9606 100644 --- a/doc/index.html +++ b/doc/index.html @@ -352,7 +352,7 @@ environments.

    diff --git a/doc/puppet_class_list.html b/doc/puppet_class_list.html index da17fd5..c08ca8f 100644 --- a/doc/puppet_class_list.html +++ b/doc/puppet_class_list.html @@ -103,70 +103,77 @@
  • -
  • +
  • +
    + cd_nagios::nagios::objects::add_contactgroups_rules +
    +
  • + + +
  • cd_nagios::nagios::objects::commands
  • -
  • +
  • cd_nagios::nagios::objects::config
  • -
  • +
  • cd_nagios::nagios::objects::contactgroups
  • -
  • +
  • cd_nagios::nagios::objects::contacts
  • -
  • +
  • cd_nagios::nagios::objects::template_rules
  • -
  • +
  • cd_nagios::params
  • -
  • +
  • cd_nagios::selinux::config
  • -
  • +
  • cd_nagios::server::access_rules
  • -
  • +
  • cd_nagios::server::files
  • -
  • +
  • cd_nagios::server::service
    diff --git a/doc/puppet_classes/cd_nagios.html b/doc/puppet_classes/cd_nagios.html index bf5f35a..346486e 100644 --- a/doc/puppet_classes/cd_nagios.html +++ b/doc/puppet_classes/cd_nagios.html @@ -139,7 +139,7 @@ class cd_nagios { diff --git a/doc/puppet_classes/cd_nagios_3A_3Acertbot_3A_3Acerts.html b/doc/puppet_classes/cd_nagios_3A_3Acertbot_3A_3Acerts.html index f966992..a416ddb 100644 --- a/doc/puppet_classes/cd_nagios_3A_3Acertbot_3A_3Acerts.html +++ b/doc/puppet_classes/cd_nagios_3A_3Acertbot_3A_3Acerts.html @@ -230,7 +230,7 @@ class cd_nagios::certbot::certs ( diff --git a/doc/puppet_classes/cd_nagios_3A_3Aclient_3A_3Atarget.html b/doc/puppet_classes/cd_nagios_3A_3Aclient_3A_3Atarget.html index d6fcfe6..919c8d4 100644 --- a/doc/puppet_classes/cd_nagios_3A_3Aclient_3A_3Atarget.html +++ b/doc/puppet_classes/cd_nagios_3A_3Aclient_3A_3Atarget.html @@ -368,7 +368,7 @@ class cd_nagios::client::target ( diff --git a/doc/puppet_classes/cd_nagios_3A_3Afirewall_3A_3Aiptables.html b/doc/puppet_classes/cd_nagios_3A_3Afirewall_3A_3Aiptables.html index f4372f6..f44065f 100644 --- a/doc/puppet_classes/cd_nagios_3A_3Afirewall_3A_3Aiptables.html +++ b/doc/puppet_classes/cd_nagios_3A_3Afirewall_3A_3Aiptables.html @@ -207,7 +207,7 @@ class cd_nagios::firewall::iptables ( diff --git a/doc/puppet_classes/cd_nagios_3A_3Amain_3A_3Aconfig.html b/doc/puppet_classes/cd_nagios_3A_3Amain_3A_3Aconfig.html index e960de5..d237917 100644 --- a/doc/puppet_classes/cd_nagios_3A_3Amain_3A_3Aconfig.html +++ b/doc/puppet_classes/cd_nagios_3A_3Amain_3A_3Aconfig.html @@ -195,7 +195,7 @@ class cd_nagios::main::config ( diff --git a/doc/puppet_classes/cd_nagios_3A_3Amain_3A_3Adirs.html b/doc/puppet_classes/cd_nagios_3A_3Amain_3A_3Adirs.html index 3724a8d..b1d8477 100644 --- a/doc/puppet_classes/cd_nagios_3A_3Amain_3A_3Adirs.html +++ b/doc/puppet_classes/cd_nagios_3A_3Amain_3A_3Adirs.html @@ -468,7 +468,7 @@ class cd_nagios::main::dirs ( diff --git a/doc/puppet_classes/cd_nagios_3A_3Amain_3A_3Ainstall.html b/doc/puppet_classes/cd_nagios_3A_3Amain_3A_3Ainstall.html index d8d9035..18fbd6b 100644 --- a/doc/puppet_classes/cd_nagios_3A_3Amain_3A_3Ainstall.html +++ b/doc/puppet_classes/cd_nagios_3A_3Amain_3A_3Ainstall.html @@ -235,7 +235,7 @@ class cd_nagios::main::install ( diff --git a/doc/puppet_classes/cd_nagios_3A_3Amain_3A_3Auser.html b/doc/puppet_classes/cd_nagios_3A_3Amain_3A_3Auser.html index 9f784b7..22f1adc 100644 --- a/doc/puppet_classes/cd_nagios_3A_3Amain_3A_3Auser.html +++ b/doc/puppet_classes/cd_nagios_3A_3Amain_3A_3Auser.html @@ -200,7 +200,7 @@ class cd_nagios::main::user ( diff --git a/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_contact_rules.html b/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_contact_rules.html index 3cd4e8d..1cf422b 100644 --- a/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_contact_rules.html +++ b/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_contact_rules.html @@ -210,7 +210,7 @@ class cd_nagios::nagios::objects::add_contact_rules ( diff --git a/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_contactgroups_rules.html b/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_contactgroups_rules.html new file mode 100644 index 0000000..4ef20c9 --- /dev/null +++ b/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_contactgroups_rules.html @@ -0,0 +1,237 @@ + + + + + + + Puppet Class: cd_nagios::nagios::objects::add_contactgroups_rules + + — Documentation by YARD 0.9.9 + + + + + + + + + + + + + + + + + + + +
    + + +

    Puppet Class: cd_nagios::nagios::objects::add_contactgroups_rules

    +
    + +
    +
    Inherits:
    +
    cd_nagios::params
    +
    + + +
    +
    Defined in:
    +
    + manifests/nagios/objects/add_contactgroups_rules.pp +
    +
    +
    + +

    Summary

    + Class manages /etc/nagios/conf.d/nagios_add_contactgroups.cfg file +and populates through define and external puppet rules + +

    Overview

    +
    +
    + +

    cd_nagios::nagios::objects::add_contactgroups_rules.pp +Module name: +cd_nagios +Author: Arne Teuke (arne_teuke@ConfDroid.com)

    + +

    License:

    + +

    This file is part of cd_nagios.

    + +

    cd_nagios is used for providing automatic configuration of Nagios + +Copyright (C) 2016 ConfDroid (copyright@ConfDroid.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 www.gnu.org/licenses/.

    + +
    +
    +
    + +
    +

    Examples:

    + + +
    cd_nagios::nagios::objects::add_contactgroups { 'example_group':
    +  ng_contactgroup_name      =>  'example_group',
    +  ng_contactgroup_alias     =>  'Example Group',
    +  ng_contactgroup_register  =>  '1',
    +}
    + +
    + + +
    + + + + + +
    +
    +
    +
    +30
    +31
    +32
    +33
    +34
    +35
    +36
    +37
    +38
    +39
    +40
    +41
    +42
    +43
    +44
    +45
    +46
    +47
    +48
    +49
    +50
    +51
    +52
    +53
    +54
    +55
    +56
    +57
    +58
    +59
    +60
    +61
    +62
    +63
    +64
    +65
    +66
    +
    +
    # File 'manifests/nagios/objects/add_contactgroups_rules.pp', line 30
    +
    +class cd_nagios::nagios::objects::add_contactgroups_rules (
    +
    +
    +) inherits cd_nagios::params {
    +
    +  if $::fqdn == $ng_nagios_server {
    +
    +    # manage /etc/nagios/conf.d/nagios_add_contactgroups.cfg
    +
    +    concat { $ng_tgt_contactgroup_add:
    +      ensure    =>  present,
    +      path      =>  $ng_tgt_contactgroup_add,
    +      owner     =>  $ng_user,
    +      group     =>  $ng_user,
    +      mode      =>  '0640',
    +      selrange  =>  s0,
    +      selrole   =>  object_r,
    +      seltype   =>  nagios_etc_t,
    +      seluser   =>  system_u,
    +      notify    =>  Service[$ng_service],
    +    }
    +
    +    # manage file header
    +
    +    concat::fragment { 'contactgroups_header':
    +      target    =>  $ng_tgt_contactgroup_add,
    +      content   =>  template($ng_cntctgrps_head_erb),
    +      order     =>  '000',
    +    }
    +
    +    cd_nagios::nagios::objects::add_contactgroups { 'example_group':
    +      ng_contactgroup_name      =>  'example_group',
    +      ng_contactgroup_alias     =>  'Example Group',
    +      ng_contactgroup_register  =>  '1',
    +    }
    +  }
    +}
    +
    +
    +
    + + + +
    + + \ No newline at end of file diff --git a/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Acommands.html b/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Acommands.html index a56539c..4400851 100644 --- a/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Acommands.html +++ b/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Acommands.html @@ -595,7 +595,7 @@ class cd_nagios::nagios::objects::commands ( diff --git a/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aconfig.html b/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aconfig.html index f333b86..5b2979c 100644 --- a/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aconfig.html +++ b/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aconfig.html @@ -168,7 +168,7 @@ class cd_nagios::nagios::objects::config ( diff --git a/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Acontactgroups.html b/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Acontactgroups.html index 9b6a8e9..b0949be 100644 --- a/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Acontactgroups.html +++ b/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Acontactgroups.html @@ -76,6 +76,9 @@ +

    Summary

    + Class manages base contactgroups which always should be there. +

    Overview

    @@ -118,6 +121,23 @@ href="http://www.gnu.org/licenses">www.gnu.org/licenses/

    +
    +

    Examples:

    + + +
    @@nagios_contactgroup { 'admins':
    +  ensure              =>  present,
    +  alias               =>  'Nagios Administrators',
    +  contactgroup_name   =>  'admins',
    +  owner               =>  $ng_user,
    +  group               =>  $ng_user,
    +  mode                =>  '0640',
    +  register            =>  '1',
    +  target              =>  $ng_tgt_contactgroup_base,
    +}
    + +
    +
    @@ -126,18 +146,6 @@ href="http://www.gnu.org/licenses">www.gnu.org/licenses/

     
     
    -22
    -23
    -24
    -25
    -26
    -27
    -28
    -29
    -30
    -31
    -32
    -33
     34
     35
     36
    @@ -165,10 +173,22 @@ href="http://www.gnu.org/licenses">www.gnu.org/licenses/

    58 59 60 -61
    +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73
    -
    # File 'manifests/nagios/objects/contactgroups.pp', line 22
    +        
    # File 'manifests/nagios/objects/contactgroups.pp', line 34
     
     class cd_nagios::nagios::objects::contactgroups (
     
    @@ -217,7 +237,7 @@ class cd_nagios::nagios::objects::contactgroups (
     
     
           
    diff --git a/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Acontacts.html b/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Acontacts.html
    index a230b6d..f3b9c1d 100644
    --- a/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Acontacts.html
    +++ b/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Acontacts.html
    @@ -280,7 +280,7 @@ class cd_nagios::nagios::objects::contacts (
     
     
           
    diff --git a/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Atemplate_rules.html b/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Atemplate_rules.html
    index b68cd21..4a25944 100644
    --- a/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Atemplate_rules.html
    +++ b/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Atemplate_rules.html
    @@ -305,7 +305,7 @@ class cd_nagios::nagios::objects::template_rules (
     
     
           
    diff --git a/doc/puppet_classes/cd_nagios_3A_3Aparams.html b/doc/puppet_classes/cd_nagios_3A_3Aparams.html
    index 19370f0..90d106e 100644
    --- a/doc/puppet_classes/cd_nagios_3A_3Aparams.html
    +++ b/doc/puppet_classes/cd_nagios_3A_3Aparams.html
    @@ -101,6 +101,8 @@
           
           cd_nagios::nagios::objects::add_contact_rules
    + cd_nagios::nagios::objects::add_contactgroups_rules
    + @@ -5218,7 +5220,10 @@ up

    983 984 985 -986
    +986 +987 +988 +989
    # File 'manifests/params.pp', line 646
    @@ -5556,6 +5561,9 @@ $ng_target_add_contact    = "${ng_conf_d_dir}/nagios_add_contact.cfg"
     $ng_contacts_head_erb     = 'cd_nagios/nagios/contacts_cfg_head.erb'
     $ng_contacts_rule_erb     = 'cd_nagios/nagios/contacts_cfg_rule.erb'
     $ng_tgt_contactgroup_base = "${ng_conf_d_dir}/nagios_contactgroup_base.cfg"
    +$ng_tgt_contactgroup_add  = "${ng_conf_d_dir}/nagios_contactgroup_add.cfg"
    +$ng_cntctgrps_head_erb    = 'cd_nagios/nagios/contactgroups_cfg_head.erb'
    +$ng_cntctgrps_rule_erb    = 'cd_nagios/nagios/contactgroups_cfg_rule.erb'
     $ng_target_command        = "${ng_conf_d_dir}/nagios_command.cfg"
     
     
    @@ -5571,7 +5579,7 @@ $ng_target_command        = "${ng_conf_d_dir}/nagios_command.cfg"
     
     
           
    diff --git a/doc/puppet_classes/cd_nagios_3A_3Aselinux_3A_3Aconfig.html b/doc/puppet_classes/cd_nagios_3A_3Aselinux_3A_3Aconfig.html
    index 674b170..0cee954 100644
    --- a/doc/puppet_classes/cd_nagios_3A_3Aselinux_3A_3Aconfig.html
    +++ b/doc/puppet_classes/cd_nagios_3A_3Aselinux_3A_3Aconfig.html
    @@ -249,7 +249,7 @@ class cd_nagios::selinux::config (
     
     
           
    diff --git a/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Aaccess_rules.html b/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Aaccess_rules.html
    index f8a3fb6..3149bed 100644
    --- a/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Aaccess_rules.html
    +++ b/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Aaccess_rules.html
    @@ -195,7 +195,7 @@ class cd_nagios::server::access_rules (
     
     
           
    diff --git a/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Afiles.html b/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Afiles.html
    index 9907b6a..9e0f31f 100644
    --- a/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Afiles.html
    +++ b/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Afiles.html
    @@ -334,7 +334,7 @@ class cd_nagios::server::files (
     
     
           
    diff --git a/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Aservice.html b/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Aservice.html
    index 09a2eb0..97370a8 100644
    --- a/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Aservice.html
    +++ b/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Aservice.html
    @@ -268,7 +268,7 @@ class cd_nagios::server::service (
     
     
           
    diff --git a/doc/puppet_defined_type_list.html b/doc/puppet_defined_type_list.html
    index c86cc98..fa9c994 100644
    --- a/doc/puppet_defined_type_list.html
    +++ b/doc/puppet_defined_type_list.html
    @@ -47,14 +47,21 @@
         
         
     
    -    
  • +
  • + +
  • + + +
  • -
  • +
  • diff --git a/doc/puppet_defined_types/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_contact.html b/doc/puppet_defined_types/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_contact.html index 5695054..c158f1b 100644 --- a/doc/puppet_defined_types/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_contact.html +++ b/doc/puppet_defined_types/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_contact.html @@ -247,7 +247,7 @@ $ng_contacts_rule_erb = $::cd_nagios::params::ng_contacts_rule_erb diff --git a/doc/puppet_defined_types/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_contactgroups.html b/doc/puppet_defined_types/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_contactgroups.html new file mode 100644 index 0000000..f1c0f10 --- /dev/null +++ b/doc/puppet_defined_types/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_contactgroups.html @@ -0,0 +1,227 @@ + + + + + + + Defined Type: cd_nagios::nagios::objects::add_contactgroups + + — Documentation by YARD 0.9.9 + + + + + + + + + + + + + + + + + + + +
    + + +

    Defined Type: cd_nagios::nagios::objects::add_contactgroups

    +
    +
    +
    Defined in:
    +
    + manifests/nagios/objects/add_contactgroups.pp +
    +
    +
    + +

    Summary

    + Define populates /etc/nagios/conf.d/nagios_add_contactgroups through +external puppet rules. + +

    Overview

    +
    +
    + +

    cd_nagios::nagios::objects::add_contactgroups.pp +Module name: +cd_nagios +Author: Arne Teuke (arne_teuke@ConfDroid.com)

    + +

    License:

    + +

    This file is part of cd_nagios.

    + +

    cd_nagios is used for providing automatic configuration of Nagios + +Copyright (C) 2016 ConfDroid (copyright@ConfDroid.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 www.gnu.org/licenses/

    + +
    +
    +
    +

    Parameters:

    +
      + +
    • + + ng_contactgroup_name + + + (Any) + + + (defaults to: undef) + + +
    • + +
    • + + ng_contactgroup_alias + + + (Any) + + + (defaults to: undef) + + +
    • + +
    • + + ng_contactgroup_register + + + (Any) + + + (defaults to: '1') + + +
    • + +
    + + +
    + + + + + +
    +
    +
    +
    +24
    +25
    +26
    +27
    +28
    +29
    +30
    +31
    +32
    +33
    +34
    +35
    +36
    +37
    +38
    +39
    +40
    +41
    +42
    +43
    +
    +
    # File 'manifests/nagios/objects/add_contactgroups.pp', line 24
    +
    +define cd_nagios::nagios::objects::add_contactgroups (
    +
    +$ng_contactgroup_name     = undef,
    +$ng_contactgroup_alias    = undef,
    +$ng_contactgroup_register = '1',
    +
    +) {
    +
    +$ng_nagios_server         = $::cd_nagios::params::ng_nagios_server
    +$ng_tgt_contactgroup_add  = $::cd_nagios::params::ng_tgt_contactgroup_add
    +
    +
    +  if $::fqdn == $ng_nagios_server {
    +
    +    concat::fragment { $name:
    +      target    =>  $ng_tgt_contactgroup_add,
    +      content   =>  template($ng_contacts_rule_erb),
    +    }
    +  }
    +}
    +
    +
    +
    + + + +
    + + \ No newline at end of file diff --git a/doc/puppet_defined_types/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Atemplates.html b/doc/puppet_defined_types/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Atemplates.html index e2e06ec..052b4cd 100644 --- a/doc/puppet_defined_types/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Atemplates.html +++ b/doc/puppet_defined_types/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Atemplates.html @@ -935,7 +935,7 @@ $ng_templates_rule_erb = $::cd_nagios::params::ng_templates_rule_erb diff --git a/doc/puppet_defined_types/cd_nagios_3A_3Aserver_3A_3Aaccess.html b/doc/puppet_defined_types/cd_nagios_3A_3Aserver_3A_3Aaccess.html index 9e75a34..9d108ac 100644 --- a/doc/puppet_defined_types/cd_nagios_3A_3Aserver_3A_3Aaccess.html +++ b/doc/puppet_defined_types/cd_nagios_3A_3Aserver_3A_3Aaccess.html @@ -220,7 +220,7 @@ $ng_service = $::cd_nagios::params::ng_service diff --git a/doc/top-level-namespace.html b/doc/top-level-namespace.html index f0c25a4..1a19bb7 100644 --- a/doc/top-level-namespace.html +++ b/doc/top-level-namespace.html @@ -90,7 +90,7 @@ diff --git a/manifests/nagios/objects/add_contactgroups.pp b/manifests/nagios/objects/add_contactgroups.pp new file mode 100644 index 0000000..b5e6fb0 --- /dev/null +++ b/manifests/nagios/objects/add_contactgroups.pp @@ -0,0 +1,43 @@ +## cd_nagios::nagios::objects::add_contactgroups.pp +# Module name: cd_nagios +# Author: Arne Teuke (arne_teuke@ConfDroid.com) +# # License: +# This file is part of cd_nagios. +# +# cd_nagios is used for providing automatic configuration of Nagios +# Copyright (C) 2016 ConfDroid (copyright@ConfDroid.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 Define populates /etc/nagios/conf.d/nagios_add_contactgroups through +# external puppet rules. +################################################################################ +define cd_nagios::nagios::objects::add_contactgroups ( + +$ng_contactgroup_name = undef, +$ng_contactgroup_alias = undef, +$ng_contactgroup_register = '1', + +) { + +$ng_nagios_server = $::cd_nagios::params::ng_nagios_server +$ng_tgt_contactgroup_add = $::cd_nagios::params::ng_tgt_contactgroup_add + + + if $::fqdn == $ng_nagios_server { + + concat::fragment { $name: + target => $ng_tgt_contactgroup_add, + content => template($ng_contacts_rule_erb), + } + } +} diff --git a/manifests/nagios/objects/add_contactgroups_rules.pp b/manifests/nagios/objects/add_contactgroups_rules.pp new file mode 100644 index 0000000..a1d83fc --- /dev/null +++ b/manifests/nagios/objects/add_contactgroups_rules.pp @@ -0,0 +1,66 @@ +## cd_nagios::nagios::objects::add_contactgroups_rules.pp +# Module name: cd_nagios +# Author: Arne Teuke (arne_teuke@ConfDroid.com) +# # License: +# This file is part of cd_nagios. +# +# cd_nagios is used for providing automatic configuration of Nagios +# Copyright (C) 2016 ConfDroid (copyright@ConfDroid.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 /etc/nagios/conf.d/nagios_add_contactgroups.cfg file +# and populates through define and external puppet rules +# @example +# cd_nagios::nagios::objects::add_contactgroups { 'example_group': +# ng_contactgroup_name => 'example_group', +# ng_contactgroup_alias => 'Example Group', +# ng_contactgroup_register => '1', +# } +################################################################################ +class cd_nagios::nagios::objects::add_contactgroups_rules ( + + +) inherits cd_nagios::params { + + if $::fqdn == $ng_nagios_server { + + # manage /etc/nagios/conf.d/nagios_add_contactgroups.cfg + + concat { $ng_tgt_contactgroup_add: + ensure => present, + path => $ng_tgt_contactgroup_add, + owner => $ng_user, + group => $ng_user, + mode => '0640', + selrange => s0, + selrole => object_r, + seltype => nagios_etc_t, + seluser => system_u, + notify => Service[$ng_service], + } + + # manage file header + + concat::fragment { 'contactgroups_header': + target => $ng_tgt_contactgroup_add, + content => template($ng_cntctgrps_head_erb), + order => '000', + } + + cd_nagios::nagios::objects::add_contactgroups { 'example_group': + ng_contactgroup_name => 'example_group', + ng_contactgroup_alias => 'Example Group', + ng_contactgroup_register => '1', + } + } +} diff --git a/manifests/nagios/objects/contactgroups.pp b/manifests/nagios/objects/contactgroups.pp index 0697db5..a324c33 100644 --- a/manifests/nagios/objects/contactgroups.pp +++ b/manifests/nagios/objects/contactgroups.pp @@ -18,6 +18,18 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see +# @summary Class manages base contactgroups which always should be there. +# @example +# @@nagios_contactgroup { 'admins': +# ensure => present, +# alias => 'Nagios Administrators', +# contactgroup_name => 'admins', +# owner => $ng_user, +# group => $ng_user, +# mode => '0640', +# register => '1', +# target => $ng_tgt_contactgroup_base, +# } ################################################################################ class cd_nagios::nagios::objects::contactgroups ( diff --git a/manifests/params.pp b/manifests/params.pp index 37d50c5..1589b8a 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -976,6 +976,9 @@ $ng_target_add_contact = "${ng_conf_d_dir}/nagios_add_contact.cfg" $ng_contacts_head_erb = 'cd_nagios/nagios/contacts_cfg_head.erb' $ng_contacts_rule_erb = 'cd_nagios/nagios/contacts_cfg_rule.erb' $ng_tgt_contactgroup_base = "${ng_conf_d_dir}/nagios_contactgroup_base.cfg" +$ng_tgt_contactgroup_add = "${ng_conf_d_dir}/nagios_contactgroup_add.cfg" +$ng_cntctgrps_head_erb = 'cd_nagios/nagios/contactgroups_cfg_head.erb' +$ng_cntctgrps_rule_erb = 'cd_nagios/nagios/contactgroups_cfg_rule.erb' $ng_target_command = "${ng_conf_d_dir}/nagios_command.cfg" diff --git a/templates/nagios/contactgroups_cfg_head.erb b/templates/nagios/contactgroups_cfg_head.erb new file mode 100644 index 0000000..31e8a7b --- /dev/null +++ b/templates/nagios/contactgroups_cfg_head.erb @@ -0,0 +1,8 @@ +############################################################################### +########## nagios_add_contactgroups.cfg created by Puppet ########## +########## manual changes are overwritten! ########## +############################################################################### +########## Full reference file available at ########## +########## https://confdroid.com/2017/07/nagios-contacts-cfg/ ########## +############################################################################### +# rules are created below by external puppet rules. diff --git a/templates/nagios/contactgroups_cfg_rule.erb b/templates/nagios/contactgroups_cfg_rule.erb new file mode 100644 index 0000000..f4bbd98 --- /dev/null +++ b/templates/nagios/contactgroups_cfg_rule.erb @@ -0,0 +1,5 @@ +define contactgroup { + contactgroup_name <%= @ng_contactgroup_name %> + alias <%= @ng_contactgroup_alias %> + register <%= @ng_contactgroup_register %> + } diff --git a/templates/nagios/contacts_cfg.erb b/templates/nagios/contacts.cfg similarity index 100% rename from templates/nagios/contacts_cfg.erb rename to templates/nagios/contacts.cfg