diff --git a/CHANGELOG.md b/CHANGELOG.md index be07db2..0c1c9b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,16 @@ Changelog of Git Changelog.

No issue

+f4321e6da976742 Jenkins Server 2017-07-27 11:58:59 +

+

recommit for updates in build 113

+ +

+842d86a504f6198 Arne Teuke 2017-07-27 11:58:30 +

+

added _ to service name

+ +

cad8229c0821ad4 Jenkins Server 2017-07-27 11:44:51

recommit for updates in build 112

diff --git a/REPOSTRUCTURE.md b/REPOSTRUCTURE.md index 9f04939..f6ea7f2 100644 --- a/REPOSTRUCTURE.md +++ b/REPOSTRUCTURE.md @@ -61,6 +61,8 @@ | | |-- add_contactgroups_rules.pp | | |-- add_contact.pp | | |-- add_contact_rules.pp +| | |-- add_hostgroup_rules.pp +| | |-- add_hostgroups.pp | | |-- commands.pp | | |-- config.pp | | |-- contactgroups.pp @@ -93,6 +95,8 @@ | | |-- contacts.cfg | | |-- contacts_cfg_head.erb | | |-- contacts_cfg_rule.erb +| | |-- hostgroups_cfg_head.erb +| | |-- hostgroups_cfg_rule.erb | | |-- htpasswd_rule.erb | | |-- nagios_cfg.erb | | |-- templates_cfg_head.erb @@ -110,4 +114,4 @@ |-- README.md `-- REPOSTRUCTURE.md -20 directories, 90 files +20 directories, 94 files diff --git a/doc/_index.html b/doc/_index.html index 1213a05..94645b2 100644 --- a/doc/_index.html +++ b/doc/_index.html @@ -118,6 +118,11 @@ +
  • + cd_nagios::nagios::objects::add_hostgroup_rules + +
  • +
  • cd_nagios::nagios::objects::commands @@ -203,6 +208,11 @@
  • +
  • + cd_nagios::nagios::objects::add_hostgroups + +
  • +
  • cd_nagios::nagios::objects::templates @@ -241,7 +251,7 @@ diff --git a/doc/file.README.html b/doc/file.README.html index 2762048..7705114 100644 --- a/doc/file.README.html +++ b/doc/file.README.html @@ -365,7 +365,7 @@ environments.

    diff --git a/doc/index.html b/doc/index.html index 75e05c2..2df62c7 100644 --- a/doc/index.html +++ b/doc/index.html @@ -365,7 +365,7 @@ environments.

    diff --git a/doc/puppet_class_list.html b/doc/puppet_class_list.html index dc13577..2478cf3 100644 --- a/doc/puppet_class_list.html +++ b/doc/puppet_class_list.html @@ -110,77 +110,84 @@
  • -
  • +
  • +
    + cd_nagios::nagios::objects::add_hostgroup_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::hostgroups
  • -
  • +
  • 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 738410e..78ff566 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 c0cd695..88f7603 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 66d0021..3de9aee 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 2ce847a..c63b675 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 55e3eaa..896ee68 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 924243c..7c1728f 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 2be108a..50f98f6 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 998f6a5..fecb239 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 cf5ddab..7ca4b70 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 index eca2419..4abbac9 100644 --- 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 @@ -227,7 +227,7 @@ class cd_nagios::nagios::objects::add_contactgroups_rules ( diff --git a/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_hostgroup_rules.html b/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_hostgroup_rules.html new file mode 100644 index 0000000..8a84cf0 --- /dev/null +++ b/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_hostgroup_rules.html @@ -0,0 +1,234 @@ + + + + + + + Puppet Class: cd_nagios::nagios::objects::add_hostgroup_rules + + — Documentation by YARD 0.9.9 + + + + + + + + + + + + + + + + + + + +
    + + +

    Puppet Class: cd_nagios::nagios::objects::add_hostgroup_rules

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

    Summary

    + Class manages /etc/nagios_conf.d/nagios_hostgroups_add.cfg and +additional hostgroups through external Puppet rules via define. + +

    Overview

    +
    +
    + +

    cd_nagios::nagios::objects::add_hostgroup_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_hostgroups { 'example_hostgroup':
    +  ng_hostgroup_name   =>  'example_hostgroup',
    +  ng_hostgroup_alias  =>  'Example Hostgroup',
    +}
    + +
    + + +
    + + + + + +
    +
    +
    +
    +29
    +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
    +
    +
    # File 'manifests/nagios/objects/add_hostgroup_rules.pp', line 29
    +
    +class cd_nagios::nagios::objects::add_hostgroup_rules (
    +
    +
    +) inherits cd_nagios::params {
    +
    +  if $::fqdn == $ng_nagios_server {
    +
    +    # manage /etc/nagios_conf.d/nagios_hostgroups_add.cfg
    +
    +    concat { $ng_tgt_hostgroup_add:
    +      ensure    =>  present,
    +      path      =>  $ng_tgt_hostgroup_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 { 'hostgroups_header':
    +      target    =>  $ng_tgt_hostgroup_add,
    +      content   =>  template($ng_tgt_hostgrp_head_erb),
    +      order     =>  '000',
    +    }
    +
    +   cd_nagios::nagios::objects::add_hostgroups { 'example_hostgroup':
    +     ng_hostgroup_name   =>  'example_hostgroup',
    +     ng_hostgroup_alias  =>  'Example Hostgroup',
    +   }
    +  }
    +}
    +
    +
    +
    + + + +
    + + \ 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 b85570c..804b423 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 3a59d84..bb4c8fd 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 @@ -144,7 +144,8 @@ href="http://www.gnu.org/licenses">www.gnu.org/licenses/.

    35 36 37 -38 +38 +39
    # File 'manifests/nagios/objects/config.pp', line 23
    @@ -162,6 +163,7 @@ class cd_nagios::nagios::objects::config (
         require cd_nagios::nagios::objects::contactgroups
         require cd_nagios::nagios::objects::add_contactgroups_rules
         require cd_nagios::nagios::objects::hostgroups
    +    require cd_nagios::nagios::objects::add_hostgroup_rules
     
       }
     }
    @@ -172,7 +174,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 42a3e41..863a245 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 @@ -237,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 2993bb7..4602a04 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_3Ahostgroups.html b/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Ahostgroups.html index 92fb1d1..0a1ca7c 100644 --- a/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Ahostgroups.html +++ b/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Ahostgroups.html @@ -356,7 +356,7 @@ class cd_nagios::nagios::objects::hostgroups ( group => $ng_user, mode => '0640', register => '1', - target => $ng_target_hostgroup, + target => $ng_target_hostgroup_base, } @@ -370,7 +370,7 @@ class cd_nagios::nagios::objects::hostgroups ( group => $ng_user, mode => '0640', register => '1', - target => $ng_target_hostgroup, + target => $ng_target_hostgroup_base, } # CentOS servers @@ -383,7 +383,7 @@ class cd_nagios::nagios::objects::hostgroups ( group => $ng_user, mode => '0640', register => '1', - target => $ng_target_hostgroup, + target => $ng_target_hostgroup_base, } # SuSE servers @@ -396,7 +396,7 @@ class cd_nagios::nagios::objects::hostgroups ( group => $ng_user, mode => '0640', register => '1', - target => $ng_target_hostgroup, + target => $ng_target_hostgroup_base, } # Unix servers @@ -409,7 +409,7 @@ class cd_nagios::nagios::objects::hostgroups ( group => $ng_user, mode => '0640', register => '1', - target => $ng_target_hostgroup, + target => $ng_target_hostgroup_base, } # Solaris servers @@ -422,7 +422,7 @@ class cd_nagios::nagios::objects::hostgroups ( group => $ng_user, mode => '0640', register => '1', - target => $ng_target_hostgroup, + target => $ng_target_hostgroup_base, } # AIX servers @@ -435,7 +435,7 @@ class cd_nagios::nagios::objects::hostgroups ( group => $ng_user, mode => '0640', register => '1', - target => $ng_target_hostgroup, + target => $ng_target_hostgroup_base, } # Windows servers @@ -448,7 +448,7 @@ class cd_nagios::nagios::objects::hostgroups ( group => $ng_user, mode => '0640', register => '1', - target => $ng_target_hostgroup, + target => $ng_target_hostgroup_base, } # Netware servers @@ -461,7 +461,7 @@ class cd_nagios::nagios::objects::hostgroups ( group => $ng_user, mode => '0640', register => '1', - target => $ng_target_hostgroup, + target => $ng_target_hostgroup_base, } # DB servers @@ -474,7 +474,7 @@ class cd_nagios::nagios::objects::hostgroups ( group => $ng_user, mode => '0640', register => '1', - target => $ng_target_hostgroup, + target => $ng_target_hostgroup_base, } # Oracle servers @@ -487,7 +487,7 @@ class cd_nagios::nagios::objects::hostgroups ( group => $ng_user, mode => '0640', register => '1', - target => $ng_target_hostgroup, + target => $ng_target_hostgroup_base, } # MySQL servers @@ -500,7 +500,7 @@ class cd_nagios::nagios::objects::hostgroups ( group => $ng_user, mode => '0640', register => '1', - target => $ng_target_hostgroup, + target => $ng_target_hostgroup_base, } # MSSQL servers @@ -513,7 +513,7 @@ class cd_nagios::nagios::objects::hostgroups ( group => $ng_user, mode => '0640', register => '1', - target => $ng_target_hostgroup, + target => $ng_target_hostgroup_base, } # NOSQL servers @@ -526,7 +526,7 @@ class cd_nagios::nagios::objects::hostgroups ( group => $ng_user, mode => '0640', register => '1', - target => $ng_target_hostgroup, + target => $ng_target_hostgroup_base, } # Hadoop servers @@ -539,7 +539,7 @@ class cd_nagios::nagios::objects::hostgroups ( group => $ng_user, mode => '0640', register => '1', - target => $ng_target_hostgroup, + target => $ng_target_hostgroup_base, } } @@ -551,7 +551,7 @@ class cd_nagios::nagios::objects::hostgroups ( 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 c93c804..29e08f7 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 278ea0c..c7ddef7 100644 --- a/doc/puppet_classes/cd_nagios_3A_3Aparams.html +++ b/doc/puppet_classes/cd_nagios_3A_3Aparams.html @@ -103,6 +103,8 @@ cd_nagios::nagios::objects::add_contact_rules
    + cd_nagios::nagios::objects::add_hostgroup_rules
    + cd_nagios::nagios::objects::add_contactgroups_rules
    @@ -5225,7 +5227,9 @@ up

    986 987 988 -989 +989 +990 +991
    # File 'manifests/params.pp', line 646
    @@ -5552,7 +5556,9 @@ $ng_templates_rule_erb    = 'cd_nagios/nagios/templates_cfg_rule.erb'
     $ng_target_timeperiods    = "${ng_conf_d_dir}/timeperiods.cfg"
     $ng_target_localhost      = "${ng_conf_d_dir}/nagios_localhost.cfg"
     $ng_target_host           = "${ng_conf_d_dir}/nagios_host.cfg"
    -$ng_target_hostgroup      = "${ng_conf_d_dir}/nagios_hostgroups_base.cfg"
    +$ng_target_hostgroup_base = "${ng_conf_d_dir}/nagios_hostgroups_base.cfg"
    +$ng_tgt_hostgroup_add     = "${ng_conf_d_dir}/nagios_hostgroups_add.cfg"
    +$ng_tgt_hostgrp_head_erb  = 'cd_nagios/nagios/hostgroups_cfg_head.erb'
     $ng_target_hostdep        = "${ng_conf_d_dir}/nagios_hostdependency.cfg"
     $ng_target_hostesc        = "${ng_conf_d_dir}/nagios_hostescalation.cfg"
     $ng_target_hostext        = "${ng_conf_d_dir}/nagios_hostextinfo.cfg"
    @@ -5581,7 +5587,7 @@ $ng_target_command        = "${ng_conf_d_dir}/nagios_commands_base.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 ed43476..1122fe3 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 ba93a93..6ea1551 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 606dfba..3f60677 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 86de294..3f00f20 100644
    --- a/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Aservice.html
    +++ b/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Aservice.html
    @@ -192,7 +192,8 @@ href="http://www.gnu.org/licenses">www.gnu.org/licenses/.

    83 84 85 -86
    +86 +87
    # File 'manifests/server/service.pp', line 23
    @@ -219,11 +220,12 @@ class cd_nagios::server::service (
             use                 => 'generic-service',
             host_name           => $::fqdn,
             notification_period => '24x7',
    +        service_description =>  "${::hostname}_nagios_service",
             target              =>  $ng_target_service,
             owner               => 'nagios',
             group               => 'nagios',
    -        mode                => '660',
    -        contacts            => 'DevOps',
    +        mode                => '0660',
    +        contacts            => 'ops',
         }
     
           resources { [ 'nagios_host',
    @@ -268,7 +270,7 @@ class cd_nagios::server::service (
     
     
           
    diff --git a/doc/puppet_defined_type_list.html b/doc/puppet_defined_type_list.html
    index fa9c994..55929ba 100644
    --- a/doc/puppet_defined_type_list.html
    +++ b/doc/puppet_defined_type_list.html
    @@ -54,14 +54,21 @@
         
  • -
  • +
  • +
    + cd_nagios::nagios::objects::add_hostgroups +
    +
  • + + +
  • cd_nagios::nagios::objects::templates
  • -
  • +
  • cd_nagios::server::access
    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 cdab8fb..38941fc 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 @@ -114,7 +114,20 @@ href="http://www.gnu.org/licenses">www.gnu.org/licenses/.

    -

    Parameters:

    + +
    +

    Examples:

    + + +
    cd_nagios::nagios::objects::add_contact { 'example_user':
    +  ng_contact_name   =>  'example_user',
    +  ng_contact_alias  =>  'Example User',
    +  ng_contact_groups =>  'admins',
    +  ng_contact_email  =>  'example@example.net',
    +}
    + +
    +

    Parameters:

    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 index 75fd301..1f6938b 100644 --- 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 @@ -237,7 +237,7 @@ $ng_cntctgrps_rule_erb = $::cd_nagios::params::ng_cntctgrps_rule_erb diff --git a/doc/puppet_defined_types/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_hostgroups.html b/doc/puppet_defined_types/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_hostgroups.html new file mode 100644 index 0000000..224732f --- /dev/null +++ b/doc/puppet_defined_types/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_hostgroups.html @@ -0,0 +1,240 @@ + + + + + + + Defined Type: cd_nagios::nagios::objects::add_hostgroups + + — Documentation by YARD 0.9.9 + + + + + + + + + + + + + + + + + + + +
    + + +

    Defined Type: cd_nagios::nagios::objects::add_hostgroups

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

    Summary

    + define populates /etc/nagios/conf.d/nagios_hostgroups_add through +extermal Puppet rules. + +

    Overview

    +
    +
    + +

    cd_nagios::nagios::objects::add_hostgroups.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_hostgroups { 'example_hostgroup':
    +  ng_hostgroup_name   =>  'example_hostgroup',
    +  ng_hostgroup_alias  =>  'Example Hostgroup',
    +}
    + +
    +

    Parameters:

    +
      + +
    • + + ng_hostgroup_name + + + (Any) + + + (defaults to: undef) + + +
    • + +
    • + + ng_hostgroup_alias + + + (Any) + + + (defaults to: undef) + + +
    • + +
    • + + ng_hostgroup_register + + + (Any) + + + (defaults to: '1') + + +
    • + +
    + + +
    + + + + + +
    +
    +
    +
    +29
    +30
    +31
    +32
    +33
    +34
    +35
    +36
    +37
    +38
    +39
    +40
    +41
    +42
    +43
    +44
    +45
    +46
    +47
    +48
    +49
    +
    +
    # File 'manifests/nagios/objects/add_hostgroups.pp', line 29
    +
    +define cd_nagios::nagios::objects::add_hostgroups (
    +
    +$ng_hostgroup_name      = undef,
    +$ng_hostgroup_alias     = undef,
    +$ng_hostgroup_register  = '1',
    +
    +) {
    +
    +$ng_nagios_server         = $::cd_nagios::params::ng_nagios_server
    +$ng_tgt_hostgroup_add     = $::cd_nagios::params::ng_tgt_hostgroup_add
    +$ng_tgt_hostgrp_head_erb  = $::cd_nagios::params::ng_tgt_hostgrp_head_erb
    +
    +
    +  if $::fqdn == $ng_nagios_server {
    +
    +    concat::fragment { $name:
    +      target    =>  $ng_tgt_hostgroup_add,
    +      content   =>  template($ng_tgt_hostgrp_head_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 dcddfc7..81fe573 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 4495282..da2d7c7 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 da5abf1..6146632 100644 --- a/doc/top-level-namespace.html +++ b/doc/top-level-namespace.html @@ -90,7 +90,7 @@ diff --git a/manifests/nagios/objects/add_contact.pp b/manifests/nagios/objects/add_contact.pp index 8bd69d5..7f6fbaf 100644 --- a/manifests/nagios/objects/add_contact.pp +++ b/manifests/nagios/objects/add_contact.pp @@ -21,6 +21,12 @@ # @summary Define manages additional contacts known to NAGIOS through external # Puppet rules, and populates /etc/nagios/conf.d/nagios_add_contact.cfg. # @example +# cd_nagios::nagios::objects::add_contact { 'example_user': +# ng_contact_name => 'example_user', +# ng_contact_alias => 'Example User', +# ng_contact_groups => 'admins', +# ng_contact_email => 'example@example.net', +# } ################################################################################ define cd_nagios::nagios::objects::add_contact ( diff --git a/manifests/nagios/objects/add_hostgroup_rules.pp b/manifests/nagios/objects/add_hostgroup_rules.pp new file mode 100644 index 0000000..8f884a3 --- /dev/null +++ b/manifests/nagios/objects/add_hostgroup_rules.pp @@ -0,0 +1,64 @@ +## cd_nagios::nagios::objects::add_hostgroup_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_hostgroups_add.cfg and +# additional hostgroups through external Puppet rules via define. +# @example +# cd_nagios::nagios::objects::add_hostgroups { 'example_hostgroup': +# ng_hostgroup_name => 'example_hostgroup', +# ng_hostgroup_alias => 'Example Hostgroup', +# } +################################################################################ +class cd_nagios::nagios::objects::add_hostgroup_rules ( + + +) inherits cd_nagios::params { + + if $::fqdn == $ng_nagios_server { + + # manage /etc/nagios_conf.d/nagios_hostgroups_add.cfg + + concat { $ng_tgt_hostgroup_add: + ensure => present, + path => $ng_tgt_hostgroup_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 { 'hostgroups_header': + target => $ng_tgt_hostgroup_add, + content => template($ng_tgt_hostgrp_head_erb), + order => '000', + } + + cd_nagios::nagios::objects::add_hostgroups { 'example_hostgroup': + ng_hostgroup_name => 'example_hostgroup', + ng_hostgroup_alias => 'Example Hostgroup', + } + } +} diff --git a/manifests/nagios/objects/add_hostgroups.pp b/manifests/nagios/objects/add_hostgroups.pp new file mode 100644 index 0000000..58b2717 --- /dev/null +++ b/manifests/nagios/objects/add_hostgroups.pp @@ -0,0 +1,49 @@ +## cd_nagios::nagios::objects::add_hostgroups.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_hostgroups_add through +# extermal Puppet rules. +# @example +# cd_nagios::nagios::objects::add_hostgroups { 'example_hostgroup': +# ng_hostgroup_name => 'example_hostgroup', +# ng_hostgroup_alias => 'Example Hostgroup', +# } +############################################################################### +define cd_nagios::nagios::objects::add_hostgroups ( + +$ng_hostgroup_name = undef, +$ng_hostgroup_alias = undef, +$ng_hostgroup_register = '1', + +) { + +$ng_nagios_server = $::cd_nagios::params::ng_nagios_server +$ng_tgt_hostgroup_add = $::cd_nagios::params::ng_tgt_hostgroup_add +$ng_tgt_hostgrp_head_erb = $::cd_nagios::params::ng_tgt_hostgrp_head_erb + + + if $::fqdn == $ng_nagios_server { + + concat::fragment { $name: + target => $ng_tgt_hostgroup_add, + content => template($ng_tgt_hostgrp_head_erb), + } + } +} diff --git a/manifests/nagios/objects/config.pp b/manifests/nagios/objects/config.pp index 82bf493..31713ce 100644 --- a/manifests/nagios/objects/config.pp +++ b/manifests/nagios/objects/config.pp @@ -33,6 +33,7 @@ class cd_nagios::nagios::objects::config ( require cd_nagios::nagios::objects::contactgroups require cd_nagios::nagios::objects::add_contactgroups_rules require cd_nagios::nagios::objects::hostgroups + require cd_nagios::nagios::objects::add_hostgroup_rules } } diff --git a/manifests/nagios/objects/hostgroups.pp b/manifests/nagios/objects/hostgroups.pp index 4c99d31..709f20b 100644 --- a/manifests/nagios/objects/hostgroups.pp +++ b/manifests/nagios/objects/hostgroups.pp @@ -38,7 +38,7 @@ class cd_nagios::nagios::objects::hostgroups ( group => $ng_user, mode => '0640', register => '1', - target => $ng_target_hostgroup, + target => $ng_target_hostgroup_base, } @@ -52,7 +52,7 @@ class cd_nagios::nagios::objects::hostgroups ( group => $ng_user, mode => '0640', register => '1', - target => $ng_target_hostgroup, + target => $ng_target_hostgroup_base, } # CentOS servers @@ -65,7 +65,7 @@ class cd_nagios::nagios::objects::hostgroups ( group => $ng_user, mode => '0640', register => '1', - target => $ng_target_hostgroup, + target => $ng_target_hostgroup_base, } # SuSE servers @@ -78,7 +78,7 @@ class cd_nagios::nagios::objects::hostgroups ( group => $ng_user, mode => '0640', register => '1', - target => $ng_target_hostgroup, + target => $ng_target_hostgroup_base, } # Unix servers @@ -91,7 +91,7 @@ class cd_nagios::nagios::objects::hostgroups ( group => $ng_user, mode => '0640', register => '1', - target => $ng_target_hostgroup, + target => $ng_target_hostgroup_base, } # Solaris servers @@ -104,7 +104,7 @@ class cd_nagios::nagios::objects::hostgroups ( group => $ng_user, mode => '0640', register => '1', - target => $ng_target_hostgroup, + target => $ng_target_hostgroup_base, } # AIX servers @@ -117,7 +117,7 @@ class cd_nagios::nagios::objects::hostgroups ( group => $ng_user, mode => '0640', register => '1', - target => $ng_target_hostgroup, + target => $ng_target_hostgroup_base, } # Windows servers @@ -130,7 +130,7 @@ class cd_nagios::nagios::objects::hostgroups ( group => $ng_user, mode => '0640', register => '1', - target => $ng_target_hostgroup, + target => $ng_target_hostgroup_base, } # Netware servers @@ -143,7 +143,7 @@ class cd_nagios::nagios::objects::hostgroups ( group => $ng_user, mode => '0640', register => '1', - target => $ng_target_hostgroup, + target => $ng_target_hostgroup_base, } # DB servers @@ -156,7 +156,7 @@ class cd_nagios::nagios::objects::hostgroups ( group => $ng_user, mode => '0640', register => '1', - target => $ng_target_hostgroup, + target => $ng_target_hostgroup_base, } # Oracle servers @@ -169,7 +169,7 @@ class cd_nagios::nagios::objects::hostgroups ( group => $ng_user, mode => '0640', register => '1', - target => $ng_target_hostgroup, + target => $ng_target_hostgroup_base, } # MySQL servers @@ -182,7 +182,7 @@ class cd_nagios::nagios::objects::hostgroups ( group => $ng_user, mode => '0640', register => '1', - target => $ng_target_hostgroup, + target => $ng_target_hostgroup_base, } # MSSQL servers @@ -195,7 +195,7 @@ class cd_nagios::nagios::objects::hostgroups ( group => $ng_user, mode => '0640', register => '1', - target => $ng_target_hostgroup, + target => $ng_target_hostgroup_base, } # NOSQL servers @@ -208,7 +208,7 @@ class cd_nagios::nagios::objects::hostgroups ( group => $ng_user, mode => '0640', register => '1', - target => $ng_target_hostgroup, + target => $ng_target_hostgroup_base, } # Hadoop servers @@ -221,7 +221,7 @@ class cd_nagios::nagios::objects::hostgroups ( group => $ng_user, mode => '0640', register => '1', - target => $ng_target_hostgroup, + target => $ng_target_hostgroup_base, } } diff --git a/manifests/params.pp b/manifests/params.pp index c0396fd..5f1a066 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -965,7 +965,9 @@ $ng_templates_rule_erb = 'cd_nagios/nagios/templates_cfg_rule.erb' $ng_target_timeperiods = "${ng_conf_d_dir}/timeperiods.cfg" $ng_target_localhost = "${ng_conf_d_dir}/nagios_localhost.cfg" $ng_target_host = "${ng_conf_d_dir}/nagios_host.cfg" -$ng_target_hostgroup = "${ng_conf_d_dir}/nagios_hostgroups_base.cfg" +$ng_target_hostgroup_base = "${ng_conf_d_dir}/nagios_hostgroups_base.cfg" +$ng_tgt_hostgroup_add = "${ng_conf_d_dir}/nagios_hostgroups_add.cfg" +$ng_tgt_hostgrp_head_erb = 'cd_nagios/nagios/hostgroups_cfg_head.erb' $ng_target_hostdep = "${ng_conf_d_dir}/nagios_hostdependency.cfg" $ng_target_hostesc = "${ng_conf_d_dir}/nagios_hostescalation.cfg" $ng_target_hostext = "${ng_conf_d_dir}/nagios_hostextinfo.cfg" diff --git a/manifests/server/service.pp b/manifests/server/service.pp index c734c59..95a7106 100644 --- a/manifests/server/service.pp +++ b/manifests/server/service.pp @@ -42,11 +42,12 @@ class cd_nagios::server::service ( use => 'generic-service', host_name => $::fqdn, notification_period => '24x7', + service_description => "${::hostname}_nagios_service", target => $ng_target_service, owner => 'nagios', group => 'nagios', - mode => '660', - contacts => 'DevOps', + mode => '0660', + contacts => 'ops', } resources { [ 'nagios_host', diff --git a/templates/nagios/hostgroups_cfg_head.erb b/templates/nagios/hostgroups_cfg_head.erb new file mode 100644 index 0000000..acfbb87 --- /dev/null +++ b/templates/nagios/hostgroups_cfg_head.erb @@ -0,0 +1,5 @@ +############################################################################### +########## nagios_hostgroups_add.cfg created by Puppet ########## +########## manual changes are overwritten! ########## +############################################################################### +# rules are created below by external puppet rules. diff --git a/templates/nagios/hostgroups_cfg_rule.erb b/templates/nagios/hostgroups_cfg_rule.erb new file mode 100644 index 0000000..70b27e3 --- /dev/null +++ b/templates/nagios/hostgroups_cfg_rule.erb @@ -0,0 +1,6 @@ + +define hostgroup { + hostgroup_name <%= @ng_hostgroup_name %> + alias <%= @ng_hostgroup_alias %> + register <%= @ng_hostgroup_register %> + }