Switches, Hubs, and Modems
1753672 Members
5438 Online
108799 Solutions
New Discussion юеВ

Rebooting alot of switches whit PCM

 
SOLVED
Go to solution
Peter[Swe]
Occasional Advisor

Rebooting alot of switches whit PCM

Hello,
Is it possible to make a vb or batch script that reboots one switch after an other from the outside of the entire network map and in? Or any other way to make it work automaticly, using PCM v2.3
I have about 70 swithes i want to reboot on different locations in my network map, preferably over night, so i need to make a schedule. Any help whit this would be much appreciated.

Regards
Peter
2 REPLIES 2
Natasha Samoylenko
Trusted Contributor
Solution

Re: Rebooting alot of switches whit PCM

You can do it with PCM+.
You need to create policy, which will use as trigger whatever you need: time or some event.
As targets you need to select all switches you want to reload.
As action you need to select Group CLI. And write command to reboot switch:
reload
y (to confirm reload)

It should work.



Also you may test the following idea of script. My collegue write it to help me simplify configuring of VLAN on 12 switches.

You can change script and use it to reboot switches. I use this script on Linux.

Command which is used to login to switch:
%# (sleep 5; echo ${PASSWORD}; sleep 2; echo ; perl make-many-vlans.pl; sleep 2) | socat - EXEC:"ssh ${SWITCH}",setsid,pty,ctty

* PASSWORD -- password to access the switch
* switch.host.net -- name or IP address of switch
* make-many-vlans.pl -- script name

To reload few switches, I think you will need to create some file with list of switch IPs and change a little command and use it as argument in command.

script example (make-many-vlans.pl):

#!/usr/bin/perl
#

my $i=0;

print "conf t\n";
for (my $i=25; $i<30; $i++) {
print <vlan $i
tagged $i
exit
EOF
}
print "exit\nexit\nexit\ny\n";

For you it should look simpler:
#!/usr/bin/perl
#

print "reload\ny\n\n";

Peter[Swe]
Occasional Advisor

Re: Rebooting alot of switches whit PCM

Thank you very much. All switches rebooted as they should so this is solved.