GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — python_code_samples_network/snmp_entity at master · mfnerd/python_code_samples_network

Expand file tree

/

snmp_entity

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

snmp_entity

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
README.md
README.md
 
 
snmp_entity.py
snmp_entity.py
 
 

README.md

Outline

SNMP: Print the results of an snmpwalk of the ENTITY-MIB from a device

This is an off-box Python script that uses net-snmp's Python bindings to print the results of an snmpwalk of the ENTITY-MIB from a device.

The script uses either SNMPv1 or SNMPv2c.

For example:

$ snmp_entity.py -a 10.1.1.1 -c public -v 2
entPhysicalDescr.1 : CISCO1941/K9 chassis, Hw Serial#: FTX180381QX, Hw Revision: 1.0
entPhysicalDescr.2 : C1941 Chassis Slot
entPhysicalDescr.3 : C1941 Mother board 2GE, integrated VPN and 2W
entPhysicalDescr.4 : C1941 DaughterCard Slot
entPhysicalDescr.5 : C1941 DaughterCard Slot
entPhysicalDescr.6 : 8 Port GE POE EHWIC Switch
entPhysicalDescr.7 : EHWIC-8 Gigabit Ethernet
...

Setup

This script has been tested with Python 2.7, and requires the following non-default module(s):

  • net-snmp's netsnmp module (see http://net-snmp.sourceforge.net/wiki/index.php/Python_Bindings)

    Ubuntu or Debian:

    $ sudo apt-get install python-netsnmp
    

    CentOS:

    $ yum install net-snmp-python
    

    FreeBSD:

    Install /usr/ports/net-mgmt/net-snmp and make sure the PYTHON option is enabled.

Additionally, the ENTITY-MIB needs to be loaded into net-snmp. By default, the MIBs directory is /usr/share/snmp/mibs on Linux and /usr/local/share/snmp/mibs on FreeBSD. Copy https://cisco.github.io/cisco-mibs/v2/ENTITY-MIB.my to that location before running this script.

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.