From 7610f67b70f1ae78f6e7bcf73769de4615d61d15 Mon Sep 17 00:00:00 2001 From: Antoine Beaupre Date: Mon, 27 Feb 2012 11:13:11 -0500 Subject: always add a comment, allow spaces in comments --- files/irc_bot/riseup-nagios-server.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'files') 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; -- cgit v1.2.3