1
0

Accepting request 859062 from server:monitoring

Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/859062
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/monitoring-plugins-bonding?expand=0&rev=8
This commit is contained in:
Dominique Leuenberger 2020-12-29 14:52:52 +00:00 committed by Git OBS Bridge
commit 85336651d0
3 changed files with 26 additions and 3 deletions

View File

@ -54,6 +54,7 @@ sub read_proc_bond {
$data->{'slaves'}->{$slave}->{'failure-count'} = $1 if /^Link Failure Count: (.+)$/; $data->{'slaves'}->{$slave}->{'failure-count'} = $1 if /^Link Failure Count: (.+)$/;
$data->{'slaves'}->{$slave}->{'actor-churn'} = $1 if /^Actor Churn State: (.+)$/; $data->{'slaves'}->{$slave}->{'actor-churn'} = $1 if /^Actor Churn State: (.+)$/;
$data->{'slaves'}->{$slave}->{'partner-churn'} = $1 if /^Partner Churn State: (.+)$/; $data->{'slaves'}->{$slave}->{'partner-churn'} = $1 if /^Partner Churn State: (.+)$/;
$data->{'slaves'}->{$slave}->{'speed'} = $1 if /^Speed: (.+) Mbps$/;
} }
} }
} }
@ -71,6 +72,18 @@ sub check_bond {
my $config_str; my $config_str;
my $status = $data->{'status'}; my $status = $data->{'status'};
if (defined $data->{'slaves'}) { if (defined $data->{'slaves'}) {
my $max_speed = 0;
foreach (keys %{$data->{'slaves'}}) {
$max_speed = $data->{'slaves'}->{$_}->{'speed'} if $data->{'slaves'}->{$_}->{'speed'} && $data->{'slaves'}->{$_}->{'speed'} > $max_speed;
}
if (defined $data->{'active'}) {
my $active_int = $data->{'active'};
$error = 1 if $data->{'slaves'}->{$active_int}->{'speed'} && $data->{'slaves'}->{$active_int}->{'speed'} ne $max_speed;
} else {
foreach (keys %{$data->{'slaves'}}) {
$error = 1 if $data->{'slaves'}->{$_}->{'speed'} && $data->{'slaves'}->{$_}->{'speed'} ne $max_speed;
}
}
foreach (keys %{$data->{'slaves'}}) { foreach (keys %{$data->{'slaves'}}) {
$status = "warn" if $data->{'slaves'}->{$_}->{'actor-churn'} $status = "warn" if $data->{'slaves'}->{$_}->{'actor-churn'}
&& $data->{'slaves'}->{$_}->{'actor-churn'} eq "churned"; && $data->{'slaves'}->{$_}->{'actor-churn'} eq "churned";
@ -86,8 +99,9 @@ sub check_bond {
$config_str = sprintf "$interface_name %s has no physical devices", $data->{'status'}; $config_str = sprintf "$interface_name %s has no physical devices", $data->{'status'};
$error = 1; $error = 1;
} }
foreach (keys %{$data->{'slaves'}}) { foreach (sort(keys %{$data->{'slaves'}})) {
my $result = $data->{'slaves'}->{$_}->{'mii'}; my $result = $data->{'slaves'}->{$_}->{'mii'};
$result .= ", ".$data->{'slaves'}->{$_}->{'speed'}."Mbps" if $data->{'slaves'}->{$_}->{'speed'};
$result = "churned" if $data->{'slaves'}->{$_}->{'actor-churn'} $result = "churned" if $data->{'slaves'}->{$_}->{'actor-churn'}
&& $data->{'slaves'}->{$_}->{'actor-churn'} ne 'none'; && $data->{'slaves'}->{$_}->{'actor-churn'} ne 'none';
$result = "churned" if $data->{'slaves'}->{$_}->{'partner-churn'} $result = "churned" if $data->{'slaves'}->{$_}->{'partner-churn'}

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Mon Dec 21 17:57:46 CET 2020 - ro@suse.de
- also check the speed
- in active/failover warn if active interface does not
have the maximum speed
- in multi-active (rr,lacp) warn unless all interfaces
run in maximum speed
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Oct 3 14:00:38 UTC 2018 - lars@linux-schulserver.de Wed Oct 3 14:00:38 UTC 2018 - lars@linux-schulserver.de

View File

@ -1,7 +1,7 @@
# #
# spec file for package monitoring-plugins-bonding # spec file for package monitoring-plugins-bonding
# #
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2020 SUSE LLC
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -22,7 +22,7 @@ Release: 0
Summary: Nagios Network Bonding Check Summary: Nagios Network Bonding Check
License: GPL-2.0-or-later OR Artistic-1.0 License: GPL-2.0-or-later OR Artistic-1.0
Group: System/Monitoring Group: System/Monitoring
Url: http://www.monitoringexchange.org/inventory/Check-Plugins/Operating-Systems/Linux/Network-Bonding URL: http://www.monitoringexchange.org/inventory/Check-Plugins/Operating-Systems/Linux/Network-Bonding
Source0: check_bonding.pl Source0: check_bonding.pl
Source1: usr.lib.nagios.plugins.check_bonding Source1: usr.lib.nagios.plugins.check_bonding
Source2: nrpe-check_bonding Source2: nrpe-check_bonding