m_inventory_report

m_inventory_report.get_manufacture_date(serial)

A function that will decode the manufacture date of a device from its serial number.

Parameters:serial (str) – The serial number of a Cisco device, which should be 11 digits long.
Returns:The month and year the device was manufactured in string format. (e.g. “September 2010”)
m_inventory_report.script_main(script)
MULTIPLE device script
Author: Jamie Caesar

This script will connect to all devices in the provided CSV file and create an output report (also CSV format) containing inventory data about the devices, such as hostname, model number, code version, serial number, manufacture date, etc.

This script checks that it will NOT be run in a connected tab.

Parameters:script (scripts.Script) – A subclass of the scripts.Script object that represents the execution of this particular script (either CRTScript or DirectScript)
m_inventory_report.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.