summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2011-02-06 23:58:46 +0100
committermh <mh@immerda.ch>2011-02-06 23:58:46 +0100
commitaf846ae596b65be991b1648fcb3b8da02e9aeb1d (patch)
treefbfe33e6d7cd8eb545793ea86d79c9b2eb0288f7 /manifests
parent1c67b54b5df53f3cb07338729181e8fd22ca24f0 (diff)
centosify irc_bot
Diffstat (limited to 'manifests')
-rw-r--r--manifests/irc_bot.pp28
1 files changed, 20 insertions, 8 deletions
diff --git a/manifests/irc_bot.pp b/manifests/irc_bot.pp
index 4092e67..46cea0c 100644
--- a/manifests/irc_bot.pp
+++ b/manifests/irc_bot.pp
@@ -34,7 +34,7 @@ class nagios::irc_bot {
}
file { "/etc/init.d/nagios-nsa":
owner => root, group => root, mode => 0755,
- content => template('nagios/irc_bot/nagios-nsa.sh.erb'),
+ content => template("nagios/irc_bot/${operatingsystem}/nagios-nsa.sh.erb"),
require => File["/usr/local/bin/riseup-nagios-server.pl"],
}
file { "/etc/nagios_nsa.cfg":
@@ -47,21 +47,33 @@ class nagios::irc_bot {
ensure => present,
}
- exec { "nagios_nsa_init_script":
- command => "/usr/sbin/update-rc.d nagios-nsa defaults",
- unless => "/bin/ls /etc/rc3.d/ | /bin/grep nagios-nsa",
- require => File["/etc/init.d/nagios-nsa"],
- }
service { "nagios-nsa":
ensure => "running",
- pattern => "riseup-nagios-server.pl",
hasstatus => true,
require => [File["/etc/nagios_nsa.cfg"],
- Exec["nagios_nsa_init_script"],
Package["libnet-irc-perl"],
Service['nagios'] ],
}
+ case $operatingsystem {
+ centos: {
+ Package['libnet-irc-perl']{
+ name => 'perl-Net-IRC',
+ }
+ Service['nagios-nsa']{
+ enable => true,
+ }
+ }
+ debian,ubuntu: {
+ exec { "nagios_nsa_init_script":
+ command => "/usr/sbin/update-rc.d nagios-nsa defaults",
+ unless => "/bin/ls /etc/rc3.d/ | /bin/grep nagios-nsa",
+ require => File["/etc/init.d/nagios-nsa"],
+ before => Service['nagios-nsa'],
+ }
+ }
+ }
+
nagios_command {
"notify-by-irc":
command_line => '/usr/local/bin/riseup-nagios-client.pl "$HOSTNAME$ ($SERVICEDESC$) $NOTIFICATIONTYPE$ n.$SERVICEATTEMPT$ $SERVICESTATETYPE$ $SERVICEEXECUTIONTIME$s $SERVICELATENCY$s $SERVICEOUTPUT$ $SERVICEPERFDATA$"';