How to use SNMP commands to enable cnMaestro to onboard ePMP

This is a bash script that will scan your entire subnet for all cambium radios, or you can choose a single radio, then inject the onboarding commands via snmp. Works on my machine ;)

#!/bin/bash

snmp commands from here:

http://community.cambiumnetworks.com/t5/cnMaestro/How-to-use-SNMP-commands-to-enable-cn-Maestro-to-on-board-ePMP/td-p/52726

author cpatterson@globalgossip.net

######## Edit these variables
cambiumID=YOUR_CAMBIUM_ID
onboardKey=YOUR_ONBOARD_KEY
readCommunity=YOUR_READ_COMMUNITY
writeCommunity=YOUR_WRITE_COMMUNITY
networkIface=YOUR_NETWORK_INTERFACE_SUCH_AS_ETH1
singleIP=$1

Injection(){
snmpset -v2c -c$writeCommunity $ip .1.3.6.1.4.1.17713.21.3.20.1.0 i 1
snmpset -v2c -c$writeCommunity $ip .1.3.6.1.4.1.17713.21.3.20.2.0 s https://cloud.cambiumnetworks.com
snmpset -v2c -c$writeCommunity $ip .1.3.6.1.4.1.17713.21.3.20.3.0 s $cambiumID
snmpset -v2c -c$writeCommunity $ip .1.3.6.1.4.1.17713.21.3.20.4.0 s $onboardKey
snmpset -v2c -c$writeCommunity $ip .1.3.6.1.4.1.17713.21.4.3.0 i 1
snmpset -v2c -c$writeCommunity $ip .1.3.6.1.4.1.17713.21.4.4.0 i 1
snmpset -v2c -c$writeCommunity $ip .1.3.6.1.4.1.17713.21.4.1.0 i 1
}

TestIt(){
testIfCambium=$(snmpget -v2c -c$readCommunity $ip 1.3.6.1.4.1.17713.21.1.1.5.0 | grep 00:04:56)
if [[ ! -z $testIfCambium ]]; then
printf “%s\n” “Injecting $ip …”
Injection
else
printf “%s\n” “device at $ip is NOT a Cambium …”
fi
}

if [[ -z $singleIP ]]; then
getAllIPs=($(sudo arp-scan -l -g -I $networkIface | grep 00:04:56: | sort | awk {‘print $1’}))
for ip in “${getAllIPs[@]}”; do
TestIt
done
else
ip=$singleIP
TestIt
fi

exit 0