Check line format in check_httpd

Instead of spliting errors in case server-status redirect to somewhere else
This commit is contained in:
Daniel Berteaud 2017-11-30 10:06:39 +01:00
parent a548d599bf
commit f714617bec

View File

@ -25,7 +25,8 @@ unless ($status){
}
foreach my $line (split(/\n/, $status)){
my ($key, $val) = split(/:/, $line);
next unless ($line =~ m/^(\w+):\s([\.\d]+)/);
my ($key, $val) = ($1,$2);
$key =~ s/\s/_/g;
$key = lc $key;
# Remove leading and trailing spaces