summaryrefslogtreecommitdiff
path: root/manifests/irc_bot.pp
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2013-01-02 17:51:29 +0100
committermh <mh@immerda.ch>2013-01-02 17:51:29 +0100
commit2b2268702938453bcece9ebe6070c03929910f8a (patch)
treef7ddfdfaf2430b19dcb7f89b3c16ccf4321976de /manifests/irc_bot.pp
parentdf358dcf15d26ba59b59f686ceee4b07b3aed7dd (diff)
parenta2a80093d42b7e9eec9d2af3c66138f7ceaf9ed6 (diff)
Merge remote-tracking branch 'riseup/master' into HEAD
Conflicts: manifests/apache.pp manifests/base.pp manifests/defaults/templates.pp manifests/defaults/vars.pp manifests/init.pp manifests/irc_bot.pp manifests/nsca/client.pp manifests/nsca/server.pp manifests/service.pp manifests/service/mysql.pp templates/irc_bot/nsa.cfg.erb
Diffstat (limited to 'manifests/irc_bot.pp')
-rw-r--r--manifests/irc_bot.pp65
1 files changed, 16 insertions, 49 deletions
diff --git a/manifests/irc_bot.pp b/manifests/irc_bot.pp
index 77c5fa8..88d769c 100644
--- a/manifests/irc_bot.pp
+++ b/manifests/irc_bot.pp
@@ -1,3 +1,4 @@
+<<<<<<< HEAD
class nagios::irc_bot(
$nsa_socket = 'absent',
$nsa_server,
@@ -6,7 +7,9 @@ class nagios::irc_bot(
$nsa_password = '',
$nsa_channel,
$nsa_pidfile = 'absent',
- $nsa_realname = 'Nagios'
+ $nsa_realname = 'Nagios',
+ $nsa_usenotices = false,
+ $nsa_commandfile = 'absent'
) {
$real_nsa_socket = $nsa_socket ? {
'absent' => $::operatingsystem ? {
@@ -15,67 +18,31 @@ class nagios::irc_bot(
},
default => $nsa_socket,
}
- $real__nsa_pidfile = $nsa_pidfile ? {
+ $real_nsa_pidfile = $nsa_pidfile ? {
'absent' => $::operatingsystem ? {
centos => '/var/run/nagios-nsa/nsa.pid',
default => '/var/run/nagios3/nsa.pid'
},
default => $nsa_pidfile,
}
-
- file {
- '/usr/local/bin/riseup-nagios-client.pl':
- source => 'puppet:///modules/nagios/irc_bot/riseup-nagios-client.pl',
- owner => root, group => root, mode => 0755;
- '/usr/local/bin/riseup-nagios-server.pl':
- source => 'puppet:///modules/nagios/irc_bot/riseup-nagios-server.pl',
- owner => root, group => root, mode => 0755;
- '/etc/init.d/nagios-nsa':
- content => template("nagios/irc_bot/${::operatingsystem}/nagios-nsa.sh.erb"),
- require => File['/usr/local/bin/riseup-nagios-server.pl'],
- owner => root, group => root, mode => 0755;
- '/etc/nagios_nsa.cfg':
- ensure => present,
- content => template('nagios/irc_bot/nsa.cfg.erb'),
- owner => nagios, group => root, mode => 0400;
- }
-
- package { 'libnet-irc-perl':
- ensure => present,
- }
-
- service { "nagios-nsa":
- ensure => "running",
- hasstatus => true,
- require => [ File["/etc/nagios_nsa.cfg"],
- Package["libnet-irc-perl"],
- Service['nagios'] ],
+ $real_nsa_commandfile = $nsa_commandfile ? {
+ 'absent' => $::operatingsystem ? {
+ centos => '/var/spool/nagios/cmd/nagios.cmd',
+ default => '/var/lib/nagios3/rw/nagios.cmd'
+ },
+ default => $nsa_commandfile,
}
case $::operatingsystem {
centos: {
- Package['libnet-irc-perl']{
- name => 'perl-Net-IRC',
- }
- Service['nagios-nsa']{
- enable => true,
- }
+ include nagios::irc_bot::centos
}
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'],
- }
+ include nagios::irc_bot::debian
+ }
+ default: {
+ include nagios::irc_bot::base
}
- }
-
- 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$"';
- 'host-notify-by-irc':
- command_line => '/usr/local/bin/riseup-nagios-client.pl "$HOSTNAME$ ($HOSTALIAS$) $NOTIFICATIONTYPE$ n.$HOSTATTEMPT$ $HOSTSTATETYPE$ took $HOSTEXECUTIONTIME$s $HOSTOUTPUT$ $HOSTPERFDATA$ $HOSTLATENCY$s"';
}
if $nagios::manage_shorewall {