Check line format in check_httpd

Instead of spliting errors in case server-status redirect to somewhere else
tags/zabbix-agent-addons-0.2.23-1
Daniel Berteaud 7 years ago
parent a548d599bf
commit f714617bec
  1. 3
      zabbix_scripts/check_httpd

@ -25,7 +25,8 @@ unless ($status){
} }
foreach my $line (split(/\n/, $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 =~ s/\s/_/g;
$key = lc $key; $key = lc $key;
# Remove leading and trailing spaces # Remove leading and trailing spaces

Loading…
Cancel
Save