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 is a plugin for the Nagios monitoring software that checks bonding interfaces on Linux. The plugin is fairly simple and will report any interfaces that are down (both masters and slaves). It will also alert you of bonding interfaces with only one slave, since that usually points to a misconfiguration. If no bonding interfaces are detected, the plugin will exit with an OK value (modifiable with the --no-bonding option). It is therefore safe to run this plugin on all your Linux machines:

  $ ./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 or 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.).

--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 text.

-V, --version

Display version info.


DIAGNOSTICS

The option --verbose (or -v) 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.


AUTHOR

Written by Trond H. Amundsen <t.h.amundsen@usit.uio.no>


BUGS AND LIMITATIONS

None known at present.


INCOMPATIBILITIES

The plugin is only compatible with the Linux operating system.


REPORTING BUGS

Report bugs to <t.h.amundsen@usit.uio.no>


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/.


SEE ALSO

http://folk.uio.no/trondham/software/check_linux_bonding.html