Which model switches do you have?
If you want to collect specific information, you will partly be assigned to a custom script i think, API or SNMP OIDs.
ArubaCX switches are built at the core based on API interfaces, so in principle an API script can be created with Python for everything.
In the ArubaOS switch, the API interface is slightly less extensive, but some things are still possible.
Example of what I once played with with a 2920 that read from a URL and write this to Word (CSV or Excel is better i think afterwards).
import requests
import json
import docx
doc = docx.Document()
#API GET REQUEST
url = 'http://172.16.200.88/rest/v2/system/status'
r = requests.get(url)
json_data = r.json()
#GET VARIABLES FROM JSON RESPONSE
name = (json_data.get('name'))
serial = (json_data.get('serial_number'))
model = (json_data.get('product_model'))
part = (json_data.get('hardware_revision'))
firmware = (json_data.get('firmware_version'))
ipv4 = (json_data.get('current_ip_address'))
ip = (ipv4.get('octets'))
#WRITE VARIABLES TO WORD DOCUMENT
p = doc.add_paragraph()
run = p.add_run('Hostname: '+name)
p = doc.add_paragraph()
run = p.add_run('Model: '+model)
p = doc.add_paragraph()
run = p.add_run('Partnumber: '+part)
p = doc.add_paragraph()
run = p.add_run('Serialnumber: '+serial)
p = doc.add_paragraph()
run = p.add_run('Firmware: '+firmware)
p = doc.add_paragraph()
run = p.add_run('IP Address: '+ip)
#run.font.name = 'Arial'
#run.font.size = docx.shared.Pt(12)
#SAVE WORD DOCUMENT
doc.save(r"c:\temp\test2.docx")
------------------------------
Marcel Koedijk | MVP Expert 2023 | ACEP | ACMP | ACCP | ACDP | Ekahau ECSE | Not an HPE Employee | Opinions are my own
------------------------------
Original Message:
Sent: Jan 05, 2024 04:34 AM
From: Pmarchant
Subject: Switch Auditing
Hi all, we need to audit all our switches including serial number of modular items like cards for the chassis switch , PSU's and Gbic's.
Does anyone know of a solution out there that will gather this for us ??
We use IMC and Aruba central but this is limited to the Switch / Chassis not all the ancillary items.
Thank you all