This article provide details steps to how to update the IAP names in Airwave when we are using activate to add the devices.Currently Airwave is not pulling the AP names from the activate its updating all default names.
Environment : Adding instant APs using APAS to Airwave
Configuration Steps :
Step 1: Run below curl script to pull the whitelist on Airwave
[root@localhost mercury]# curl -3 -d "credential_0=aruba_123&credential_1=aw123" -c Activate-cookie.txt https://activate.arubanetworks.com/LOGIN
[root@localhost mercury]# curl -3 -b Activate-cookie.txt 'https://activate.arubanetworks.com/api/ext/inventory.json?action=whitelist' | tee /tmp/whitelist
local-userdb-ap add mac-address 18:64:72:C1:E0:D2 ap-group "default" ap-name "abc" full-name "abc-ap"
local-userdb-ap add mac-address 00:0B:86:CF:8C:AA ap-group "default" ap-name "Yancy-test" full-name "APAS_NS_Test"
Replace the highlight section with your activate credentials, here I am piping the output to text file to /tmp directory.
Step 2: Open the text file in vi editor and replace the “ with empty
Press Esc and insert below line and press enter
It will replace all " with empty string
local-userdb-ap add mac-address 18:64:72:C1:E0:D2 ap-group default ap-name abc full-name abc-ap
local-userdb-ap add mac-address 00:0B:86:CF:8C:AA ap-group default ap-name Yancy-test full-name APAS_NS_Test
Press Esc :wq To save and quit
Step 3: Copy the below scipt file to /root/svn/mercury directory using Winscp tool and run below command to update the names to Airwave
Note: copy the script to notepad and save as text file.
#./<scirpt name> < /tmp/<whitelistfilename>
#./update_user_script < /tmp/whitelist
It will update the all IAP names in Aps/Devices-manage page except for IAPs which are acting as VC, becasue they dont have separte mac address in database. We need to manually update the name in mange page which will push the setting to VCs
To update the IAP names in Aps/Devices-List page and in IAPs we need to place the devices in manage mode. It will push the Aps/Devcies-manage page name setting to all IAPs and update the Aps/Devcies-list page
In above screen shot we need to replace Instant-C1:E0:D2 name as abc in manage page.
Note: We need to make sure the device configuration status is showing good for all IAPs in the Airwave. Placing the devices in manage mode in mismatched state will push the mismatch settings to IAPs, before placing the devcie in manage mode make sure we see only IAP name mismatch.
Script used to update names in Airwave
while read line
var1=$(echo $line | cut -d\ -f4)
var1=$( echo $var1 | tr "a-z" "A-Z")
var2=$(echo $line | cut -d\ -f8)
#echo '$var2' '$var1'
echo "update ap set name='$var2' where lan_mac='$var1';" | db