m_cdp_to_csv

m_cdp_to_csv.script_main(script)
MULTIPLE device script
Author: Jamie Caesar

This script will grab the detailed CDP information from each Cisco IOS or NX-OS device in the provided device list CSV file and export each to a CSV file containing the important information, such as Remote Device hostname, model and IP information, in addition to the local and remote interfaces that connect the devices.

Script Settings (found in settings/settings.ini):

  • strip_domains - A list of domain names that will be stripped away if found in the CDP remote device name.
Parameters:script (scripts.Script) – A subclass of the scripts.Script object that represents the execution of this particular script (either CRTScript or DirectScript)
m_cdp_to_csv.per_device_work(session, enable_pass)

This function contains the code that should be executed on each device that this script connects to. It is called after establishing a connection to each device in the loop above.

You can either put your own code here, or if there is a single-device version of a script that performs the correct task, it can be imported and called here, essentially making this script connect to all the devices in the chosen CSV file and then running a single-device script on each of them.