summaryrefslogtreecommitdiff
path: root/manifests/init.pp
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2008-04-25 19:36:36 +0000
committermh <mh@immerda.ch>2008-04-25 19:36:36 +0000
commitafed9676d7dd060102de66c86b1f743bded0f6fd (patch)
tree3e4312415adb67e42b6c778a45753dc63eb91983 /manifests/init.pp
parent733677ad2881bd31d2132128a2f9ad37a867f656 (diff)
removed double definitions, fixed needed flags, added some plugins, introduced a contact_groups var
Diffstat (limited to 'manifests/init.pp')
-rw-r--r--manifests/init.pp42
1 files changed, 31 insertions, 11 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 30b1566..7d37965 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -131,7 +131,7 @@ class nagios::base {
} # end nagios::base
class nagios::centos inherits nagios::base {
- package { [ 'nagios-plugins-smtp','nagios-plugins-http', 'nagios-plugins-ssh', 'nagios-plugins-udp', 'nagios-plugins-tcp', 'nagios-plugins-dig', 'nagios-plugins-nrpe', 'nagios-plugins-load', 'nagios-plugins-dns', 'nagios-plugins-ping', 'nagios-plugins-procs', 'nagios-plugins-users', 'nagios-plugins-ldap', 'nagios-plugins-disk', 'nagios-devel', 'nagios-plugins-swap', 'nagios-plugins-nagios', 'nagios-plugins-perl' ]:
+ package { [ 'nagios-plugins-smtp','nagios-plugins-http', 'nagios-plugins-ssh', 'nagios-plugins-udp', 'nagios-plugins-tcp', 'nagios-plugins-dig', 'nagios-plugins-nrpe', 'nagios-plugins-load', 'nagios-plugins-dns', 'nagios-plugins-ping', 'nagios-plugins-procs', 'nagios-plugins-users', 'nagios-plugins-ldap', 'nagios-plugins-disk', 'nagios-devel', 'nagios-plugins-swap', 'nagios-plugins-nagios', 'nagios-plugins-perl', 'nagios-plugins-ntp', 'nagios-plugins-snmp', 'nagios-plugins-icmp', 'nagios-plugins-ircd' ]:
ensure => 'present',
before => Service[nagios],
}
@@ -192,23 +192,26 @@ class nagios::target::host {
define nagios::host(
$ip = $fqdn,
$nagios_alias = $hostname,
+ $max_check_attempts = 4,
+ $notification_interval => 120,
$use = 'generic-host',
- $parents = 'none' )
+ $nagios_contact_groups_in = $nagios_contact_groups,
+ $parents = 'localhost' )
{
+ $real_nagios_contact_groups = $nagios_contact_groups_in ? {
+ '' => 'admins',
+ default => $nagios_contact_groups_in
+ }
+
@@nagios_host { $name:
ensure => present,
- alias => $nagios_alias,
address => $ip,
+ alias => $nagios_alias,
+ max_check_attempts => $max_check_attempts,
+ notification_interval => $notification_interval,
+ parents => $parents,
use => $use,
}
- case $parents {
- 'none': {}
- default: {
- Nagios_host[$name]{
- parents => $parents,
- }
- }
- }
}
# this will define a host which isn't managed by puppet.
@@ -237,6 +240,12 @@ define nagios::service(
$host_name = $fqdn,
$use = 'generic-service',
$notification_period = "24x7",
+ $max_check_attempts = 4,
+ $retry_check_interval = 1,
+ $notification_interval = 960,
+ $normal_check_interval = 5,
+ $check_period = "24x7",
+ $nagios_contact_groups_in = $nagios_contact_groups,
$service_description = ''){
@@ -244,11 +253,22 @@ define nagios::service(
# every service needs to have a defined host
include nagios::target::host
+ $real_nagios_contact_groups = $nagios_contact_groups_in ? {
+ '' => 'admins',
+ default => $nagios_contact_groups_in
+ }
+
@@nagios_service {$name:
check_command => $check_command,
use => $use,
host_name => $host_name,
notification_period => $notification_period,
+ max_check_attempts => $max_check_attempts,
+ retry_check_interval => $retry_check_interval,
+ notification_interval => $notification_interval,
+ normal_check_interval => $normal_check_interval,
+ contact_groups => $real_nagios_contact_groups,
+ check_period => $check_period,
}
# if no service_description is set it is a namevar
case $service_description {