OSPF-SNMP-Final - Application#5 Part#1 Make the following...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
############# Application #5 - Part #1 ############# ''' Make the following configuration on each router in the network: configure terminal snmp-server community public RO ''' # Open a regular Linux terminal # Go to the folder containing the script, using cd /folder_path # Enter "sudo python OSPF_SNMP.py" and the password for the account # You may also need to configure the permissions on the script first! "chmod 755 script.py" # Check the console output for any errors #Necessary Python packages (they are already installed on the Debian VM) # # # # # import pprint import subprocess import binascii import sys try: import matplotlib.pyplot as matp except ImportError: print Fore.RED + Style.BRIGHT + "\n* Module matplotlib needs to be installed on your system." print "* Download it from: \n" + Fore.WHITE + Style.BRIGHT sys.exit() try: import networkx as nx except ImportError: print Fore.RED + Style.BRIGHT + "\n* Module networkx needs to be installed on your system." print "* Download it from: " print "* You should also install decorator: \n" + Fore.WHITE + Style.BRIGHT sys.exit() try: #Module for output coloring from colorama import init, deinit, Fore, Style except ImportError: print Fore.RED + Style.BRIGHT + "\n* Module colorama needs to be installed on your system." print "* Download it from: \n" + Fore.WHITE + Style.BRIGHT sys.exit() try: #Module for SNMP from pysnmp.entity.rfc3413.oneliner import cmdgen
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
except ImportError: print Fore.RED + Style.BRIGHT + "\n* Module pysnmp needs to be installed on your system." print "* Download it from: \n" + Fore.WHITE + Style.BRIGHT sys.exit() #Initialize colorama init() #Prompting user for input try: print Style.BRIGHT + "\n######################## OSPF DISCOVERY TOOL ########################" print "Make sure to connect to a device already running OSPF in the network!" print "SNMP community string should be the same on all devices running OSPF!\n" ip = raw_input(Fore.BLUE + Style.BRIGHT + "\n* Please enter root device IP: ") comm = raw_input("\n* Please enter community string: ") except KeyboardInterrupt: print Fore.RED + Style.BRIGHT + "\n\n* Program aborted by user.
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern