Monitoring, Management & Location Tracking

How to update the IAP names in Airwave when we use activate to add the devices

Aruba Employee
Q:

How to update the IAP names in Airwave when we use activate to add the devices?



A:

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

 

output shows, device details is getting pulled from Activate

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  “  with empty

Press Esc and insert below line and press enter

:%s/"//g

It will replace all " with empty string

 

Output will look like below after replace

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.

#root
#./<scirpt name> < /tmp/<whitelistfilename>

Sample command
#./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
User-added image

 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

#!/bin/bash
while read line
do
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
done

Version history
Revision #:
2 of 2
Last update:
‎03-29-2017 04:18 AM
Updated by:
 
Labels (1)
Contributors
Search Airheads
cancel
Showing results for 
Search instead for 
Did you mean: