Hi,
in order to easily export a list of all devices/modules within a network containing the product ID and serial number we have the option to leverage the reports available within Prime Infrastructure. However sometimes it is easier to just go through the API and extract the relevant information.
Below you will find a short example doing exactly this. It will create a CSV containing device name, IP, product id, serial number of your inventory.
Requirements:
- python 2
- requests, jsonpath, logging (pip2 install requests jsonpath logging)
Tested with Prime 3.1.4
Execute:
python GenericReportRunner.py -u root -p password mypiserverip
Result will be a deviceInventory<timestamp>.csv file in the subfolder 'reports' with following content
deviceId,productFamily,deviceName,ipAddress,modelNr,udiSerialNr
123123,"Switches and Hubs","lab6880-core","10.10.10.1","C6800IA-48FPD","FOC1234567"
...