summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine Beaupre <anarcat@koumbit.org>2012-02-27 11:13:11 -0500
committerMicah Anderson <micah@riseup.net>2012-03-14 21:03:17 -0400
commit7610f67b70f1ae78f6e7bcf73769de4615d61d15 (patch)
tree3a2beca6c97d3c1ebd588044d5a11de8b3ce4151
parent974fc1015a39a618352317933de14c36c3fe3a41 (diff)
always add a comment, allow spaces in comments
-rw-r--r--files/irc_bot/riseup-nagios-server.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/files/irc_bot/riseup-nagios-server.pl b/files/irc_bot/riseup-nagios-server.pl
index 4ccec47..92d0114 100644
--- a/files/irc_bot/riseup-nagios-server.pl
+++ b/files/irc_bot/riseup-nagios-server.pl
@@ -166,11 +166,11 @@ sub parse_msg {
my $event= shift;
my $data = join(' ', $event->args);
my $msg;
- if ($data =~ m/([^:]*:)?\s*ack(?:knowledge)?\s+([a-zA-Z0-9\-\.]+)(?:\s+(\w+)(?:\s+(\w+))?)?/) {
+ if ($data =~ m/([^:]*:)?\s*ack(?:knowledge)?\s+([a-zA-Z0-9\-\.]+)(?:\s+(\w+)(?:\s+([\w\s]+))?)?/) {
print STDERR "writing to nagios scoket ". $CFG::Nsa{'commandfile'} . "\n";
open(my $cmdfile, ">", $CFG::Nsa{'commandfile'}) || die "Can't open Nagios commandfile: $CFG::Nsa{'commandfile'}!\n";
my $host = $2;
- my ($service, $comment) = (undef, "");
+ my ($service, $comment) = (undef, "no comment");
if ($4) {
$service = $3;
$comment = $4;