summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2010-08-11 15:57:58 +0200
committermh <mh@immerda.ch>2010-08-11 15:57:58 +0200
commit01bb8dfee9c3981994d1697fc96470798445a050 (patch)
treedcd4266d6eeb8dc48ae1b69aacea53594e6560a8 /manifests
parent33b091b896fbb0b54ee9968c452ef2a8867893d8 (diff)
parenta5d8b5b8b1f4d5afcb549e28bf1eef12169b81c7 (diff)
Merge branch 'master' of git.puppet.immerda.ch:module-nagios
Diffstat (limited to 'manifests')
-rw-r--r--manifests/apache.pp2
-rw-r--r--manifests/base.pp110
-rw-r--r--manifests/debian.pp2
-rw-r--r--manifests/defaults/commands.pp80
-rw-r--r--manifests/defaults/host_templates.pp12
-rw-r--r--manifests/defaults/hostgroups.pp20
-rw-r--r--manifests/defaults/service_templates.pp18
-rw-r--r--manifests/defaults/templates.pp13
-rw-r--r--manifests/defaults/vars.pp10
-rw-r--r--manifests/nsca/client.pp6
-rw-r--r--manifests/nsca/server.pp6
-rw-r--r--manifests/plugin.pp9
-rw-r--r--manifests/target/fqdn.pp (renamed from manifests/target/nat.pp)2
13 files changed, 175 insertions, 115 deletions
diff --git a/manifests/apache.pp b/manifests/apache.pp
index 36994f8..c00b1d9 100644
--- a/manifests/apache.pp
+++ b/manifests/apache.pp
@@ -1,4 +1,4 @@
-class nagios::apache {
+class nagios::apache inherits ::apache {
$nagios_httpd = 'apache'
include nagios
}
diff --git a/manifests/base.pp b/manifests/base.pp
index 6106ab2..071f22c 100644
--- a/manifests/base.pp
+++ b/manifests/base.pp
@@ -1,4 +1,6 @@
class nagios::base {
+ # include the variables
+ include nagios::defaults::vars
package { 'nagios':
alias => 'nagios',
@@ -14,37 +16,37 @@ class nagios::base {
# this file should contain all the nagios_puppet-paths:
file { 'nagios_main_cfg':
- path => "${nagios_cfgdir}/nagios.cfg",
- source => [ "puppet://$server/modules/site-nagios/configs/${fqdn}/nagios.cfg",
- "puppet://$server/modules/site-nagios/configs/${operatingsystem}/nagios.cfg",
- "puppet://$server/modules/site-nagios/configs/nagios.cfg",
- "puppet://$server/modules/nagios/configs/${operatingsystem}/nagios.cfg",
- "puppet://$server/modules/nagios/configs/nagios.cfg" ],
+ path => "${nagios::defaults::vars::int_nagios_cfgdir}/nagios.cfg",
+ source => [ "puppet:///modules/site-nagios/configs/${fqdn}/nagios.cfg",
+ "puppet:///modules/site-nagios/configs/${operatingsystem}/nagios.cfg",
+ "puppet:///modules/site-nagios/configs/nagios.cfg",
+ "puppet:///modules/nagios/configs/${operatingsystem}/nagios.cfg",
+ "puppet:///modules/nagios/configs/nagios.cfg" ],
notify => Service['nagios'],
mode => 0644, owner => root, group => root;
}
file { 'nagios_cgi_cfg':
- path => "${nagios_cfgdir}/cgi.cfg",
- source => [ "puppet://$server/modules/site-nagios/configs/${fqdn}/cgi.cfg",
- "puppet://$server/modules/site-nagios/configs/${operatingsystem}/cgi.cfg",
- "puppet://$server/modules/site-nagios/configs/cgi.cfg",
- "puppet://$server/modules/nagios/configs/${operatingsystem}/cgi.cfg",
- "puppet://$server/modules/nagios/configs/cgi.cfg" ],
+ path => "${nagios::defaults::vars::int_nagios_cfgdir}/cgi.cfg",
+ source => [ "puppet:///modules/site-nagios/configs/${fqdn}/cgi.cfg",
+ "puppet:///modules/site-nagios/configs/${operatingsystem}/cgi.cfg",
+ "puppet:///modules/site-nagios/configs/cgi.cfg",
+ "puppet:///modules/nagios/configs/${operatingsystem}/cgi.cfg",
+ "puppet:///modules/nagios/configs/cgi.cfg" ],
mode => '0644', owner => 'root', group => 0,
notify => Service['apache'],
}
file { 'nagios_htpasswd':
- path => "${nagios_cfgdir}/htpasswd.users",
- source => [ "puppet://$server/modules/site-nagios/htpasswd.users",
- "puppet://$server/modules/nagios/htpasswd.users" ],
+ path => "${nagios::defaults::vars::int_nagios_cfgdir}/htpasswd.users",
+ source => [ "puppet:///modules/site-nagios/htpasswd.users",
+ "puppet:///modules/nagios/htpasswd.users" ],
mode => 0640, owner => root, group => apache;
}
file { 'nagios_private':
- path => "${nagios_cfgdir}/private/",
- source => "puppet://$server/modules/common/empty",
+ path => "${nagios::defaults::vars::int_nagios_cfgdir}/private/",
+ source => "puppet:///modules/common/empty",
ensure => directory,
purge => true,
recurse => true,
@@ -53,15 +55,16 @@ class nagios::base {
}
file { 'nagios_private_resource_cfg':
- path => "${nagios_cfgdir}/private/resource.cfg",
- source => "puppet://$server/nagios/configs/${operatingsystem}/private/resource.cfg.${architecture}",
+ path => "${nagios::defaults::vars::int_nagios_cfgdir}/private/resource.cfg",
+ source => [ "puppet:///modules/nagios/configs/${operatingsystem}/private/resource.cfg.${architecture}",
+ "puppet:///modules/site-nagios/configs/${operatingsystem}/private/resource.cfg.${architecture}" ],
notify => Service['nagios'],
owner => root, group => nagios, mode => '0640';
}
file { 'nagios_confd':
- path => "${nagios_cfgdir}/conf.d/",
- source => "puppet://$server/modules/common/empty",
+ path => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/",
+ source => "puppet:///modules/common/empty",
ensure => directory,
purge => true,
recurse => true,
@@ -81,68 +84,81 @@ class nagios::base {
Nagios_serviceescalation <<||>>
Nagios_serviceextinfo <<||>>
Nagios_timeperiod <<||>>
+ File <<| tag == 'nagios_plugin' |>>
Nagios_command <||> {
- target => "${nagios_cfgdir}/conf.d/nagios_command.cfg",
+ target => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_command.cfg",
+ require => File['nagios_confd'],
notify => Service['nagios'],
}
Nagios_contact <||> {
- target => "${nagios_cfgdir}/conf.d/nagios_contact.cfg",
+ target => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_contact.cfg",
+ require => File['nagios_confd'],
notify => Service['nagios'],
}
Nagios_contactgroup <||> {
- target => "${nagios_cfgdir}/conf.d/nagios_contactgroup.cfg",
+ target => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_contactgroup.cfg",
+ require => File['nagios_confd'],
notify => Service['nagios'],
}
Nagios_host <||> {
- target => "${nagios_cfgdir}/conf.d/nagios_host.cfg",
+ target => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_host.cfg",
+ require => File['nagios_confd'],
notify => Service['nagios'],
}
Nagios_hostextinfo <||> {
- target => "${nagios_cfgdir}/conf.d/nagios_hostextinfo.cfg",
+ target => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_hostextinfo.cfg",
+ require => File['nagios_confd'],
notify => Service['nagios'],
}
Nagios_hostgroup <||> {
- target => "${nagios_cfgdir}/conf.d/nagios_hostgroup.cfg",
+ target => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_hostgroup.cfg",
+ require => File['nagios_confd'],
notify => Service['nagios'],
}
Nagios_hostgroupescalation <||> {
- target => "${nagios_cfgdir}/conf.d/nagios_hostgroupescalation.cfg",
+ target => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_hostgroupescalation.cfg",
+ require => File['nagios_confd'],
notify => Service['nagios'],
}
Nagios_service <||> {
- target => "${nagios_cfgdir}/conf.d/nagios_service.cfg",
+ target => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_service.cfg",
+ require => File['nagios_confd'],
notify => Service['nagios'],
}
Nagios_servicedependency <||> {
- target => "${nagios_cfgdir}/conf.d/nagios_servicedependency.cfg",
+ target => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_servicedependency.cfg",
+ require => File['nagios_confd'],
notify => Service['nagios'],
}
Nagios_serviceescalation <||> {
- target => "${nagios_cfgdir}/conf.d/nagios_serviceescalation.cfg",
+ target => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_serviceescalation.cfg",
+ require => File['nagios_confd'],
notify => Service['nagios'],
}
Nagios_serviceextinfo <||> {
- target => "${nagios_cfgdir}/conf.d/nagios_serviceextinfo.cfg",
+ target => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_serviceextinfo.cfg",
+ require => File['nagios_confd'],
notify => Service['nagios'],
}
Nagios_timeperiod <||> {
- target => "${nagios_cfgdir}/conf.d/nagios_timeperiod.cfg",
+ target => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_timeperiod.cfg",
+ require => File['nagios_confd'],
notify => Service['nagios'],
}
- file{[ "${nagios_cfgdir}/conf.d/nagios_command.cfg",
- "${nagios_cfgdir}/conf.d/nagios_contact.cfg",
- "${nagios_cfgdir}/conf.d/nagios_contactgroup.cfg",
- "${nagios_cfgdir}/conf.d/nagios_host.cfg",
- "${nagios_cfgdir}/conf.d/nagios_hostextinfo.cfg",
- "${nagios_cfgdir}/conf.d/nagios_hostgroup.cfg",
- "${nagios_cfgdir}/conf.d/nagios_hostgroupescalation.cfg",
- "${nagios_cfgdir}/conf.d/nagios_service.cfg",
- "${nagios_cfgdir}/conf.d/nagios_servicedependency.cfg",
- "${nagios_cfgdir}/conf.d/nagios_serviceescalation.cfg",
- "${nagios_cfgdir}/conf.d/nagios_serviceextinfo.cfg",
- "${nagios_cfgdir}/conf.d/nagios_timeperiod.cfg" ]:
+ file{[ "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_command.cfg",
+ "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_contact.cfg",
+ "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_contactgroup.cfg",
+ "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_host.cfg",
+ "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_hostextinfo.cfg",
+ "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_hostgroup.cfg",
+ "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_hostgroupescalation.cfg",
+ "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_service.cfg",
+ "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_servicedependency.cfg",
+ "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_serviceescalation.cfg",
+ "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_serviceextinfo.cfg",
+ "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_timeperiod.cfg" ]:
ensure => file,
replace => false,
notify => Service['nagios'],
@@ -152,8 +168,8 @@ class nagios::base {
# manage nagios cfg files
# must be defined after exported resource overrides and cfg file defs
file { 'nagios_cfgdir':
- path => "${nagios_cfgdir}/",
- source => "puppet://$server/modules/common/empty",
+ path => "${nagios::defaults::vars::int_nagios_cfgdir}/",
+ source => "puppet:///modules/common/empty",
ensure => directory,
recurse => true,
purge => true,
diff --git a/manifests/debian.pp b/manifests/debian.pp
index a503324..b9e87ec 100644
--- a/manifests/debian.pp
+++ b/manifests/debian.pp
@@ -14,7 +14,7 @@ class nagios::debian inherits nagios::base {
File['nagios_htpasswd', 'nagios_cgi_cfg'] { group => 'www-data' }
- file { "${nagios_cfgdir}/stylesheets":
+ file { "${nagios::defaults::vars::int_nagios_cfgdir}/stylesheets":
ensure => directory,
purge => false,
recurse => true,
diff --git a/manifests/defaults/commands.pp b/manifests/defaults/commands.pp
index c3190af..bbb6ce5 100644
--- a/manifests/defaults/commands.pp
+++ b/manifests/defaults/commands.pp
@@ -2,54 +2,84 @@ class nagios::defaults::commands {
# common service commands
- nagios_command {
- check_dummy:
+ case $operatingsystem {
+ debian,ubuntu: {
+ nagios_command {
+ check_dummy:
command_line => '$USER1$/check_dummy $ARG1$';
- check_ping:
+ check_https_cert:
+ command_line => '$USER1$/check_http --ssl -C 20 -H $HOSTADDRESS$ -I $HOSTADDRESS$';
+ check_http_url:
+ command_line => '$USER1$/check_http -H $ARG1$ -u $ARG2$';
+ check_http_url_regex:
+ command_line => '$USER1$/check_http -H $ARG1$ -u $ARG2$ -e $ARG3$';
+ check_https_url:
+ command_line => '$USER1$/check_http --ssl -H $ARG1$ -u $ARG2$';
+ check_https_url_regex:
+ command_line => '$USER1$/check_http --ssl -H $ARG1$ -u $ARG2$ -e $ARG3$';
+ check_mysql_db:
+ command_line => '$USER1$/check_mysql -H $ARG1$ -P $ARG2$ -u $ARG3$ -p $ARG4$ -d $ARG5$';
+ check_ntp_time:
+ command_line => '$USER1$/check_ntp_time -H $HOSTADDRESS$ -w 0.5 -c 1';
+ check_silc:
+ command_line => '$USER1$/check_tcp -p 706 -H $ARG1$';
+ check_sobby:
+ command_line => '$USER1$/check_tcp -H $ARG1$ -p $ARG2$';
+ check_jabber:
+ command_line => '$USER1$/check_jabber -H $ARG1$';
+ }
+ }
+ default: {
+ nagios_command {
+ check_dummy:
+ command_line => '$USER1$/check_dummy $ARG1$';
+ check_ping:
command_line => '$USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$';
- check-host-alive:
+ check-host-alive:
command_line => '$USER1$/check_ping -H $HOSTADDRESS$ -w 5000,100% -c 5000,100% -p 1';
- check_tcp:
+ check_tcp:
command_line => '$USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$';
- check_udp:
+ check_udp:
command_line => '$USER1$/check_udp -H $HOSTADDRESS$ -p $ARG1$';
- check_load:
+ check_load:
command_line => '$USER1$/check_load --warning=$ARG1$,$ARG2$,$ARG3$ --critical=$ARG4$,$ARG5$,$ARG6$';
- check_disk:
+ check_disk:
command_line => '$USER1$/check_disk -w $ARG1$ -c $ARG2$ -e -p $ARG3$';
- check_all_disks:
+ check_all_disks:
command_line => '$USER1$/check_disk -w $ARG1$ -c $ARG2$ -e';
- check_ssh:
+ check_ssh:
command_line => '$USER1$/check_ssh $HOSTADDRESS$';
- check_ssh_port:
+ ssh_port:
command_line => '$USER1$/check_ssh -p $ARG1$ $HOSTADDRESS$';
- check_http:
+ check_http:
command_line => '$USER1$/check_http -H $HOSTADDRESS$ -I $HOSTADDRESS$';
- check_https:
+ check_https:
command_line => '$USER1$/check_http --ssl -H $HOSTADDRESS$ -I $HOSTADDRESS$';
- check_https_cert:
+ check_https_cert:
command_line => '$USER1$/check_http --ssl -C 20 -H $HOSTADDRESS$ -I $HOSTADDRESS$';
- check_http_url:
+ check_http_url:
command_line => '$USER1$/check_http -H $ARG1$ -u $ARG2$';
- check_http_url_regex:
+ check_http_url_regex:
command_line => '$USER1$/check_http -H $ARG1$ -u $ARG2$ -e $ARG3$';
- check_https_url:
+ check_https_url:
command_line => '$USER1$/check_http --ssl -H $ARG1$ -u $ARG2$';
- check_https_url_regex:
+ check_https_url_regex:
command_line => '$USER1$/check_http --ssl -H $ARG1$ -u $ARG2$ -e $ARG3$';
- check_mysql:
+ check_mysql:
command_line => '$USER1$/check_mysql -H $ARG1$ -P $ARG2$ -u $ARG3$ -p $ARG4$';
- check_mysql_db:
+ check_mysql_db:
command_line => '$USER1$/check_mysql -H $ARG1$ -P $ARG2$ -u $ARG3$ -p $ARG4$ -d $ARG5$';
- check_ntp_time:
+ check_ntp_time:
command_line => '$USER1$/check_ntp_time -H $HOSTADDRESS$ -w 0.5 -c 1';
- check_silc:
+ check_silc:
command_line => '$USER1$/check_tcp -p 706 -H $ARG1$';
- check_sobby:
+ check_sobby:
command_line => '$USER1$/check_tcp -H $ARG1$ -p $ARG2$';
- check_jabber:
+ check_jabber:
command_line => '$USER1$/check_jabber -H $ARG1$';
- }
+ }
+ }
+ }
# commands for services defined by other modules
diff --git a/manifests/defaults/host_templates.pp b/manifests/defaults/host_templates.pp
index 699b965..0f47324 100644
--- a/manifests/defaults/host_templates.pp
+++ b/manifests/defaults/host_templates.pp
@@ -12,12 +12,12 @@ class nagios::defaults::host_templates {
process_perf_data => '1',
retain_status_information => '1',
retain_nonstatus_information => '1',
- check_command => 'check-host-alive',
- max_check_attempts => '10',
- notification_interval => '0',
- notification_period => '24x7',
- notification_options => 'd,u,r',
- contact_groups => 'admins',
+ check_command => 'check-host-alive',
+ max_check_attempts => '10',
+ notification_interval => '0',
+ notification_period => '24x7',
+ notification_options => 'd,u,r',
+ contact_groups => 'admins',
register => '0',
}
diff --git a/manifests/defaults/hostgroups.pp b/manifests/defaults/hostgroups.pp
index 3a4f4d1..8715ade 100644
--- a/manifests/defaults/hostgroups.pp
+++ b/manifests/defaults/hostgroups.pp
@@ -1,13 +1,11 @@
class nagios::defaults::hostgroups {
-
- nagios_hostgroup {
- 'all':
- alias => 'All Servers',
- members => '*';
- 'debian-servers':
- alias => 'Debian GNU/Linux Servers';
- 'centos-servers':
- alias => 'CentOS GNU/Linux Servers';
- }
-
+ nagios_hostgroup {
+ 'all':
+ alias => 'All Servers',
+ members => '*';
+ 'debian-servers':
+ alias => 'Debian GNU/Linux Servers';
+ 'centos-servers':
+ alias => 'CentOS GNU/Linux Servers';
+ }
}
diff --git a/manifests/defaults/service_templates.pp b/manifests/defaults/service_templates.pp
index 326ce05..84740af 100644
--- a/manifests/defaults/service_templates.pp
+++ b/manifests/defaults/service_templates.pp
@@ -17,15 +17,15 @@ class nagios::defaults::service_templates {
process_perf_data => '1',
retain_status_information => '1',
retain_nonstatus_information => '1',
- notification_interval => '0',
- is_volatile => '0',
- check_period => '24x7',
- normal_check_interval => '5',
- retry_check_interval => '1',
- max_check_attempts => '4',
- notification_period => '24x7',
- notification_options => 'w,u,c,r',
- contact_groups => 'admins',
+ notification_interval => '0',
+ is_volatile => '0',
+ check_period => '24x7',
+ normal_check_interval => '5',
+ retry_check_interval => '1',
+ max_check_attempts => '4',
+ notification_period => '24x7',
+ notification_options => 'w,u,c,r',
+ contact_groups => 'admins',
register => '0',
}
diff --git a/manifests/defaults/templates.pp b/manifests/defaults/templates.pp
index 5a3d23d..c97eee4 100644
--- a/manifests/defaults/templates.pp
+++ b/manifests/defaults/templates.pp
@@ -1,12 +1,13 @@
class nagios::defaults::templates {
+ include nagios::defaults::vars
file { 'nagios_templates':
- path => "${nagios::nagios_cfgdir}/conf.d/nagios_templates.cfg",
- source => [ "puppet://$server/modules/site-nagios/configs/${fqdn}/nagios_templates.cfg",
- "puppet://$server/modules/site-nagios/configs/${operatingsystem}/nagios_templates.cfg",
- "puppet://$server/modules/site-nagios/configs/nagios_templates.cfg",
- "puppet://$server/modules/nagios/configs/${operatingsystem}/nagios_templates.cfg",
- "puppet://$server/modules/nagios/configs/nagios_templates.cfg" ],
+ path => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_templates.cfg",
+ source => [ "puppet:///modules/site-nagios/configs/${fqdn}/nagios_templates.cfg",
+ "puppet:///modules/site-nagios/configs/${operatingsystem}/nagios_templates.cfg",
+ "puppet:///modules/site-nagios/configs/nagios_templates.cfg",
+ "puppet:///modules/nagios/configs/${operatingsystem}/nagios_templates.cfg",
+ "puppet:///modules/nagios/configs/nagios_templates.cfg" ],
notify => Service['nagios'],
mode => 0644, owner => root, group => root;
}
diff --git a/manifests/defaults/vars.pp b/manifests/defaults/vars.pp
new file mode 100644
index 0000000..6302f13
--- /dev/null
+++ b/manifests/defaults/vars.pp
@@ -0,0 +1,10 @@
+class nagios::defaults::vars {
+ case $nagios_cfgdir {
+ '': { $int_nagios_cfgdir = $operatingsystem ? {
+ centos => '/etc/nagios/',
+ default => '/etc/nagios3'
+ }
+ }
+ default: { $int_nagios_cfgdir = $nagios_cfgdir }
+ }
+}
diff --git a/manifests/nsca/client.pp b/manifests/nsca/client.pp
index b4ca878..5314b3d 100644
--- a/manifests/nsca/client.pp
+++ b/manifests/nsca/client.pp
@@ -3,9 +3,9 @@ class nagios::nsca::client {
package { 'nsca': ensure => installed }
file { '/etc/send_nsca.cfg':
- source => [ "puppet://${server}/site-nagios/nsca/{$fqdn}/send_nsca.cfg",
- "puppet://${server}/site-nagios/nsca/send_nsca.cfg",
- "puppet://${server}/nagios/nsca/send_nsca.cfg" ],
+ source => [ "puppet://${server}/modules/site-nagios/nsca/{$fqdn}/send_nsca.cfg",
+ "puppet://${server}/modules/site-nagios/nsca/send_nsca.cfg",
+ "puppet://${server}/modules/nagios/nsca/send_nsca.cfg" ],
owner => 'nagios',
group => 'nogroup',
mode => '400',
diff --git a/manifests/nsca/server.pp b/manifests/nsca/server.pp
index c682e24..e1cb83c 100644
--- a/manifests/nsca/server.pp
+++ b/manifests/nsca/server.pp
@@ -9,9 +9,9 @@ class nagios::nsca::server {
}
file { '/etc/nsca.cfg':
- source => [ "puppet://${server}/site-nagios/nsca/{$fqdn}/nsca.cfg",
- "puppet://${server}/site-nagios/nsca/nsca.cfg",
- "puppet://${server}/nagios/nsca/nsca.cfg" ],
+ source => [ "puppet://${server}/modules/site-nagios/nsca/{$fqdn}/nsca.cfg",
+ "puppet://${server}/modules/site-nagios/nsca/nsca.cfg",
+ "puppet://${server}/modules/nagios/nsca/nsca.cfg" ],
owner => 'nagios',
group => 'nogroup',
mode => '400',
diff --git a/manifests/plugin.pp b/manifests/plugin.pp
index 4789345..abaa6e5 100644
--- a/manifests/plugin.pp
+++ b/manifests/plugin.pp
@@ -1,13 +1,18 @@
define nagios::plugin(
+ $source = 'absent',
$ensure = present
){
- file{$name:
+ @@file{$name:
path => $hardwaremodel ? {
'x86_64' => "/usr/lib64/nagios/plugins/$name",
default => "/usr/lib/nagios/plugins/$name",
},
ensure => $ensure,
- source => "puppet://$server/modules/nagios/plugins/$name",
+ source => $source ? {
+ 'absent' => "puppet:///modules/nagios/plugins/$name",
+ default => "puppet:///modules/$source"
+ },
+ tag => 'nagios_plugin',
require => Package['nagios-plugins'],
owner => root, group => 0, mode => 0755;
}
diff --git a/manifests/target/nat.pp b/manifests/target/fqdn.pp
index abb0a1e..acac5d6 100644
--- a/manifests/target/nat.pp
+++ b/manifests/target/fqdn.pp
@@ -1,4 +1,4 @@
-class nagios::target::nat inherits nagios::target {
+class nagios::target::fqdn inherits nagios::target {
Nagios_host["${fqdn}"] { address => "${fqdn}" }