I have 17 (at present) remote sites with this equipment setup as combined networks.
It would be beneficial to know if it is possible to reboot all of them at once on a Sunday so they will be ready to use the following Monday.
Thanks
Why do you want to reboot them? This usually isn't necessary for normal operation?
You can't do this via the dashboard.
You could script it using the dashboard api though. But you'd have to do it in a smart way with regards to the order.
POST /networks/{networkId}/devices/{serial}/reboot
Why do you want to reboot them? I have 17 remote sites that use the data solely for construction purposes. We get our data from a cellular modem that is attached to the SD which gives the APs to the site.
You can't do this via the dashboard. I can reboot the MX65 individually but I am looking for a solution to reboot all of the combined networks.
You could script it using the dashboard api though. That would be ideal but I'm not a Cisco engineer but if a tested script is available and it isn't too difficult to setup I will try it.
@BradHewitt wrote:Why do you want to reboot them? I have 17 remote sites that use the data solely for construction purposes. We get our data from a cellular modem that is attached to the SD which gives the APs to the site.
You can't do this via the dashboard. I can reboot the MX65 individually but I am looking for a solution to reboot all of the combined networks.
You could script it using the dashboard api though. That would be ideal but I'm not a Cisco engineer but if a tested script is available and it isn't too difficult to setup I will try it.
Yeah individually works. I meant all at once is not possible via dashboard.
It's still not clear to me why you want to reboot them.
I do appreciate that you are replying to my questions however asking "why" is not appropriate and hardly gets me closer to a solution.
If you do not know or cannot refer me to another individual / site I'll look to the rest of the community for some input.
Salutations
Asking why, is trying to help. @BrechtSchamp is trying to determine what the case for rebooting is as most networking devices should not need to be rebooted unless there is a networking issue.
By determining what the driving factor is for rebooting, the community can help you determine the best way to help you problem solve your issue.
I had said earlier that our source of data on each site are from cellular devices. These are not professional modems and this equipment needs to be rebooted after being used all week. This kind of gear requires a reboot to purge cached information.
So. A reboot on each site will not only make the quality better for workers on site the data will be sent quicker AND there will be less technical support (at least in the short term).
I hope that supplies an answer.
So...any thoughts?
@BradHewitt unfortunately @BrechtSchamp outlined the only real solutions you have available. You can either do it manually one device at a time through the dashboard, or you can write a script to do it through the API. Meraki does not create official, sanctioned scripts to do specific tasks. You may find other folks who have created stuff, and made it available online in places like Github, but that's going to be the extent of that.
There aren't any other alternatives to this problem. 😞
Appreciated. Doing 17 networks isn't a big deal BUT we are growing and it would have been a good to know in the immediate if there are more automated option.
Thanks to @vassallon and @BrechtSchamp for their contribution all the same.
@BradHewitt Yes, this make perfect sense as to the reason why you want to do this. Ideally you'd like to have it scheduled in some capacity but unfortunately there is no way to do this within the Dashboard at this time.
I would make a wish for this feature request but until Meraki can develop it your only way to do it is through scripting which you could make automated to reboot these devices for you. I unfortunately have not played around enough with the API to assist in any way.
I understand that sometimes intentions get lost in translation in online written media. But my intention was indeed to help, not to sound like a pedantic d*. The reason I want to understand why the reboot is needed is to see if there is another possible solution that may be better.
Now that you've explained why the reboot is needed we can try to understand better. You say the problem lies with the cellular connection. Does that mean a USB modem that is in the MX's USB port? If it is then I can understand a reboot of the MX may help as the modem will then reboot with the MX. If not, I'm not sure if it's going to do much. Same goes for the access points.
I've started writing a script for you using the new Python SDK. It goes as follows:
from meraki.meraki import Meraki # user API key x_cisco_meraki_api_key = 'enter_your_API_key_here' try: client = Meraki(x_cisco_meraki_api_key) # get a list of organizations the user has access to orgs = client.organizations.get_organizations() # prepare the orgcollect to be used in the get_organization_networks call orgcollect = {} for org in orgs: # only interested in a specific organization if org['id'] == 1234567: # your organization's ID orgcollect['organization_id'] = org['id'] # fetch all networks in the organization(s) if orgcollect: # make sure it's not an empty collection networks = client.networks.get_organization_networks(orgcollect) # loop over the networks if networks: # make sure it's not an empty organization for network in networks: # create a devicescontroller to fetch devices devicescontroller = client.devices # fetch a list of devices in the specified network devices = devicescontroller.get_network_devices(network['id']) # prepare the devicescollection to reboot them devicescollect = {} for device in devices: # only interested in MX devices if 'MX' in device['model']: devicescollect['serial'] = device['serial'] devicescollect['network_id'] = network['id'] # reboot the device if devicescollect: # make sure there are devices to reboot result = devicescontroller.reboot_network_device(devicescollect) if result['success']: print("The device with the name ", device['name'], "(", device['model'], ") in the network ", network['name'], " was successfully rebooted.") else: print("ERROR: The device with the name ", device['name'], "(", device['model'], ") in the network ", network['name'], " could not be rebooted.") else: print("Empty Organization") else: print("No organizations selected") except: print("Exception occurred, possibly and invalid API key.")
I have tested the script, but not thoroughly so all use is at your own risk.
A couple of things you should know about the script:
Hope that helps.