2013-11-05 21:21:00 +01:00
|
|
|
class zulip_internal::nagios {
|
|
|
|
include zulip_internal::apache
|
2016-04-04 04:13:34 +02:00
|
|
|
include zulip::nagios
|
2013-02-07 22:20:10 +01:00
|
|
|
|
2013-11-08 21:17:14 +01:00
|
|
|
$nagios_packages = [# Packages needed for Nagios
|
|
|
|
"nagios3",
|
|
|
|
]
|
2013-02-07 22:20:10 +01:00
|
|
|
package { $nagios_packages: ensure => "installed" }
|
|
|
|
|
|
|
|
apache2site { 'nagios':
|
|
|
|
require => [File['/etc/apache2/sites-available/'],
|
|
|
|
Apache2mod['headers'], Apache2mod['ssl'],
|
|
|
|
],
|
|
|
|
ensure => present,
|
|
|
|
}
|
2013-05-31 21:50:57 +02:00
|
|
|
|
|
|
|
file { "/etc/nagios3/":
|
|
|
|
recurse => true,
|
|
|
|
purge => false,
|
|
|
|
require => Package[nagios3],
|
|
|
|
owner => "root",
|
|
|
|
group => "root",
|
|
|
|
mode => 644,
|
2013-11-05 21:21:00 +01:00
|
|
|
source => "puppet:///modules/zulip_internal/nagios3/",
|
2013-06-14 20:15:12 +02:00
|
|
|
notify => Service["nagios3"],
|
|
|
|
}
|
|
|
|
|
|
|
|
service { "nagios3":
|
|
|
|
ensure => running,
|
|
|
|
}
|
|
|
|
|
|
|
|
file { '/usr/local/bin/pagerduty_nagios.pl':
|
|
|
|
ensure => file,
|
|
|
|
mode => 755,
|
|
|
|
owner => "root",
|
|
|
|
group => "root",
|
2013-11-05 21:21:00 +01:00
|
|
|
source => 'puppet:///modules/zulip_internal/pagerduty_nagios.pl',
|
2013-06-14 20:15:12 +02:00
|
|
|
}
|
|
|
|
|
2013-08-07 18:22:36 +02:00
|
|
|
file { '/etc/nagios3/conf.d/zulip_nagios.cfg':
|
|
|
|
ensure => file,
|
|
|
|
mode => 644,
|
|
|
|
owner => "root",
|
|
|
|
group => "root",
|
2013-10-04 19:14:13 +02:00
|
|
|
source => '/root/zulip/api/integrations/nagios/zulip_nagios.cfg',
|
2013-08-07 18:22:36 +02:00
|
|
|
}
|
|
|
|
file { '/etc/nagios3/zuliprc':
|
|
|
|
ensure => file,
|
|
|
|
mode => 644,
|
|
|
|
owner => "root",
|
|
|
|
group => "root",
|
2013-10-04 19:14:13 +02:00
|
|
|
source => '/root/zulip/bots/zuliprc.nagios',
|
2013-08-07 18:22:36 +02:00
|
|
|
}
|
|
|
|
|
2013-06-14 20:15:12 +02:00
|
|
|
exec { "fix_nagios_permissions":
|
|
|
|
command => "dpkg-statoverride --update --add nagios www-data 2710 /var/lib/nagios3/rw",
|
|
|
|
unless => "bash -c 'ls -ld /var/lib/nagios3/rw | grep ^drwx--s--- -q'",
|
|
|
|
notify => Service["nagios3"],
|
|
|
|
}
|
|
|
|
exec { "fix_nagios_permissions2":
|
|
|
|
command => "dpkg-statoverride --update --add nagios nagios 751 /var/lib/nagios3",
|
|
|
|
unless => "bash -c 'ls -ld /var/lib/nagios3 | grep ^drwxr-x--x -q'",
|
|
|
|
notify => Service["nagios3"],
|
2013-05-31 21:50:57 +02:00
|
|
|
}
|
|
|
|
|
2013-06-14 20:17:14 +02:00
|
|
|
# I feel like installing this here is an abstraction violation; we
|
|
|
|
# should probably move this to cron.d
|
|
|
|
file { "/var/spool/cron/crontabs/nagios":
|
|
|
|
require => Package[nagios3],
|
|
|
|
owner => "nagios",
|
|
|
|
group => "crontab",
|
|
|
|
mode => 600,
|
2013-11-05 21:21:00 +01:00
|
|
|
source => "puppet:///modules/zulip_internal/nagios_crontab",
|
2013-06-14 20:17:14 +02:00
|
|
|
}
|
|
|
|
|
2013-02-13 22:19:08 +01:00
|
|
|
# TODO: Install our API
|
2013-02-07 22:20:10 +01:00
|
|
|
}
|