From 593da4265e0eff77d3df5191d3fe44923c79129f Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Wed, 9 Nov 2016 17:41:55 +0100 Subject: [PATCH] Add 0 before . for httpd stats --- zabbix_scripts/check_httpd | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zabbix_scripts/check_httpd b/zabbix_scripts/check_httpd index 67486c7..201e644 100644 --- a/zabbix_scripts/check_httpd +++ b/zabbix_scripts/check_httpd @@ -28,7 +28,10 @@ foreach my $line (split(/\n/, $status)){ my ($key, $val) = split(/:/, $line); $key =~ s/\s/_/g; $key = lc $key; + # Remove leading and trailing spaces $val =~ s/^\s+|\s+$//g; + # Add 0 before the . when needed + $val =~ s/^(\.\d+)$/0$1/; $res{$key} = $val; }