diff --git a/check_bonding.pl b/check_bonding.pl index 904c738..613f098 100644 --- a/check_bonding.pl +++ b/check_bonding.pl @@ -88,12 +88,16 @@ sub check_bond { } foreach (keys %{$data->{'slaves'}}) { my $result = $data->{'slaves'}->{$_}->{'mii'}; - $result = "churned" unless $data->{'slaves'}->{$_}->{'actor-churn'} eq 'none'; - $result = "churned" unless $data->{'slaves'}->{$_}->{'partner-churn'} eq 'none'; + $result = "churned" if $data->{'slaves'}->{$_}->{'actor-churn'} + && $data->{'slaves'}->{$_}->{'actor-churn'} ne 'none'; + $result = "churned" if $data->{'slaves'}->{$_}->{'partner-churn'} + && $data->{'slaves'}->{$_}->{'partner-churn'} ne 'none'; $config_str.= " $_ (" . $result . ")"; $error = 1 unless $data->{'slaves'}->{$_}->{'mii'} eq 'up'; - $error = 1 unless $data->{'slaves'}->{$_}->{'actor-churn'} eq 'none'; - $error = 1 unless $data->{'slaves'}->{$_}->{'partner-churn'} eq 'none'; + $error = 1 if $data->{'slaves'}->{$_}->{'actor-churn'} + && $data->{'slaves'}->{$_}->{'actor-churn'} ne 'none'; + $error = 1 if $data->{'slaves'}->{$_}->{'partner-churn'} + && $data->{'slaves'}->{$_}->{'partner-churn'} ne 'none'; $error = 2 if ($data->{'status'} ne 'up'); } return $error, $config_str; diff --git a/monitoring-plugins-bonding.changes b/monitoring-plugins-bonding.changes index a2ebad2..a0a2ad0 100644 --- a/monitoring-plugins-bonding.changes +++ b/monitoring-plugins-bonding.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Jul 26 01:12:10 CEST 2018 - ro@suse.de + +- fix last change for non-lacp interfaces + ------------------------------------------------------------------- Thu Jul 12 13:04:59 CEST 2018 - ro@suse.de