12-08-2016 07:31 PM
We'd like to update the notes under each AP to show the connected with name & port. We can bulk extract this via the LLDP tables on our procurve switches but need to bulk upload this onto existing APs in Airwave.
We'd find this extemely helpful during troubleshooting.
Does anyone know how this can be done via the Airwave CLI or maybe the API?
12-08-2016 09:07 PM - edited 12-08-2016 09:10 PM
If you add the procurve switches to airwave as devices, it will read the mac address table and match them to the wired port on an AP and show the procurve switch and port as an upstream device and upstream port:
Aruba Customer Engineering
Looking for an Answer? Search the Community Knowledge Base Here: Community Knowledge Base
Validated Reference Design Guides : http://community.arubanetworks.com/t5/Validated-Reference-Design/tkb-p/Aruba-VRDs
12-11-2016 03:20 PM
That would be the ideal solution, yes.
I would do that if we had licenses to burn.
We have several thousand switches and our Airwave is running close to capacity on licenses and performance so adding the switches is not really an option at this stage.
12-11-2016 04:05 PM
I'd like to be able to bulk import data in to airwave, specifically if there was some way to take the output of:
sho ap lldp info neighbors
and import that into airwave so that it appears in the "notes" field,
especially when a WAP has gone off the air for an unknown reason,
i'd be absolutely ecstatic, as it would make fault-finding soooo much easier!
(We've got a LOT of WAPs, so doing this manually one by one isn't an option, we'd not complete that task before the next hardware refresh is due!)
I'm happy with any level of massaging of the data from sho ap lldp that i need to do to accomplish this.
Converting to cli commands, dbc commands, api calls?
Anything, as long as there's a way to do this.
12-13-2016 06:21 PM
a month ago - last edited a month ago
Sorry for the delay (getting busy with end of the semester/holiday break coming up). I’m not sure how familiar you are with the Airwave CLI or database queries (PSQL), but updating the note is relatively easy. Each monitored device in Airwave has an associated “id” in the database – you’ll see this ID in the URL of the GUI -> ex: https://airwave /ap_monitoring?id=516
Caution: I would always make backups before you attempt manipulating the database. I’ve made use of the commands several times without issue – but I’m an amateur and always cautious.
TAC also may be able to help you accomplish this. I had contacted them last year concerning if it was possible to import a CSV contain AP Mac Addresses with Jack #s. They did help me bulk update all the notes - but only to a specific value. They said they could look into building a script to accomplish what I desired - I wanted to take them up on the offer but got busy with other projects. These instructions aren't the best but I'm leaving for a few weeks tomorrow and wanted to give you something to play around with - just be careful as you might end up accidentally overwriting previous notes.
Updating Specific AP Notes based on ID Field:
If I wanted to update the notes of my AP named “Farmhouse” [ID=516] to “Switch7 – Port Gi7/2 – XXX” via the CLI, I would do the following:
- Login to Airwave CLI
- Type ‘db’ to run psql – the cli should update from [root@airwave mercury] to airwave=>
- Type ‘update ap set notes = 'Switch7 – Port Gi7/2 – XXX' where ap.id = 505;’
- If successful, you’ll see a “UPDATE 1”
- You can also check the current value via - select ap.name, ap.id, ap.notes from ap where ap.id='505';
- Type ‘\q’ to exit the database.
Retrieving ID of every AP in Airwave:
- Login to Airwave CLI
- Type dbcsv "SELECT ap.name, ap.lan_mac, ap.device_serial, ap.id, ap.notes FROM AP" > ./ap-id-database.csv
- TFTP the file or use WinSCP to retrieve the file.
- I chose these specific fields because these were the ones I was interested in. You could do a dbcsv “Select * from AP’ – but I’ve found that some of the rows are off by one or two due to missing data. There's another CSV command that includes headers, but I've never been able to get it to work.
- I then merged this csv with a csv that had the correlated switch-port information – and matched them up with my MAC Address.
Creating the Update Commands (No-Script) – (Probably Not the Best)
- Create a new column in the CSV with Excel called “Update Command”
- Set the formula o the cell to: = ="update ap set notes = '" & G2 & "' where ap.id =" & D2 & ";"
- G Column being the “New Notes” in my case
- D Column being the “AP ID” in my case.
- I replicate the formula for every device in my CSV.
- I copy the commands in small bulks into Airwave CLI.
There are several ways to do this. A simpler one without needing the AP.ID would be to do a ‘update ap set notes = ‘Switch7 – Port Gi7/2 – XXX’ where ap.lan_mac=’XX:XX:XX:XX:XX:XX’.