Coder Social home page Coder Social logo

check_switch_ifs_zeroconf's Introduction

Nagios GUI Screenshot

Check Switch Interfaces - Zero configuration

Written in bash - only snmpwalk (or snmpbulkwalk) is required.

snmpbulkwalk is used by default. Edit the 'DEFAULTS' section of the script to change to snmpwalk if required.

Probably only the community string and switch IP need to be set.

Zero-conf since it compares ifAdminStatus (what state the net admin wants the interface to be in) with ifOperStatus (the state the interface is actually in.), which is set by the net admin on the cisco switch itself. This way no one can forget to update nagios when ports are enabled/disabled. Use in conjunction with other switch port checks.

This plugin now shows the interface description field.

INSTALL

Example:

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

Example output:

CRITICAL: IFs down:  Ethernet1/6 (***Unused Port***), Ethernet1/20 (***vpc 200 Link to XX-XXX-7010-XX01 e8/1***)

MANUAL PAGE

$ ./check_switch_ifs_zeroconf -h

check_switch_ifs_zeroconf - Zero-conf bulk interface checker.

Usage: check_switch_ifs_zeroconf [-h] [-l] [-c SECRET]
       [-f REGEX] [-F REGEX] host|IP

 -h         :  Display this help text.
 -v         :  Display the version of this script.
 -l         :  List all available ports and their status.
 -C SECRET  :  Community string.
 -f REGEX   :  Inclusive regular expression (these).
 -F REGEX   :  Exclusive regular expression (but not these).

Check that interfaces are in the state that the network admin
requested them to be in. For example, 'shutdown' interfaces
should be down and 'no shutdown' interfaces should be up.

Examples

List all interfaces on the device:
    check_switch_ifs_zeroconf -l -C secret 1.2.3.4

List only Ethernet1/1/1 interfaces on the device:
    check_switch_ifs_zeroconf -l -f Ethernet1/1/1$ -C secret 1.2.3.4

List only Ethernet interfaces on the device:
    check_switch_ifs_zeroconf -l -f Ethernet -C secret 1.2.3.4

Check all interface on the device:
    check_switch_ifs_zeroconf -C secret 1.2.3.4

Check all interfaces on the device except vlan and port channels:
    check_switch_ifs_zeroconf -C secret -F 'vlan|port' 1.2.3.4

NOTE: Do not use this plugin to check individual interfaces.
      It is for bulk checks only - individual checks will be slow

NOTE: Searches with -f and -F are case-insensitive

check_switch_ifs_zeroconf's People

Contributors

mclarkson avatar

Watchers

 avatar  avatar  avatar

Forkers

catl3ane

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.