Skip to content

Use REST APIs to retrieve Hostname/Mgmt IP/Location/Model/SN from Prime Infrastructure

License

Notifications You must be signed in to change notification settings

settlej/DeviceInfo_from_PI

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Description

Use Cisco Prime Infrastructure 3.5 REST APIs to get information about the Hostname/Mgmt IP Address/ SNMP Location/SerialNumber of all devices monitored by the PI. The script does the following:

  • Gets all the device type groups (Routers/4300/4200/Switches etc). Function getDeviceGroups is used for this purpose.
  • Any group that is considered as a parent directory is removed. Function RemoveGeneric is used for this purpose.
  • Function getDevices iterates through the groups and gathers the required information. If the group is empty, it moves on to the next group. The information is written into a csv file, in order to be used as input into another application. The csv created has a naming convention of: DeviceList_current_date_time.csv. The primary goal was to gather the information and feed it into netbox.

Configuration

The following global variables should be configured by the user, according to their environment.

  • USERNAME: define REST API username
  • PASSWORD: define REST API password
  • PI_ADDRESS: define IP Address of Prime Infrastructure Server

Technologies & Frameworks Used

  • Prime Infratructure APIs are used.
  • NO Third-Party products or Services are used.
  • The script is written in Python 3.

Installation

  1. Clone the repo
  1. cd into directory
  • cd DeviceInfo_from_PI
  1. Create the virtual environment in a sub dir in the same directory
  • python3 -m venv venv
  1. Start the virtual environment and install requirements.txt
  • source venv/bin/activate
  • pip install -r requirements.txt
  1. Execute the script as any other Python script form console.
  • python getFullDevices_from_PI.py

Known issues

No Issues found

Author(s)

This project was written and is maintained by the following individuals

Katerina Dardoufa ([email protected])

published

About

Use REST APIs to retrieve Hostname/Mgmt IP/Location/Model/SN from Prime Infrastructure

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%