cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2345
Views
0
Helpful
10
Replies

Scripting reboot for Cisco 300 Series switches

Ross Kelly
Level 1
Level 1

I would like to have some help putting together a script for rebooting our 300 series POE switches. I have about 150 at this stage to administer and it would make it much easier not to have to remotely reboot them. The IP settings will be the same for each location and we have about 2-5 in each location. I will be logging in through logmein to each remote server, and will run the scripts from this to the local switches. Any help would be appreciated.

10 Replies 10

Brandon Svec
Level 7
Level 7

I guess you could make a simple script to telnet or SSH into each switch and issue the reload command.  Maybe copy run start command first.  Can I ask why you want to do this?

I've never used it, but I assume CCA - Cisco Configuration Assistant can do this.

-- please remember to rate and mark answered helpful posts --

Well they run 24 POE cameras per switch and I have about 150 switches to look after, so when a camera crashes, all I can do is reboot the switch it is on. It would save me some time to have, say a script for each switch so when I need to reboot it - I don't have to go through the login and menu process to reboot the switch in question. I support all of these switches remotely over sometimes very congested internet connections. Any time I can cut down trying to navigate unresponsive menus would make my life so much easier.

I see.  This doesn;t answer your script question directly, but you should be aware you can also issue a command to just disable and reenable POE one specific port.  that might be nicer than resetting 24 cameras if only one needs to be reset.

interface commands to do this would be:

power inline never #turns off power

power inline auto #turns it back on

 

-- please remember to rate and mark answered helpful posts --

Thanks for your input, that's a good idea.  However my skill set for this is very basic and googling this question leads me nowhere. My question is probably a bit to simple for this forum but I cant seem to find a script I can just cut and paste into a .bat file for example or a file that will execute the listed commands into the switch, and customise ip/password for the individual switches. Ideally I will have a file, say "Switch.251.xxx" that will have the script necessary to reboot the switch at 192.168.56.251.

I feel ya, but unless someone comes forward to write the script for you I think you need to brush up on your skill set ;)  Try this: http://support.moonpoint.com/downloads/windows/network/Telnet/tst10.php

-- please remember to rate and mark answered helpful posts --

Thanks for the link I'll check it out:)

viningele
Level 3
Level 3

I wrote a driver last year that would allow me to control specific POE ports from wall mounted touchscreens.  The customer hates RF so unless he needs to use wi-fi he wants APs powered down.  Same thing could be done for any number of switches and any POE ports needed with on screen names for each camera.  For feedback I would also query the port to check it's state to confirm POE is enabled or disabled.  Unfortunately this code only runs on an AMX processor and uses AMX touchscreen for the user interface.  You could buy used gear on ebay for a couple hundred but the programming would have to be done by a skilled programmer unless you got a few years to spare.  Even if I gave you my code it would be a chore to customize to your specific need and for a one off application it would be time consuming and expensive.

Thank you for replying but what I want is (I'm thinking) basic. I'm guessing it would be a few lines of code to do the job. It will not need to go through any routers or firewalls just go locally from the NVR to the local switch(s).  I'm hoping for maybe a powershell script or anything that will work. I use Logmein to get to the NVR and use the HTTP interface to reboot the switch.

Maybe something like Indigo from Shade Blue which is a telnet/SSH client.  You can set up all your switches as clients in a file tree format so you just click on a switch in the file tree and you're connected with user/pass saved for each client.  I believe you can also automatically send a comnand on login, maybe more.  If not you can definitely created a library of cisco command that you can simply double click on to send once connected.

I was playing with my Indigo on an SG-500 and it seems to work.  Create a session for each switch and in the session properties for each switch enter your crendentials (user/pass) IP/port, etc, I was using telnet, port 23 for this and then under the send command tab, on connection I entered:

reload

y

 

One command per line up to 20 commands I believe and it connected, I saw my prompts and replies and then shutting down.

So if you try this you can just go down the file tree list for switches with cameras than need a reboot and restart the entire switch if you like, quick and easy.

You could also add a folder for each switch and a session in that folder possibly for each camera/port with online port number changing for each camera in the session properties and then selectively cycle power for just the affected cameras.

 

Example for port 22/camera xxxx:

 

conf t

int gi22 
power inline never

power inline auto

 

It would take a fair amount of time to set up but once done you could just pick a switch folder and the port in that switch to cycle.  If you have multiple port on a switch you could use

conf t

int range gi22-24

or 

int range gi1,6,16,20

power inline never

power inline auto

 

 

might have to verify that syntax