summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2012-09-17 19:41:20 +0200
committerMicah Anderson <micah@riseup.net>2013-02-14 17:59:00 -0500
commitc35d053d62ff363a53b797aca10e254bd4a405e2 (patch)
tree8beef51a61f1a4e91fdd2544421cc2db449eaf1e
parent09ea320fc19e872012d88fb748e2d784e360afa4 (diff)
configure pnp4nagios npcd
-rw-r--r--files/pnp4nagios/npcd8
-rw-r--r--manifests/pnp4nagios.pp65
2 files changed, 49 insertions, 24 deletions
diff --git a/files/pnp4nagios/npcd b/files/pnp4nagios/npcd
new file mode 100644
index 0000000..64b3d4d
--- /dev/null
+++ b/files/pnp4nagios/npcd
@@ -0,0 +1,8 @@
+# Default settings for the NPCD init script.
+
+# Should NPCD be started? ("yes" to enable)
+RUN="yes"
+
+# Additional options that are passed to the daemon.
+DAEMON_OPTS="-d -f /etc/pnp4nagios/npcd.cfg"
+
diff --git a/manifests/pnp4nagios.pp b/manifests/pnp4nagios.pp
index f0df1ff..6ab6986 100644
--- a/manifests/pnp4nagios.pp
+++ b/manifests/pnp4nagios.pp
@@ -1,28 +1,45 @@
class nagios::pnp4nagios {
- include nagios::defaults::pnp4nagios
-
- package { pnp4nagios:
- ensure => installed }
-
-
- # unfortunatly i didn't find a way to use nagios_host and nagios_service definition, because
- # imho puppet can't handle the "name" variable needed in these 2 definitions
- # so we need to copy a file here.
-
- file { 'pnp4nagios-templates.cfg':
- path => "$nagios::nagios_cfgdir/conf.d/pnp4nagios-templates.cfg",
- source => [ "puppet:///modules/site-nagios/pnp4nagios/pnp4nagios-templates.cfg",
- "puppet:///modules/nagios/pnp4nagios/pnp4nagios-templates.cfg" ],
- mode => 0644, owner => root, group => root;
- }
-
- file { 'apache.conf':
- path => "/etc/pnp4nagios/apache.conf",
- source => [ "puppet:///modules/site-nagios/pnp4nagios/apache.conf",
- "puppet:///modules/nagios/pnp4nagios/apache.conf" ],
- mode => 0644, owner => root, group => root,
- notify => Service['apache'];
- }
+ include nagios::defaults::pnp4nagios
+ package { pnp4nagios:
+ ensure => installed }
+
+
+ # unfortunatly i didn't find a way to use nagios_host and nagios_service definition, because
+ # imho puppet can't handle the "name" variable needed in these 2 definitions
+ # so we need to copy a file here.
+
+ file { 'pnp4nagios-templates.cfg':
+ path => "$nagios::nagios_cfgdir/conf.d/pnp4nagios-templates.cfg",
+ source => [ "puppet:///modules/site-nagios/pnp4nagios/pnp4nagios-templates.cfg",
+ "puppet:///modules/nagios/pnp4nagios/pnp4nagios-templates.cfg" ],
+ mode => 0644, owner => root, group => root;
+ }
+
+ file { 'apache.conf':
+ path => "/etc/pnp4nagios/apache.conf",
+ source => [ "puppet:///modules/site-nagios/pnp4nagios/apache.conf",
+ "puppet:///modules/nagios/pnp4nagios/apache.conf" ],
+ mode => 0644, owner => root, group => root,
+ notify => Service['apache'];
+ }
+
+ # run npcd as daemon
+
+ file { '/etc/default/npcd':
+ path => "/etc/default/npcd",
+ source => [ "puppet:///modules/site-nagios/pnp4nagios/npcd",
+ "puppet:///modules/nagios/pnp4nagios/npcd" ],
+ mode => 0644, owner => root, group => root,
+ notify => Service['npcd'];
+ }
+
+ service { 'npcd':
+ ensure => running,
+ enable => true,
+ hasstatus => true,
+ require => Package['npcd'],
+ }
+
}