Comware

 View Only
  • 1.  Rebooting alot of switches whit PCM

    Posted Jul 16, 2010 08:17 AM
    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.  RE: Rebooting alot of switches whit PCM

    Posted Jul 16, 2010 11:18 AM
    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 <<EOF></EOF>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";



  • 3.  RE: Rebooting alot of switches whit PCM

    Posted Jul 21, 2010 04:34 AM
    Thank you very much. All switches rebooted as they should so this is solved.