diff options
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/defaults/pnp4nagios.pp | 10 | ||||
-rw-r--r-- | manifests/headless.pp | 5 | ||||
-rw-r--r-- | manifests/munin.pp | 41 | ||||
-rw-r--r-- | manifests/pnp4nagios.pp | 63 | ||||
-rw-r--r-- | manifests/pnp4nagios/popup.pp | 19 |
5 files changed, 111 insertions, 27 deletions
diff --git a/manifests/defaults/pnp4nagios.pp b/manifests/defaults/pnp4nagios.pp new file mode 100644 index 0000000..662d13b --- /dev/null +++ b/manifests/defaults/pnp4nagios.pp @@ -0,0 +1,10 @@ +class nagios::defaults::pnp4nagios { + # performance data cmds + # http://docs.pnp4nagios.org/de/pnp-0.6/config#bulk_mode_mit_npcd + nagios_command { + 'process-service-perfdata-file-pnp4nagios-bulk-npcd': + command_line => '/bin/mv /var/lib/nagios3/service-perfdata /var/spool/pnp4nagios/npcd/service-perfdata.$TIMET$'; + 'process-host-perfdata-file-pnp4nagios-bulk-npcd': + command_line => '/bin/mv /var/lib/nagios3/host-perfdata /var/spool/pnp4nagios/npcd/host-perfdata.$TIMET$' + } +} diff --git a/manifests/headless.pp b/manifests/headless.pp index cccfce7..ba8af8f 100644 --- a/manifests/headless.pp +++ b/manifests/headless.pp @@ -1,4 +1,5 @@ class nagios::headless { - $nagios_httpd = 'absent' - include nagios + class { 'nagios': + httpd => 'absent', + } } diff --git a/manifests/munin.pp b/manifests/munin.pp index 92a389f..dc5cc4c 100644 --- a/manifests/munin.pp +++ b/manifests/munin.pp @@ -1,28 +1,19 @@ -class nagios::munin inherits munin::plugins::base { +class nagios::munin { + include munin::plugins::base - munin::plugin::deploy { - nagios_hosts: - source => 'nagios/munin/nagios_hosts', - config => 'user root'; - nagios_svc: - source => 'nagios/munin/nagios_svc', - config => 'user root'; - nagios_perf_hosts: - source => 'nagios/munin/nagios_perf', - config => 'user root'; - nagios_perf_svc: - source => 'nagios/munin/nagios_perf', - config => 'user root'; - } - - exec { 'munin_nagios2stats_link': - command => 'ln -s /usr/sbin/nagios2stats /usr/local/sbin/nagiostats', - onlyif => ["test ! -e /usr/local/sbin/nagiostats", "test -e /usr/sbin/nagios2stats"], - } - - exec { 'munin_nagios3stats_link': - command => 'ln -s /usr/sbin/nagios3stats /usr/local/sbin/nagiostats', - onlyif => ["test ! -e /usr/local/sbin/nagiostats", "test -e /usr/sbin/nagios3stats"], - } + munin::plugin::deploy { + 'nagios_hosts': + source => 'nagios/munin/nagios_hosts', + config => 'user nagios'; + 'nagios_svc': + source => 'nagios/munin/nagios_svc', + config => 'user nagios'; + 'nagios_perf_hosts': + source => 'nagios/munin/nagios_perf', + config => 'user nagios'; + 'nagios_perf_svc': + source => 'nagios/munin/nagios_perf', + config => 'user nagios'; + } } diff --git a/manifests/pnp4nagios.pp b/manifests/pnp4nagios.pp new file mode 100644 index 0000000..5ade74f --- /dev/null +++ b/manifests/pnp4nagios.pp @@ -0,0 +1,63 @@ +class nagios::pnp4nagios { + include nagios::defaults::pnp4nagios + + package { 'pnp4nagios': + ensure => installed } + + + # unfortunatly we can't use the nagios_host and nagios_service + # definition to define templates, so we need to copy a file here. + # see http://projects.reductivelabs.com/issues/1180 for this limitation + + file { 'pnp4nagios-templates.cfg': + path => "${nagios::defaults::vars::int_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, + notify => Service['nagios'], + } + + 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'], + require => Package['pnp4nagios'], + } + + # 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['pnp4nagios'], + } + + # modify action.gif + + file { '/usr/share/nagios3/htdocs/images/action.gif': + path => '/usr/share/nagios3/htdocs/images/action.gif', + source => [ 'puppet:///modules/site_nagios/pnp4nagios/action.gif', + 'puppet:///modules/nagios/pnp4nagios/action.gif' ], + mode => '0644', + owner => root, + group => root, + notify => Service['nagios']; + } +} diff --git a/manifests/pnp4nagios/popup.pp b/manifests/pnp4nagios/popup.pp new file mode 100644 index 0000000..0dc04b0 --- /dev/null +++ b/manifests/pnp4nagios/popup.pp @@ -0,0 +1,19 @@ +class nagios::pnp4nagios::popup inherits nagios::pnp4nagios { + File['pnp4nagios-templates.cfg']{ + source => [ 'puppet:///modules/site_nagios/pnp4nagios/pnp4nagios-popup-templates.cfg', + 'puppet:///modules/nagios/pnp4nagios/pnp4nagios-popup-templates.cfg' ], + } + + file { '/usr/share/nagios3/htdocs/ssi': + ensure => directory } + + file { 'status-header.ssi': + path => '/usr/share/nagios3/htdocs/ssi/status-header.ssi', + source => [ 'puppet:///modules/site_nagios/pnp4nagios/status-header.ssi', + 'puppet:///modules/nagios/pnp4nagios/status-header.ssi' ], + mode => '0644', + owner => root, + group => root, + notify => Service['nagios'], + } +} |