All Projects → mclarkson → check_iftraffic_nrpe.sh

mclarkson / check_iftraffic_nrpe.sh

Licence: other
Nagios plugin to provide network interface statistics with some automatic configuration.

Programming Languages

shell
77523 projects
PHP
23972 projects - #3 most used programming language

Nagios GUI Screenshot

Check Iftraffic Nrpe

Get network interface statistics but be economical with the output and try to select interfaces automatically.

INSTALL

Example:

wget https://raw.github.com/mclarkson/check_iftraffic_nrpe.sh/master/check_iftraffic_nrpe.sh.php
wget https://raw.github.com/mclarkson/check_iftraffic_nrpe.sh/master/check_iftraffic_nrpe.sh
chmod +x check_iftraffic_nrpe.sh
mv check_iftraffic_nrpe.sh /usr/lib64/nagios/plugins/

Copy 'check_iftraffic_nrpe.sh.php' to the 'templates.dist' directory in pnp4nagios.

EXAMPLE OUTPUT

OK:

OK: See graphs for stats. | in-br0=431 out-br0=578 in-em1=6377 out-em1=1782

OK: Stats: br0(3k/4k) lo(2k/2k) em1(49k/13k) (in/out in bits/s) | in-br0=431 out-br0=578 in-em1=6377 out-em1=1782

WARNING: Bandwidth threshold exceeded for eth1.

WARNING: Bandwidth threshold exceeded.

CRITICAL: lo is DOWN.

CRITICAL: eth4 is DOWN.

MANUAL PAGE

$ ./check_iftraffic_nrpe.sh -h


check_iftraffic_nrpe.sh - Interface statistics plugin.

Usage: check_iftraffic_nrpe.sh [options]

 -h      : Display this help text.
 -i REGX : Include the interface(s) matched by the REGX regular
           expression. Defaults to showing all interfaces.
           Specify this option multiple times to add more.
 -x REGX : Exclude the interface(s) matched by the REGX regular
           expression. Defaults to excluding none. Excludes
           will override any includes.
           Specify this option multiple times to add more.
 -k      : Don't include the slaves of bond devices or bond
           devices with no slaves.
 -r      : Check for Rollover of Values and correct them.
 -p      : Include performance data (for graphing).
 -P      : Performance data in bits/s instead of bytes/s.
 -b      : Brief - exclude stats in status message. Useful for
           systems with many interfaces where a large status
           message might cause truncation of the performance data.
 -I NAME : Interface that must always be included. This is not a
           regular expression - it should match one interface only.
           Emits warning if an interface specified here is down.
           Specify this option multiple times to add more.
 -a      : Semi automatic. This will try to work out if the
           interface is intentionally down or not and alert in
           the latter case. For example, if the administrator
           did 'ip li set eth2 up' then it would alert when down,
           but if instead 'ip li set eth2 down' then there would
           be no alert; the loopback device should always be up.
 -d      : Exclude devices which are down, unless specifically
           included with '-I', in which case, a warning will be
           issued that the interface is down.
 -D NAME : Don't include performance stats for NAME interface.
 -B      : Message output in bits/s instead of bytes/s.
 -s      : The interface speed in Mbits/s. This will be set the
           same for all selected interfaces. E.g. 1, 5, 10, 100.
           Default is 100.
 -w NUM  : Warning threshold percentage. Warn when bandwidth
           usage exceeds NUM percent of the maximum. Interfaces
           in the '-D', no performance stats, list will not be
           checked. Default is 0, which also means, off.
 -m NUM  : MatchID. Adds the match ID to the cache file name.
           This allows the plugin to be run for different
           checks or from multiple servers.
 -u      : Unknown errors are changed to warning errors.

Examples:

 Check all interfaces:

 ./check_iftraffic_nrpe.sh

 Show when loopback is down but don't create performance stats
 for it:

 ./check_iftraffic_nrpe.sh -D lo -p

 Show when loopback is down but don't create performance stats
 for it, create performance stats for everything else, don't
 show slaves of bond devices or downed interfaces:

 ./check_iftraffic_nrpe.sh -D lo -p -k -d

 Same as previous but use the smarter '-a' instead of '-d'.
 If the admin set the interface to be up but the interface is
 down then an alert will be raised.

 ./check_iftraffic_nrpe.sh -D lo -p -k -a

 Same as previous but assume all interfaces are 100mbit and
 alert if either inboud or outbound traffic exceeds 95%.

 ./check_iftraffic_nrpe.sh -D lo -p -k -a -s 100 -w 95
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].