From e3e1b815f58cacff43f3cfc3740015605ab92e1c Mon Sep 17 00:00:00 2001 From: UrBnW <40244829+UrBnW@users.noreply.github.com> Date: Mon, 18 May 2020 14:58:57 +0200 Subject: [PATCH] fix(aix) simplify buggy swap state detection --- os/aix/snmp/mode/swap.pm | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/os/aix/snmp/mode/swap.pm b/os/aix/snmp/mode/swap.pm index 87cf893a4..2e295832e 100644 --- a/os/aix/snmp/mode/swap.pm +++ b/os/aix/snmp/mode/swap.pm @@ -127,13 +127,6 @@ sub new { sub manage_selection { my ($self, %options) = @_; - # sysDescr values: - # Aix 5.2: .*Base Operating System Runtime AIX version: 05.02.* - # Aix 5.3: .*Base Operating System Runtime AIX version: 05.03.* - # Aix 6.1: .*Base Operating System Runtime AIX version: 06.01.* - # Aix 7.1: .*Base Operating System Runtime AIX version: 07.01.* - - my $oid_sysDescr = ".1.3.6.1.2.1.1.1"; my $aix_swap_pool = ".1.3.6.1.4.1.2.6.191.2.4.2.1"; # aixPageEntry my $aix_swap_name = ".1.3.6.1.4.1.2.6.191.2.4.2.1.1"; # aixPageName my $aix_swap_total = ".1.3.6.1.4.1.2.6.191.2.4.2.1.4"; # aixPageSize (in MB) @@ -145,7 +138,6 @@ sub manage_selection { my $results = $options{snmp}->get_multiple_table( oids => [ { oid => $aix_swap_pool }, - { oid => $oid_sysDescr }, ] ); @@ -164,17 +156,10 @@ sub manage_selection { # Values are : # 1 = "active" # 2 = "notActive" - # On AIX 5.x it's ok. But in AIX 6.x, 7.x, it's the contrary ??!!! - my $active_swap = 2; - if ($results->{$oid_sysDescr}->{$oid_sysDescr . ".0"} =~ /AIX version: 05\./i) { - $active_swap = 1; - } + # Some systems may however return the contrary. + my $active_swap = 1; if (defined($self->{option_results}->{paging_state_buggy})) { - if ($active_swap == 2) { - $active_swap = 1; - } else { - $active_swap = 2; - } + $active_swap = 2; } $self->{global} = { nactive => 0, ntotal => 0, total => 0, used => 0 };