NAME

Monitoring::Sneck::Checks::bond - checks link aggregation, bonding on Linux and lagg on FreeBSD

VERSION

Version 0.0.1

SYNOPSIS

bond|perl:bond
bond_uplink|perl:bond -b bond0 -m 2
bond_lagg|perl:bond -b lagg0 -b lagg1

DESCRIPTION

Checks every bond and its members. A bond that lost a member keeps passing traffic, and stays up as far as Monitoring::Sneck::Checks::interface can tell, so it tends to go unseen till the last member goes too.

- CRITICAL :: A bond that is down, has no members up, or has fewer up than --members. A bond given with --bond that is not there.

- WARNING :: A member that is not up, or with LACP, one that is up but not aggregating, as happens when the switch port is not set up for it. With LACP on Linux, there being no LACP partner at all.

- OK :: Everything else, including there being no bonds, unless --bond says one should be there.

On Linux, bonds are read from /proc/net/bonding. A member is up if its MII status is, and with 802.3ad, if it is in the active aggregator, which the kernel only shows to root. On FreeBSD, laggs are read from ifconfig -a. A member is up if its link is active, and with LACP, if it is active, collecting, and distributing. Other OSes are UNKNOWN.

OPTIONS

- -b, --bond :: A bond that must be there, such as bond0 or lagg0. May be given more than once.

- -m, --members :: How many members each bond must have up.

METHODS

check

Does the check.

linux_bonds

Returns the bonds under /proc/net/bonding, sorted by name, as hash refs of...

- name :: The bond, such as bond0.

- mode :: What it is doing, such as 802.3ad or active-backup.

- up :: 1 if the bond itself is up, else 0.

- problem :: What is wrong with the bond as a whole though it is up, such as having no LACP partner, or undef.

- members :: Array ref of hash refs of name and problem, why the member is not counted as up, such as down, or undef if it is.

Bonding not being loaded is having no bonds.

freebsd_bonds

Returns the laggs ifconfig -a shows, sorted by name, as for "linux_bonds". Dies if ifconfig fails.