cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1838
Views
5
Helpful
5
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.

5 Replies 5

Michal Bruncko
Level 4
Level 4

Hi Ross

I would recommend to do it via SNMP. SG300/SF300 series switches supports reload functionality via SNMP MIB. You can simply prepare batch file on every location with following example commands and schedule it in system scheduler to particular time you want to do it. Example commands for single switch:

snmpset -v 2c -c RWCommunitySecret X.X.X.X rlScheduledReload.0 s 'YYYYYY'
snmpset -v 2c -c RWCommunitySecret X.X.X.X rlScheduledReloadCommit.0 i '1'

Where:

  • X.X.X.X  is IP address of your switch
  • 2c is SNMP version - most commonly used (you can use different one, but rest of parameters for snmpset could be changed)
  • RWCommunitySecret is Read-Write SNMP community defined on your switch
  • 'YYYYYY' is time form when you wanted to perform reboot, you have three options here:
    • 'athhmmddMM' is absolute form when reload should be performed, example 'at23550203' means, that reboot will be performed at 23:55 on 2nd March.
    • 'inhhhmmm' is relative form of order for perform reboot. Example 'in010033' means, that reboot will be performed after next 10 hours and 33 minutes.
    • '' (i.e. without value) means that you wanted to abort requested reboot
  • Second command is approval operation to perform with reload at desired time defined before. '1' means 'TRUE' which approves reboot.

Of course for this to work you have to:

  • Properly configure SNMP agent on all your switches
  • Have corresponding software on your remote systems (like "net-snmp" utilities - binary for Windows available here, for Linux usually available via package system)
  • Have downloaded latest MIB's for SG300 switches. Unzipped and placed it in correct directory ("C:\usr\share\snmp\mibs\" by default on Windows, "/usr/share/snmp/mibs/" by default in Linux)

Aleksandra Dargiel
Cisco Employee
Cisco Employee

Hi Ross,

Have you tried something like this:

connect '192.168.1.254:22 /ssh /auth=password /user=admin /passwd=admin'

wait   UsernamePrompt

sendln 'cisco'

;wait PasswordPrompt

;sendln Password

wait UsernamePrompt

sendln 'cisco'

wait Console

sendln 'reload'

sendIn 'Y'

sendIn 'Y"

Let me know if this helps :-)

Aleksandra

hi aleksandra

i just wanna know we shoud run this commands on what ? CLI cisco ? specifical application on windows ? 

thank you 

 

 - Apparently that is a teraterm-based script (or macro) , download teraterm and for instance have a look at :

                        https://www.youtube.com/watch?v=-hWRkHoMep4

 M.



-- Each morning when I wake up and look into the mirror I always say ' Why am I so brilliant ? '
    When the mirror will then always repond to me with ' The only thing that exceeds your brilliance is your beauty! '
Quick demo on running a TeraTerm Script

thank you