parts of the nagios setup
authorPeter Palfrader <peter@palfrader.org>
Fri, 1 Jun 2018 09:10:45 +0000 (11:10 +0200)
committerPeter Palfrader <peter@palfrader.org>
Fri, 1 Jun 2018 09:10:45 +0000 (11:10 +0200)
modules/nagios/manifests/server.pp

index b753441..95b4c3b 100644 (file)
@@ -24,6 +24,107 @@ class nagios::server {
                require => Package['icinga'],
        }
 
+       file { '/etc/icinga/apache2.conf':
+               content => template('nagios/icinga-apache2.conf.erb'),
+               notify  => Exec['service apache2 reload'],
+       }
+       file { '/srv/nagios.debian.org/htpasswd':
+               mode => '0640',
+               owner => 'root',
+               group => 'www-data',
+       }
+       file { '/etc/icinga/cgi.cfg':
+               ensure => symlink,
+               target => 'config-pushed/static/cgi.cfg',
+               notify  => Exec['service apache2 reload'],
+       }
+       file { '/etc/icinga/icinga.cfg':
+               ensure => symlink,
+               target => 'config-pushed/static/icinga.cfg',
+               notify  => Service['icinga'],
+       }
+       file { '/etc/icinga/objects':
+               ensure  => directory,
+               mode    => '755',
+               purge   => true,
+               recurse => true,
+               force   => true,
+               source  => "puppet:///files/empty/",
+               notify  => Service['icinga'],
+       }
+       file { '/etc/icinga/objects/contacts.cfg':
+               ensure => symlink,
+               target => '../config-pushed/static/objects/contacts.cfg',
+               notify  => Service['icinga'],
+       }
+       file { '/etc/icinga/objects/generic-host.cfg':
+               ensure => symlink,
+               target => '../config-pushed/static/objects/generic-host.cfg',
+               notify  => Service['icinga'],
+       }
+       file { '/etc/icinga/objects/generic-service.cfg':
+               ensure => symlink,
+               target => '../config-pushed/static/objects/generic-service.cfg',
+               notify  => Service['icinga'],
+       }
+       file { '/etc/icinga/objects/timeperiods.cfg':
+               ensure => symlink,
+               target => '../config-pushed/static/objects/timeperiods.cfg',
+               notify  => Service['icinga'],
+       }
+
+       file { '/etc/icinga/objects/xauto-dependencies.cfg':
+               ensure => symlink,
+               target => '../config-pushed/generated/auto-dependencies.cfg',
+               notify  => Service['icinga'],
+       }
+       file { '/etc/icinga/objects/xauto-hostgroups.cfg':
+               ensure => symlink,
+               target => '../config-pushed/generated/auto-hostgroups.cfg',
+               notify  => Service['icinga'],
+       }
+       file { '/etc/icinga/objects/xauto-hosts.cfg':
+               ensure => symlink,
+               target => '../config-pushed/generated/auto-hosts.cfg',
+               notify  => Service['icinga'],
+       }
+       file { '/etc/icinga/objects/xauto-servicegroups.cfg':
+               ensure => symlink,
+               target => '../config-pushed/generated/auto-servicegroups.cfg',
+               notify  => Service['icinga'],
+       }
+       file { '/etc/icinga/objects/xauto-services.cfg':
+               ensure => symlink,
+               target => '../config-pushed/generated/auto-services.cfg',
+               notify  => Service['icinga'],
+       }
+
+       file { '/etc/nagios-plugins/config/local-dsa-checkcommands.cfg':
+               ensure => symlink,
+               target => '../../icinga/config-pushed/static/checkcommands.cfg',
+               notify  => Service['icinga'],
+       }
+       file { '/etc/nagios-plugins/config/local-dsa-eventhandlers.cfg':
+               ensure => symlink,
+               target => '../../icinga/config-pushed/static/eventhandlers.cfg',
+               notify  => Service['icinga'],
+       }
+
+       file { '/etc/icinga/config-pushed':
+               ensure => symlink,
+               target => '/srv/nagios.debian.org/config-pushed'
+       }
+
+       file { '/srv/nagios.debian.org':
+               ensure => directory,
+               mode => '0755',
+       }
+       file { '/srv/nagios.debian.org/config-pushed':
+               ensure => directory,
+               mode => '0755',
+               owner  => 'nagiosadm',
+               group  => 'nagiosadm',
+       }
 
        concat::fragment { 'dsa-puppet-stuff--nagios--restart-stale-icinga':
                target => '/etc/cron.d/dsa-puppet-stuff',