nagios: install some packages and define service
[mirror/dsa-puppet.git] / modules / nagios / manifests / server.pp
1 class nagios::server {
2         include apache2
3         include apache2::ssl
4         include apache2::authn_anon
5
6         ssl::service { 'nagios.debian.org':
7                 notify  => Exec['service apache2 reload'],
8                 key => true,
9         }
10         apache2::site { "10-nagios.debian.org":
11                 site => "nagios.debian.org",
12                 content => template('nagios/nagios.debian.org.conf.erb'),
13         }
14
15         ensure_packages( [
16                 'icinga',
17                 'make',
18                 'monitoring-plugins',
19                 'nagios-nrpe-plugin',
20                 ], { ensure => 'installed' })
21
22         service { 'icinga':
23                 ensure => running,
24                 require => Package['icinga'],
25         }
26
27
28         concat::fragment { 'dsa-puppet-stuff--nagios--restart-stale-icinga':
29                 target => '/etc/cron.d/dsa-puppet-stuff',
30                 order  => '010',
31                 content  => @(EOF)
32                         */15 * * * * root find /var/lib/icinga/status.dat -mmin +20 | grep -q . && service icinga restart
33                         | EOF
34         }
35 }