check_linux_bonding (8) - Linux Manuals
check_linux_bonding: Nagios plugin for checking the status of bonded network interfaces (masters and slaves) on Linux servers.
NAME
check_linux_bonding - Nagios plugin for checking the status of bonded network interfaces (masters and slaves) on Linux servers.
SYNOPSIS
- check_linux_bonding [option...]
DESCRIPTION
check_linux_bonding
-
$ ./check_linux_bonding OK: No bonding interfaces found
The plugin will first try to use the sysfs (/sys) filesystem to detect bonding interfaces. If that does not work, i.e. the kernel or bonding module is too old for the necessary files to exist, the plugin will use procfs (/proc) as a fallback. The plugin supports an unlimited number of bonding interfaces.
In the OK output, the plugin will indicate which of the slaves is active with an exclamation mark "!", if applicable. If one of the slaves is configured as primary, this is indicated with an asterisk "*":
-
$ ./check_linux_bonding Interface bond0 is UP: mode=1 (active-backup), 2 slaves: eth0*, eth1!
OPTIONS
-b, --blacklist string | file
-
Blacklist one or more interfaces. The option can be specified multiple times. If the argument is a file, the file is expected to contain a single line with the same syntax, i.e.:
-
interface1,interface2,...
Examples:
-
check_linux_bonding -b bond1 -b eth1 check_linux_bonding -b bond1,eth1 check_linux_bonding -b /etc/check_linux_bonding.black
-
-n, --no-bonding string
- This option lets you specify the return value of the plugin if no bonding interfaces are found. The option expects "ok", "warning", "critical" or "unknown" as the argument. Default is "ok" if the option is not present.
--slave-down string
- This option lets you specify the return value of the plugin if a slave interface is down. The option expects "ok", "warning", "critical" or "unknown" as the argument. Default is "warning" if the option is not present.
-t, --timeout seconds
- The number of seconds after which the plugin will abort. Default timeout is 5 seconds if the option is not present.
-s, --state
- Prefix each alert with its corresponding service state (i.e. warning, critical etc.). This is useful in case of several alerts from the same monitored system.
-S, --short-state
- Same as the --state option above, except that the state is abbreviated to a single letter (W=warning, C=critical etc.).
--ignore-num-ad
- Only relevant for IEEE 802.3ad type bonding. Turning on this option instructs the plugin to not issue a warning if the number of AD ports are not equal to the number of slaves. Usually you'll want the default behaviour, but if your 802.3ad bonding device is bound on more than one switch, you'll want to use this option to avoid false positives.
--linebreak string
-
check_linux_bonding will sometimes report more than one line, e.g. if there are several alerts. If the script has a TTY, it will use regular linebreaks. If not (which is the case with NRPE) it will use HTML linebreaks. Sometimes it can be useful to control what the plugin uses as a line separator, and this option provides that control.
The argument is the exact string to be used as the line separator. There are two exceptions, i.e. two keywords that translates to the following:
REG: Regular linebreaks, i.e. "\n".
HTML: HTML linebreaks, i.e. "<br/>".
This is a rather special option that is normally not needed. The default behaviour should be sufficient for most users.
--disable-sysfs
- Sometimes the information in /sys is partly absent or deficient, and the plugin is unable to detect this discrepancy and reports errors. This usually happens with old Linux kernels and Xen domain-0 systems. This option exists as a workaround. If specified, this option will make the plugin ignore the /sys filesystem alltogether and use the /proc filesystem instead.
-v, --verbose
- Verbose output. Will report status on all bonding interfaces, regardless of their alert state.
-h, --help
- Display help message and exit.
-V, --version
- Print version info and exit.
DIAGNOSTICS
The option -v or --verbose can be specified to display all bonding interfaces.
DEPENDENCIES
This plugin depends on sysfs and fallbacks to procfs. Without these filesystems the plugin will not find any bonding interfaces.
EXIT STATUS
If no errors are discovered, a value of 0 (OK) is returned. An exit value of 1 (WARNING) signifies one or more non-critical errors, while 2 (CRITICAL) signifies one or more critical errors.
The exit value 3 (UNKNOWN) is reserved for errors within the script, or errors getting values sysfs or procfs.
BUGS AND LIMITATIONS
INCOMPATIBILITIES
The plugin is only compatible with the Linux operating system.
LICENSE AND COPYRIGHT
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
AUTHORS
Trond Hasle Amundsen <t.h.amundsen [at] usit.uio.no>