Giter Club home page Giter Club logo

eos-snmp-extension-vlan-counters's Introduction

EOS SNMP Extension

About

This script provides an example of how to leverage snmp-server extension on Arista EOS devices to create a custom set of OIDs to expose counters from show vlan counters

It leverages pass_persist module to create a new SNMP structure available for your monitoring system.

SNMP structure generated by script use following template:

{{ OID_BASE }}.{{ VLAN_ID }}.{{ OID_DESCRIPTION | OID_VALUE }}.{{ OID_TRANSLATION[counter] }}

Getting started

  1. Copy this script to /mnt/flash as vlanCounters.py
admin@eos# bash
$ cd /mnt/flash
$ vi /mnt/flash/vlanCounters.py
$ sudo chmod +x vlanCounters.py
  1. Copy snmp_passpersist to /mnt/flash
admin@eos# bash
$ cd /mnt/flash
$ wget https://raw.githubusercontent.com/nagius/snmp_passpersist/master/snmp_passpersist.py
  1. Enable management api (script uses a unix socket)
management api http-commands
   protocol unix-socket
   no shutdown
  1. Enable Hardware counters for vlan
hardware counter feature vlan out
hardware counter feature vlan in
  1. Configure SNMP-SERVER extension
snmp-server extension .1.3.6.1.3.53.9 flash:/vlanCounters.py
  1. Re-configure SNMP-SERVER extension when script is updated
no snmp-server extension .1.3.6.1.3.53.9 flash:/vlanCounters.py
snmp-server extension .1.3.6.1.3.53.9 flash:/vlanCounters.py

SNMP service MUST be configured on your EOS device with at least one community.

Get information from SNMP

From your EOS device:

s7289(config)#show snmp mib walk .1.3.6.1.3.53.9

SNMPv2-SMI::experimental.53.9.0 = STRING: "MIB updated by vlanCounters.py"
SNMPv2-SMI::experimental.53.9.0.1.0.1 = STRING: "inUcastPkts"
SNMPv2-SMI::experimental.53.9.0.1.0.2 = STRING: "outUcastPkts"
SNMPv2-SMI::experimental.53.9.0.1.0.3 = STRING: "inOctets"
SNMPv2-SMI::experimental.53.9.0.1.0.4 = STRING: "outOctets"
SNMPv2-SMI::experimental.53.9.0.1.0.5 = STRING: "inBcastPkts"
SNMPv2-SMI::experimental.53.9.0.1.0.6 = STRING: "outMcastPkts"
SNMPv2-SMI::experimental.53.9.0.1.1.1 = INTEGER: 77934
SNMPv2-SMI::experimental.53.9.0.1.1.2 = INTEGER: 0
SNMPv2-SMI::experimental.53.9.0.1.1.3 = INTEGER: 12207903
SNMPv2-SMI::experimental.53.9.0.1.1.4 = INTEGER: 0
SNMPv2-SMI::experimental.53.9.0.1.1.5 = INTEGER: 0
SNMPv2-SMI::experimental.53.9.0.1.1.6 = INTEGER: 0

eos-snmp-extension-vlan-counters's People

Watchers

 avatar  avatar

Forkers

titom73

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.