Hi
We're in the process of onbarding a lot of ePMP radios (2000+).
We were hoping to be able to script the necessarry changes we need to make to the radios in order to onboard them.
We need to change the DNS address as well as well as configure the cnMaestro onboarding details.
The below is the script I have written in Python to accomplish this.
It seems to work and all the values change as expected and radio reboots.
However, the unit will not connect to the cnMaestro server instance - it instead gives a parsing error in the log:
Sep 1 00:00:33 GG Cambium 2 90deg DEVICE-AGENT[1865]: Parse error : 1 Sep 1 00:00:33 GG Cambium 2 90deg DEVICE-AGENT[1865]: parsing of url failed Sep 1 00:00:33 GG Cambium 2 90deg DEVICE-AGENT[1865]: Unable to discover cnMaestro URL (re-discover in 68 seconds)
If I look under Configuration -> System, the URL has changed to what it should be.
If I delete the URL on the GUI and manually type it in again, (exactly as it was already!), it correctly parses the URL and connects to cnMaestro.
Anybody have any ideas how I can get around this?
I've tried passing the URL in quotes, without quotes etc but always the same.
Any help would be greatly appreciated, manually configuring 2000+ units for onboarding is not really an option!
import paramiko as pm import os, time import sysclass AllowAllKeys(pm.MissingHostKeyPolicy):
def missing_host_key(self, client, hostname, key):
returnhosts = [‘10.23.0.31’]
b = open(‘cnmaestro_results’, ‘wb’)
USER = ‘admin’
PASSWORD = ‘password’
RESULTS = ‘’def change_power_reset():
client = pm.SSHClient()
client.load_system_host_keys()
client.set_missing_host_key_policy(pm.AutoAddPolicy())
client.connect(host, username=USER, password=PASSWORD, timeout=5)channel = client.invoke_shell() stdin = channel.makefile('wb') stdout = channel.makefile('rb') channel.send('config set networkBridgeDNSIPAddrPrimary 8.8.4.4\n') time.sleep(2) channel.send('config set networkBridgeDNSIPAddrSecondary 8.8.8.8\n') time.sleep(2) channel.send('config set cambiumDeviceAgentEnable "1"\n') time.sleep(2) channel.send('config set cambiumDeviceAgentCNSURL https://cnmaestro.on_premises_url\n') time.sleep(2) channel.send('config set cambiumCNSDeviceAgentID "cnmaestro_on_premises"\n') time.sleep(2) channel.send('config set cambiumCNSDeviceAgentPassword "password"\n') time.sleep(2) channel.send('config save\n') time.sleep(2) channel.send('config apply\n') time.sleep(2) channel.send('exit\n') RESULTS = channel.recv(8192) #print RESULTS stdout.close() stdin.close() client.close()
for host in hosts:
print host,
try:
change_power_reset()
print “Success!”
b.write(host + “,” + “Successfully changed!” + “\n”)
except:
print “Failed!!”
b.write(host + “,” + “Parameter not changed!” + “\n”)
pass