summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2011-02-07 00:36:10 +0100
committermh <mh@immerda.ch>2011-02-07 00:36:10 +0100
commit6e520987ac41ef144f236c05b8095f285251471b (patch)
treeb578ca9bb172cc372b2d194fcc407d6dae73103e
parentaf846ae596b65be991b1648fcb3b8da02e9aeb1d (diff)
fix pid/socket location for centos, open firewall if we want to connect to an irc server
-rw-r--r--manifests/irc_bot.pp14
-rw-r--r--templates/irc_bot/CentOS/nagios-nsa.sh.erb2
2 files changed, 14 insertions, 2 deletions
diff --git a/manifests/irc_bot.pp b/manifests/irc_bot.pp
index 46cea0c..760abd0 100644
--- a/manifests/irc_bot.pp
+++ b/manifests/irc_bot.pp
@@ -4,11 +4,17 @@ class nagios::irc_bot {
}
$nagios_nsa_socket = $nagios_nsa_socket ? {
- '' => '/var/run/nagios3/nsa.socket',
+ '' => $operatingsystem ? {
+ centos => '/var/run/nagios-nsa/nsa.socket',
+ default => '/var/run/nagios3/nsa.socket'
+ },
default => $nagios_nsa_socket,
}
$nagios_nsa_pidfile = $nagios_nsa_pidfile ? {
- '' => '/var/run/nagios3/nsa.pid',
+ '' => $operatingsystem ? {
+ centos => '/var/run/nagios-nsa/nsa.socket',
+ default => '/var/run/nagios3/nsa.pid'
+ },
default => $nagios_nsa_pidfile,
}
$nagios_nsa_port = $nagios_nsa_port ? {
@@ -80,4 +86,8 @@ class nagios::irc_bot {
"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 $use_shorewall {
+ include shorewall::rules::out::irc
+ }
}
diff --git a/templates/irc_bot/CentOS/nagios-nsa.sh.erb b/templates/irc_bot/CentOS/nagios-nsa.sh.erb
index a6cee66..1561afd 100644
--- a/templates/irc_bot/CentOS/nagios-nsa.sh.erb
+++ b/templates/irc_bot/CentOS/nagios-nsa.sh.erb
@@ -25,6 +25,8 @@ SOCKFILE=<%= nagios_nsa_socket %>
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
lockfile=/var/lock/subsys/$prog
+mkdir -p /var/run/nagios-nsa 2>/dev/null
+chown nagios /var/run/nagios-nsa
start() {
[ -x $exec ] || exit 5