Fix PVE storage monitoring

GLPI #33910
tags/zabbix-agent-addons-0.2.55-1
Daniel Berteaud 6 years ago
parent 8f9d165906
commit 511ccab917
  1. 1
      zabbix_scripts/check_pve_sudo

@ -105,7 +105,6 @@ if ($cluster){
$json->{templates}->{$_} //= 0 foreach (qw(maxdisk)); $json->{templates}->{$_} //= 0 foreach (qw(maxdisk));
$json->{guests}->{cpu} = ($json->{guests}->{maxcpu} == 0) ? 0 : $json->{guests}->{used_cpu} / $json->{guests}->{maxcpu}; $json->{guests}->{cpu} = ($json->{guests}->{maxcpu} == 0) ? 0 : $json->{guests}->{used_cpu} / $json->{guests}->{maxcpu};
} elsif ($storage){ } elsif ($storage){
$json = from_json(qx($pvesh get /storage/$storage 2>/dev/null));
my $stores = from_json(qx($pvesh get /cluster/resources --type=storage $pvesh_opt 2>/dev/null)); my $stores = from_json(qx($pvesh get /cluster/resources --type=storage $pvesh_opt 2>/dev/null));
foreach my $s (@{$stores}){ foreach my $s (@{$stores}){
if ($s->{storage} eq $storage){ if ($s->{storage} eq $storage){

Loading…
Cancel
Save