Hello all, I need to do some mass changes to some Canopy SM’s (PMP 100) and was curious if anyone had recommendations for doing this. Specifically I want to change the Qos settings. Are there any resource for creating a CNUT script? Or would the only way to do this be via some type of expect script?
I appreciate all ideas! Thanks!
Kenny
What’s the extent of the changes you need to make? Are all your SMs in specific subnets, static ips, pulling DHCP, or what? I’ve found the simplest solution usually is a script using snmpset. (use CNUT or a different script [I posted one here a couple years ago <!-- l --><a class=“postlink-local” href=“http://www.cambiumnetworks.com/forum/viewtopic.php?f=1&t=6656” target="_blank" rel=“nofollow noopener noreferrer”>viewtopic.php?f=1&t=6656</a><!-- l --> ] to enable SNMP write support on the SMs if needed.)
With a linux system you can use a one-liner even. I just ran this one the other day to ensure all our 900mhz APs have color-code rescan settings the same:
for IP in $(mysql -NB -p canmon -e “select ip from ap where ip like ‘10.1%.10.%’;”); do echo "$IP : ";snmpset -v2c -cCanopy $IP colorCodeRescanTimer.0 i 30;snmpset -v2c -cCanopy $IP colorCodeRescanIdleTimer.0 i 30;done
You can replace the part in parentheses with “cat /home/me/ips.txt” for example, where ips.txt is a text file with one IP per line. (any command that will output one IP per line can go in there, the ‘for’ loop will just step through all of them.) The ‘-cCanopy’ part is the community string, which must allow read/write. ‘Canopy’ is the default SNMP community, but if you are or have enabled read/write support in particular, I STRONGLY urge you to configure a different community string, NOT the default.
j
I hadn’t done any scripting for CNUT before, so decided to try my hand at it. On a Linux system put this in /usr/local/Canopy/networkupdater/tools, then just select some network elements and choose it from the Tools menu, telling it to pass Selected Network Elements to the script:
#!/bin/bash
# fskSMRcvTargetLvl.0 is .1.3.6.1.4.1.161.19.3.1.1.73.0
# fskSMTxPwrCntl.0 is .1.3.6.1.4.1.161.19.3.1.1.72.0
# rebootIfRequired.0 is .1.3.6.1.4.1.161.19.3.3.3.4.0
while read x ;
do
IP=$(echo $x | cut -d’;’ -f1)
COMMUNITY=$(echo $x | cut -d’;’ -f5)
snmpset -v2c -c$COMMUNITY $IP .1.3.6.1.4.1.161.19.3.1.1.73.0 i -60
snmpset -v2c -c$COMMUNITY $IP .1.3.6.1.4.1.161.19.3.1.1.72.0 i 1
snmpset -v2c -c$COMMUNITY $IP .1.3.6.1.4.1.161.19.3.3.3.4.0 i 1
done
Would be more flexible and portable if it were Perl, of course, but Bash was quicker to code and I’ve been on a Bash-scripting kick. If you need other values from CNUT you can parse them out of $x. This string is semicolon-separated fields of data. First is IP, second MAC, 5th is SNMP RW community, 6th is login password, 10th is name, 16th is login username. You can replace everything inside the ‘do;done’ block with “echo $x” to see all the parameters CNUT passes to the script.
If you have the appropriate SNMP MIBs installed you can of course use the OIDs by name, usually… I have a habit of using their numeric forms instead for certainty - some fields (like rebootIfRequired.0 above!) aren’t necessarily unique among all the MIBs that snmpset preloads, so going numeric or prefixing the OID with the pertinent info like “WHISP-BOX-MIBV2-MIB::” is required.
j
I apologize that I lost track of this thread. Thank you for sharing your knowledge on this. Your snmpset reply make’s sense to me but I am still trying wrap my head around what cnut scripting actually is ! We have a problem where our SM IP addressing is not consistent and its not easy to quickly get list of them w/o manually going through each one. Is there a way to script and someone “go through” the AP to hit the SM’s regardless of the IP on the sm. Maybe this is where CNUT comes in to play.
With CNUT you should be able to enter the access details for your APs, and have it discover all connected SMs. Then you can select those SMs and fire off a script.
With CNUT scripting, all it does is run the designated program or script and pass it a series of lines of text. Each line represents a single device, and is composed of semicolon-separated data. The examples I noted include the first field is the IP address of the device, 6th is the login password, 16th login username.
So the CNUT script I posted could be in any programming or scripting language that the OS understands, CNUT just asks the OS to run it, and pipes the device data to it’s input. (If it were in C you could read from STDIN, for example, in perl you could loop over the lines with “while(<>)”, etc)
If you have the same credentials everywhere you could hardcode user/pass or community string in your script/program, and just peel the device IP off the beginning each line.
j
Outside of CNUT, if you need to scan and find your SMs, you might be able to use nmap. On our network, for example, all SMs live at 10.x.10.y/24 IPs - the ‘x’ differs by tower, the ‘y’ of course by device. So I can run
nmap -sP 10.64-70.10.20-254 | grep host | cut -d’ ’ -f2and get a list of which IPs are live in one county. (excluding bottom of each block because our Canopy APs and CMMs live at .2 through .19)
j
We also use snmp in a PHP script to make mass changes to ours, but that is the more involved way.