+ Fix mode 'swap' (i was sleeping maybe :)

This commit is contained in:
Quentin Garnier 2014-01-13 16:51:02 +01:00
parent 3f64c358e1
commit 5a5e5c2aad
1 changed files with 2 additions and 2 deletions

View File

@ -78,8 +78,8 @@ sub run {
my $oid_memAvailSwap = '.1.3.6.1.4.1.2021.4.4.0'; # KB
my $result = $self->{snmp}->get_leef(oids => [$oid_memTotalSwap, $oid_memAvailSwap], nothing_quit => 1);
my $swap_used = $result->{$oid_memAvailSwap} * 1024;
my $total_size = $result->{$oid_memAvailSwap} * 1024;
my $total_size = $result->{$oid_memTotalSwap} * 1024;
my $swap_used = ($result->{$oid_memTotalSwap} - $result->{$oid_memAvailSwap}) * 1024;
my $prct_used = $swap_used * 100 / $total_size;
my $exit = $self->{perfdata}->threshold_check(value => $prct_used, threshold => [ { label => 'critical', 'exit_litteral' => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]);