Add 0 before . for httpd stats

tags/zabbix-agent-addons-0.2.20-1 0.2.14_el5
Daniel Berteaud 8 years ago
parent ab8ce667b4
commit 593da4265e
  1. 3
      zabbix_scripts/check_httpd

@ -28,7 +28,10 @@ foreach my $line (split(/\n/, $status)){
my ($key, $val) = split(/:/, $line); my ($key, $val) = split(/:/, $line);
$key =~ s/\s/_/g; $key =~ s/\s/_/g;
$key = lc $key; $key = lc $key;
# Remove leading and trailing spaces
$val =~ s/^\s+|\s+$//g; $val =~ s/^\s+|\s+$//g;
# Add 0 before the . when needed
$val =~ s/^(\.\d+)$/0$1/;
$res{$key} = $val; $res{$key} = $val;
} }

Loading…
Cancel
Save