From f714617bec8ff08b36061d6f8e81116db21456bd Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Thu, 30 Nov 2017 10:06:39 +0100 Subject: [PATCH] Check line format in check_httpd Instead of spliting errors in case server-status redirect to somewhere else --- zabbix_scripts/check_httpd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zabbix_scripts/check_httpd b/zabbix_scripts/check_httpd index 201e644..d9ce2a6 100644 --- a/zabbix_scripts/check_httpd +++ b/zabbix_scripts/check_httpd @@ -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