Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added match alias only option & some other things #15

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,6 @@ m4/lt~obsolete.m4

# http://www.gnu.org/software/make/
/Makefile

# Binary
/check_interfaces
71 changes: 38 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,40 +40,45 @@ make install
check_interface -c public -h 192.168.0.1 -r 'FastEth' -p '$SERVICEPERFDATA$' -t $LASTSERVICECHECK$ -a

Options;
-h address of device

-c|--community community (default public)
-r|--regex interface list regexp
Regex to match interfaces (important, this is a Regular Expression
not a simple wildcard string, see below)
-e|--errors number of in errors (CRC errors for cisco) to consider a warning (default 50)
Only warn if errors increase by more than this amount between checks
-f|--out-errors number of out errors (collisions for cisco) to consider a warning
Defaults to the same value as for errors
-p|--perfdata last check perfdata
Performance data from previous check (used to calculate traffic)
-P|--prefix prefix interface names with this label
-t|--lastcheck last checktime (unixtime)
Last service check time in unixtime (also used to calculate traffic)
-b|--bandwidth bandwidth warn level in %
-s|--speed override speed detection with this value (bits per sec)
-x|--trim cut this number of characters from the start of interface descriptions
Useful for nortel switches
-j|--auth-proto SNMPv3 Auth Protocol (SHA|MD5)
-J|--auth-phrase SNMPv3 Auth Phrase
-k|--priv-proto SNMPv3 Privacy Protocol (AES|DES) (optional)
-K|--priv-phrase SNMPv3 Privacy Phrase
-u|--user SNMPv3 User
-d|--down-is-ok disables critical alerts for down interfaces
i.e do not consider a down interface to be critical
-a|--aliases retrieves the interface description
This alias does not always deliver useful information
-A|--match-aliases also test the Alias against the Regexes
-D|--debug-print list administrative down interfaces in perfdata
-N|--if-names use ifName instead of ifDescr
--timeout sets the SNMP timeout (in ms)
-m|--mode special operating mode (default,cisco,nonbulk,bintec)
-h address of device
-c|--community community (default public)
-r|--regex interface list regexp
Regex to match interfaces (important, this is a Regular Expression
not a simple wildcard string, see below)
-e|--errors number of in errors (CRC errors for cisco) to consider a warning (default 50)
Only warn if errors increase by more than this amount between checks
-f|--out-errors number of out errors (collisions for cisco) to consider a warning
Defaults to the same value as for errors
-p|--perfdata last check perfdata
Performance data from previous check (used to calculate traffic)
-P|--prefix prefix interface names with this label
-t|--lastcheck last checktime (unixtime)
Last service check time in unixtime (also used to calculate traffic)
-b|--bandwidth bandwidth warn level in %
-s|--speed override speed detection with this value (bits per sec)
-x|--trim cut this number of characters from the start of interface descriptions
Useful for nortel switches
-j|--auth-proto SNMPv3 Auth Protocol (SHA|MD5)
-J|--auth-phrase SNMPv3 Auth Phrase
-k|--priv-proto SNMPv3 Privacy Protocol (AES|DES) (optional)
-K|--priv-phrase SNMPv3 Privacy Phrase
-u|--user SNMPv3 User
-d|--down-is-ok disables critical alerts for down interfaces
i.e do not consider a down interface to be critical
-a|--aliases retrieves the interface description
This alias does not always deliver useful information
-A|--match-aliases also test the Alias against the Regexes (--regex / --exclude-regex)
-D|--debug-print list administrative down interfaces in perfdata
-N|--if-names use ifName instead of ifDescr
--timeout sets the SNMP timeout (in ms)
-m|--mode special operating mode (default,cisco,nonbulk,bintec)
Workarounds for various hardware
--aliases-only only test the Alias against the Regexes (--regex / --exclude-regex)
--if-regex regexp matching only ifDescr/ifName. Works also with --aliases-only
--if-exclude-regex negative regexp matching only ifDescr/ifName. Works also with --aliases-only
--regex-or match both regexes --regex and --if-regex in an OR operation. So only one of them needs to match.
--exclude-regex-or match both regexes --exclude-regex and --if-exclude-regex in an OR operation. So only one of them needs to match.


### Modes
Expand Down
20 changes: 10 additions & 10 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for check_interfaces 1.4.
# Generated by GNU Autoconf 2.69 for check_interfaces 1.5.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -577,8 +577,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='check_interfaces'
PACKAGE_TARNAME='check_interfaces'
PACKAGE_VERSION='1.4'
PACKAGE_STRING='check_interfaces 1.4'
PACKAGE_VERSION='1.5'
PACKAGE_STRING='check_interfaces 1.5'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''

Expand Down Expand Up @@ -1229,7 +1229,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures check_interfaces 1.4 to adapt to many kinds of systems.
\`configure' configures check_interfaces 1.5 to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

Expand Down Expand Up @@ -1291,7 +1291,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of check_interfaces 1.4:";;
short | recursive ) echo "Configuration of check_interfaces 1.5:";;
esac
cat <<\_ACEOF

Expand Down Expand Up @@ -1377,7 +1377,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
check_interfaces configure 1.4
check_interfaces configure 1.5
generated by GNU Autoconf 2.69

Copyright (C) 2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -1675,7 +1675,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by check_interfaces $as_me 1.4, which was
It was created by check_interfaces $as_me 1.5, which was
generated by GNU Autoconf 2.69. Invocation command line was

$ $0 $@
Expand Down Expand Up @@ -4138,7 +4138,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by check_interfaces $as_me 1.4, which was
This file was extended by check_interfaces $as_me 1.5, which was
generated by GNU Autoconf 2.69. Invocation command line was

CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -4191,7 +4191,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
check_interfaces config.status 1.4
check_interfaces config.status 1.5
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

Expand Down Expand Up @@ -4312,7 +4312,7 @@ done
# If the user did not use the arguments to specify the items to instantiate,
# then the envvar interface is used. Set only those that are not.
# We use the long form for the default assignment because of an extremely
# bizarre bug on SunOS 4.1.4.
# bizarre bug on SunOS 4.1.3.
if $ac_need_defaults; then
test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
fi
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AC_INIT(check_interfaces, 1.4)
AC_INIT(check_interfaces, 1.5)
AC_PREFIX_DEFAULT(/usr/local/nagios)
AC_PROG_CC
AC_PROG_INSTALL
Expand Down
Loading