| @echo off
rem
rem HUB_LOAD.BAT
rem
rem DOS command procedure for loading various DEChub device firmware using
rem DECndu Plus.
rem
rem Author: Roger Gaudet (ROGER::GAUDET)
rem
rem Arguments: %1 = Device type, as defined by the following table:
rem
rem [A] DECagent 90
rem [B] DECbridge 90, 90FL
rem [C] DECbridge 900MX
rem [D] DECconcentrator 900MX
rem [E] DEChub 900 MultiSwitch
rem [F] DECrepeater 90FS
rem [G] DECrepeater 900FP
rem [H] DECrepeater 900GM
rem [I] DECrepeater 900TM
rem
rem %2 = Device address of the device to be loaded.
rem
rem Notes:
rem
rem 1) When loading the DECbridge 90 or 90FL, specify the
rem MAC address of the bridge.
rem 2) When loading the DECconcentrator 900MX, specify the
rem in-band IP address of the DEChub 900 Multiswitch.
rem
rem %3 = Firmware image name (including full path).
rem
rem %4 = SNMP read-write community string of the device
rem (default is 'public').
rem
rem %5 = Slot number of the device (some devices need this
rem parameter for a successful load).
rem
rem Invoke this command procedure as follows:
rem
rem HUB_LOAD {type} {address} {image_name} [{community_string}] [{slot}]
rem
if "%1"=="" goto ShowDev
if "%2"=="" goto Invalid
if "%3"=="" goto Invalid
if exist %3 goto GetCs
echo.
echo *** Firmware image not found! ***
goto End
:GetCs
set cs=%4
if "%4"=="" set cs=public
set pass=/p %cs%
goto Load%1
rem DECagent 90
:LoadA
set dev=DECagent 90
set force=/i /n /f decagent
goto DoLoad
rem DECbridge 90, 90FL
:LoadB
set dev=DECbridge 90, 90FL
set pass=
set force=/i /n
goto DoLoad
rem DECconcentrator 900MX
:LoadD
set dev=DECconcentrator 900MX
if "%5"=="" goto Invalid
set force=/f hubmodule /m %5
goto DoLoad
rem DEChub 900 MultiSwitch
:LoadE
set dev=DEChub 900 MultiSwitch
set force=/f hubmanv2 /m 9
goto DoLoad
rem DECbridge 900MX
rem DECrepeater 90FS
rem DECrepeater 900FP
rem DECrepeater 900GM
rem DECrepeater 900TM
:LoadC
set dev=DECbridge 900MX
goto Pcom
:LoadF
set dev=DECrepeater 90FS
goto Pcom
:LoadG
set dev=DECrepeater 900FP
goto Pcom
:LoadH
set dev=DECrepeater 900GM
goto Pcom
:LoadI
set dev=DECrepeater 900TM
goto Pcom
:Pcom
set force=/f pcommon
goto DoLoad
:DoLoad
echo.
echo Loading %dev% ...
@echo on
decndup /V
decndup /s %2
decndup /u %force% %2 %3 %pass%
@echo off
:Done
set cs=
set force=
set pass=
set dev=
goto End
:Invalid
echo.
echo *** Please specify all required arguments! ***
goto Example
:ShowDev
echo.
echo Select the device to be loaded from the list below and
echo supply the letter of the device as the first argument to
echo this batch procedure.
echo.
echo [A] DECagent 90 [F] DECrepeater 90FS
echo [B] DECbridge 90, 90FL [G] DECrepeater 900FP
echo [C] DECbridge 900MX [H] DECrepeater 900GM
echo [D] DECconcentrator 900MX [I] DECrepeater 900TM
echo [E] DEChub 900 MultiSwitch
:Example
echo.
echo HUB_LOAD {type} {address} {image_name} [{community_string}] [{slot}]
echo.
echo For example, to load the DECagent 90, invoke this batch
echo procedure in a way similar to the following:
echo.
echo HUB_LOAD A 16.20.216.234 C:\FIRMWARE\DENMA021.SYS
goto End
:End
echo.
|
| // ****************** SNMP DOWNLOAD DEFINITION FILE *******************
// This is the SDDF.STP (SNMP DOWLOAD DEFINITION) file. The .stp is
// for STEPS. DECndu Plus parses this file to determine the steps that
// will be taken in downloading a device.
// "//" - Defines a comment line.
// ********************************************************************
DEVICE IP SETTINGS
HOSTIP 16.20.36.30
ROUTERIP 16.20.0.173
SUBNETMASK 255.255.0.0
END
// *************************************************************************
// * DEChub900 MAN DLU STEPS for V1 of the firmaware
// * Version1 of the firmware does not support SysDescr so the /f switch
// * should be used to force the steps below to be used.
// * IPofTarget filename
// * | |
// * DOS ie.: decndu /u /f hubmamv1 /m 0 XX.XX.XX.XX xxxxxxxxx.xxx
// *************************************************************************
DEVICE HUBMANV1
// Setting Load-Host's IP address
PRINT [HUBMANV1] Setting TFTP Server IP Address.
SET INTEGER 1.3.6.1.4.1.36.2.18.1.6.7.0 SERVER
PRINT [HUBMANV1] GETTING DEChub900 SERVER IPADDRESS
GET INTEGER 1.3.6.1.4.1.36.2.18.1.6.7.0
// Setting Load Filename
PRINT [HUBMANV1] Setting DLU filename.
SET STRING 1.3.6.1.4.1.36.2.18.1.6.4.0 DLUFILENAME
PRINT [HUBMANV1] GETTING DEChub900 DLU FILENAME
GET STRING 1.3.6.1.4.1.36.2.18.1.6.4.0
// Set the Slot Number
PRINT [HUBMANV1] Setting slot number.
SET INTEGER 1.3.6.1.4.1.36.2.18.1.6.1.0 SLOTNUMBER
PRINT [HUBMANV1] GETTING SLOT NUMBER
GET INTEGER 1.3.6.1.4.1.36.2.18.1.6.1.0
// Pull the Trigger
PRINT [HUBMANV1] Setting Trigger!
SET INTEGER 1.3.6.1.4.1.36.2.18.1.6.10.0 1
// Time to be a TFTP Server
PRINT [HUBMANV1] Time to serve.
TFTPSERVER
// Poll Status Object for success Count, Interval in seconds
PRINT [HUBMANV1] Polling
POLL INTEGER 1.3.6.1.4.1.36.2.18.1.6.8.0 7 3
CASE 1 C C_COMPLETED
CASE 2 I I_TRIGGERED
CASE 3 I I_READING_LOAD_FILE_INTO_PAD
CASE 4 I I_MAM_BLASTING_FLASH
CASE 5 I I_WRITING_FILE_TO_LINE_CARD
CASE 6 I I_FILE_WRITTEN_TO_LINE_CARD
CASE 7 E E_FAILED_WRONG_MAM_IMAGE
CASE 8 E E_FAILED_FILE_NOT_FOUND
CASE 9 E E_FAILED_CRC_ON_FILE_ERROR
CASE 10 E E_FAILED_UNKNOWN_HOST
CASE 11 E E_FAILED_FLASH_ERROR
CASE 12 E E_FAILED_FILE_READ_TIMEOUT
CASE 13 E E_FAILED_LC_WRITE_TIMEOUT
CASE 14 E E_FAILED_LC_IMAGE_TOO_BIG
CASE 15 E E_FAILED_LC_NOT_PRESESENT
CASE 16 E E_FAILED_LC_UNKNOWN_ERROR
CASE 17 E E_FAILED_TFTP_UNKNOWN_ERROR
CASE 18 E E_FAILED_PAD_IN_USE
CASE 19 E E_FAILED_FILE_NAME_LENGTH_ERROR
ENDCASE
END
// **********************************************************************
// * USE THIS STEP TO GET SYSDESCR FOR STAND ALONE DEVICE *
// **********************************************************************
DEVICE SYSDESCR
PRINT [SYSDESCR] Getting Device INFO (sysDescr)
// iso.org.dod.internet.mgmt.mibII.system.sysDescr
GET STRING 1.3.6.1.2.1.1.1.0
END
// **********************************************************************
// * USE THIS STEP TO GET CHASSIS MODULE DESCR *
// **********************************************************************
DEVICE CHASDESCR
PRINT [CHASDESCR] Getting Device chassis module info (ChasSlotModuleDescr)
GET STRING 1.3.6.1.4.1.36.2.18.11.1.1.1.1.6.1.4.n
END
// **********************************************************************
// * USE THIS STEP TO GET GIGASWITCH MODULE DESCRIPTION *
// **********************************************************************
DEVICE GIGDESCR
PRINT [GIGDESCR] Getting Gigaswitch module Status.
POLL INTEGER 1.3.6.1.4.1.36.2.15.3.3.3.1.4.3.1.2.n 7 2
CASE 1 C NOTPRESENT
CASE 2 C POWERDOWN
CASE 3 C POWERUP
ENDCASE
PRINT [GIGDESCR] Getting Gigaswitch module Type.
POLL INTEGER 1.3.6.1.4.1.36.2.15.3.3.3.1.4.3.1.3.n 7 2
CASE 1 C OTHER
CASE 2 C FGL2
CASE 3 C CBS36
CASE 4 C SWITCHENGINE
CASE 5 C CLOCKCARD
ENDCASE
PRINT [GIGDESCR] Getting Gigaswitch module Hardware Rev.
GET STRING 1.3.6.1.4.1.36.2.15.3.3.3.1.4.3.1.4.n
PRINT [GIGDESCR] Getting Gigaswitch module Firmware Rev.
GET STRING 1.3.6.1.4.1.36.2.15.3.3.3.1.4.3.1.5.n
END
// **********************************************************************
// * DEChub 900 V2 of the MAN firmaware steps for DLU *
// * The objects below fall under: *
// * 1.3.6.1.4.1.36.2.18.dechub900(11).mgmtAgent(1).mgmtAgentVersion(1) *
// **********************************************************************
DEVICE HUBMANV2
PRINT [HUBMANV2] Getting sysDescr
GET STRING 1.3.6.1.2.1.1.1.0
// PRINT [CHASDESCR] Getting Device chassis module info (ChasSlotModuleDescr)
// GET STRING 1.3.6.1.4.1.36.2.18.11.1.1.1.1.6.1.4.n
// NOTE:
// Notice the .n at the end of the OID's. The .n will be replaced by the
// slot number during parsing. The slot number is entered on the command
// line using the /m: switch ie. /m: 9 for the MAN.
// PRINT [HUBMANV2] Getting the (ChasLoadEntryStatus) in the ChasLoadTable
// GET INTEGER 1.3.6.1.4.1.36.2.18.11.1.1.1.11.1.1.7.n
PRINT [HUBMANV2] Setting (ChasLoadEntryStatus) to CreateRequest (2)
SET INTEGER 1.3.6.1.4.1.36.2.18.11.1.1.1.11.1.1.7.n 2
PRINT [HUBMANV2] Set load host IP address (ChasLoadIpHostAddr)
SET IPADDRESS 1.3.6.1.4.1.36.2.18.11.1.1.1.11.1.1.5.n SERVER
GET IPADDRESS 1.3.6.1.4.1.36.2.18.11.1.1.1.11.1.1.5.n
PRINT [HUBMANV2] Setting load filename
SET STRING 1.3.6.1.4.1.36.2.18.11.1.1.1.11.1.1.4.n DLUFILENAME
GET STRING 1.3.6.1.4.1.36.2.18.11.1.1.1.11.1.1.4.n
PRINT [HUBMANV2] Setting (ChasLoadEntryStatus) Valid (1)
SET INTEGER 1.3.6.1.4.1.36.2.18.11.1.1.1.11.1.1.7.n 1
SET INTEGER 1.3.6.1.4.1.36.2.18.11.1.1.1.11.1.1.7.n 1
PRINT [HUBMANV2] Setting (ChasLoadAdminStatus) Start-read (2)
SET INTEGER 1.3.6.1.4.1.36.2.18.11.1.1.1.11.1.1.2.n 2
PRINT [HUBMANV2] STARTING TFTP SERVER
TFTPSERVER
PRINT [HUBMANV2] TFTP DOWNLOAD COMPLETED
// end of steps
END
// **********************************************************************
// * DEChub 900 Chassis Module Load *
// **********************************************************************
DEVICE HUBMODULE
PRINT [HUBMODULE] Getting Device chassis module info (ChasSlotModuleDescr)
GET STRING 1.3.6.1.4.1.36.2.18.11.1.1.1.1.6.1.4.n
// NOTE:
// Notice the .n at the end of the OID's. The .n will be replaced by the
// slot number during parsing. The slot number is entered on the command
// line using the /m: switch ie. /m 9 for the MAN.
// PRINT [HUBMODULE] Getting the (ChasLoadEntryStatus) in the ChasLoadTable
// GET INTEGER 1.3.6.1.4.1.36.2.18.11.1.1.1.11.1.1.7.n
PRINT [HUBMODULE] Setting (ChasLoadEntryStatus) to CreateRequest (2)
SET INTEGER 1.3.6.1.4.1.36.2.18.11.1.1.1.11.1.1.7.n 2
PRINT [HUBMODULE] Set load host IP address (ChasLoadIpHostAddr)
SET IPADDRESS 1.3.6.1.4.1.36.2.18.11.1.1.1.11.1.1.5.n SERVER
GET IPADDRESS 1.3.6.1.4.1.36.2.18.11.1.1.1.11.1.1.5.n
PRINT [HUBMODULE] Setting load filename
SET STRING 1.3.6.1.4.1.36.2.18.11.1.1.1.11.1.1.4.n DLUFILENAME
GET STRING 1.3.6.1.4.1.36.2.18.11.1.1.1.11.1.1.4.n
PRINT [HUBMODULE] Setting (ChasLoadEntryStatus) Valid (1)
SET INTEGER 1.3.6.1.4.1.36.2.18.11.1.1.1.11.1.1.7.n 1
PRINT [HUBMODULE] Setting (ChasLoadAdminStatus) Start-write (3)
SET INTEGER 1.3.6.1.4.1.36.2.18.11.1.1.1.11.1.1.2.n 3
PRINT [HUBMODULE] STARTING TFTP SERVER
TFTPSERVER
PRINT [HUBMODULE] TFTP DOWNLOAD COMPLETED
// Poll chasLoadOperStatus Object
PRINT [HUBMODULE] Polling for chasLoadOperStatus
// Count, Interval in seconds
POLL INTEGER 1.3.6.1.4.1.36.2.18.11.1.1.1.11.1.1.3.n 7 3
CASE 1 C NONE
CASE 2 C SUCCESS
CASE 3 C FAILURE
ENDCASE
// Get chasLoadDevSpecific
PRINT [HUBMODULE] Getting Device specific load status
GET INTEGER 1.3.6.1.4.1.36.2.18.11.1.1.1.11.1.1.7.n
PRINT [HUBMODULE] Getting Device chassis module info (ChasSlotModuleDescr)
GET STRING 1.3.6.1.4.1.36.2.18.11.1.1.1.1.6.1.4.n
// end of steps HUBMODULE
END
// *************************************************************************
// * PCOMMON MIB LOAD *
// *************************************************************************
DEVICE PCOMMON
PRINT [PCOMMON] Getting sysDescr
GET STRING 1.3.6.1.2.1.1.1.0
PRINT [PCOMMON] Setting server IP address (pcomLoadIpHostAddr).
SET IPADDRESS 1.3.6.1.4.1.36.2.18.11.2.4.4.0 SERVER
PRINT [PCOMMON] Getting Server IP Address
GET IPADDRESS 1.3.6.1.4.1.36.2.18.11.2.4.4.0
PRINT [PCOMMON] Setting filename (pcomLoadFilename).
SET STRING 1.3.6.1.4.1.36.2.18.11.2.4.3.0 DLUFILENAME
PRINT [PCOMMON] Get filename.
GET STRING 1.3.6.1.4.1.36.2.18.11.2.4.3.0
PRINT [PCOMMON] Setting AdminStatus/trigger (pcomLoadAdminStatus).
SET INTEGER 1.3.6.1.4.1.36.2.18.11.2.4.1.0 2
PRINT [PCOMMON] TFTP serve.
TFTPSERVER
PRINT [PCOMMON] TFTP server completed.
PRINT [PCOMMON] Polling for sysDescr
// Count, Interval in seconds
POLL STRING 1.3.6.1.2.1.1.1.0 25 15
CASE DEC C SUCCESS
CASE DEC C SUCCESS
ENDCASE
PRINT [PCOMMON] Getting sysDescr
GET STRING 1.3.6.1.2.1.1.1.0
// PCOMMON
END
// *************************************************************************
// * DECrepeater 900 *
// *************************************************************************
DEVICE DECrepeater 900
PRINT [DECrepeater 900] Setting server IP address (pcomLoadIpHostAddr).
SET IPADDRESS 1.3.6.1.4.1.36.2.18.11.2.4.4.0 SERVER
PRINT [DECrepeater 900] Getting Server IP Address
GET IPADDRESS 1.3.6.1.4.1.36.2.18.11.2.4.4.0
PRINT [DECrepeater 900] Setting filename (pcomLoadFilename).
SET STRING 1.3.6.1.4.1.36.2.18.11.2.4.3.0 DLUFILENAME
PRINT [DECrepeater 900] Get filename.
GET STRING 1.3.6.1.4.1.36.2.18.11.2.4.3.0
PRINT [DECrepeater 900] Setting AdminStatus/trigger (pcomLoadAdminStatus).
SET INTEGER 1.3.6.1.4.1.36.2.18.11.2.4.1.0 2
PRINT [DECrepeater 900] TFTP serve.
TFTPSERVER
PRINT [DECrepeater 900] TFTP server completed.
PRINT [DECrepeater 900] Polling for sysDescr
// Count, Interval in seconds
POLL STRING 1.3.6.1.2.1.1.1.0 7 5
CASE DEC C SUCCESS
CASE DEC C SUCCESS
ENDCASE
PRINT [DECrepeater 900] Getting sysDescr
GET STRING 1.3.6.1.2.1.1.1.0
// DECrepeater 900
END
// **********************************************************************
// * GIGASWITCH *
// **********************************************************************
//GIGAswitch DLU instruction set
//devicename should match sysDescr
// iso.org.dod.internet.mgmt.mibII.system.sysDescr
//DEVICE GIGAswitch Network Platform
DEVICE GIGASWITCH
// The MIB walk for these sets is
// dec ema sysobjid bridges GIGAswitch GIGAversion1 gigaUpgradeSoftware ...
// Set TFTP Server IP address.
// doTransfer tftpDestination
PRINT [GIGAswitch] Getting TFTP Server IP address.
GET IPADDRESS 1.3.6.1.4.1.36.2.15.3.3.3.3.1.1.0
PRINT [GIGAswitch] Setting TFTP Server IP Address.
SET IPADDRESS 1.3.6.1.4.1.36.2.15.3.3.3.3.1.1.0 SERVER
PRINT [GIGAswitch] Getting TFTP Server IP address.
GET IPADDRESS 1.3.6.1.4.1.36.2.15.3.3.3.3.1.1.0
// Set firmware image file name on load host.
// doTransfer transferFileName
PRINT [GIGAswitch] Getting firmware image file name.
GET STRING 1.3.6.1.4.1.36.2.15.3.3.3.3.1.3.0
PRINT [GIGAswitch] Setting firmware image file name.
SET STRING 1.3.6.1.4.1.36.2.15.3.3.3.3.1.3.0 DLUFILENAME
PRINT [GIGAswitch] Getting firmware image file name.
GET STRING 1.3.6.1.4.1.36.2.15.3.3.3.3.1.3.0
// Trigger the file transfer
// doTransfer transferAction
PRINT [GIGAswitch] Triggering image file transfer.
SET INTEGER 1.3.6.1.4.1.36.2.15.3.3.3.3.1.4.0 3
// Start up TFTP Server
PRINT [GIGAswitch] Starting TFTP Server
TFTPSERVER
// Poll for file transfer completion
// doTransfer transferStatus
PRINT [GIGAswitch] Polling for file transfer completion.
POLL INTEGER 1.3.6.1.4.1.36.2.15.3.3.3.3.1.5.0 7 5
CASE 1 I NONE
CASE 2 I REQUESTED
CASE 3 I IN_PROGRESS
CASE 4 E FAILED
CASE 5 C SUCCESS
ENDCASE
// Identify the Slot Number of module to be loaded.
// useTransfer copyToSlot
PRINT [GIGAswitch] Getting slot number.
GET INTEGER 1.3.6.1.4.1.36.2.15.3.3.3.3.2.1.0
PRINT [GIGAswitch] Setting slot number.
SET INTEGER 1.3.6.1.4.1.36.2.15.3.3.3.3.2.1.0 SLOTNUMBER
PRINT [GIGAswitch] Getting slot number.
GET INTEGER 1.3.6.1.4.1.36.2.15.3.3.3.3.2.1.0
PRINT [GIGAswitch] Getting copyType.
POLL INTEGER 1.3.6.1.4.1.36.2.15.3.3.3.3.2.2.0 3 2
CASE 1 C NONE
CASE 2 C ELCAMINO
CASE 3 C FGL-2
CASE 4 C CLOCK
CASE 5 C PowerSysController
ENDCASE
// Cause the flash to be updated
// useTransfer copyAction
PRINT [GIGAswitch] Triggering flash update.
SET INTEGER 1.3.6.1.4.1.36.2.15.3.3.3.3.2.3.0 2
// Poll for flash update completion
// useTransfer copyStatus
// ??? This will not currently work. May need to determine another
// way to get final status of the load ???
PRINT [GIGAswitch] Polling for load completion.
// max polls seconds
POLL INTEGER 1.3.6.1.4.1.36.2.15.3.3.3.3.2.4.0 20 10
CASE 1 I NONE
CASE 2 I REQUESTED
CASE 3 I IN_PROGRESS
CASE 4 E FAILED
CASE 5 C SUCCESS
CASE 6 E FAILED_DUE_TO_CARD_TYPE
CASE 7 E FAILED_DUE_TO_HW_REV
CASE 8 E FAILED_DUE_TO_FW_REV
ENDCASE
// end gigaswitch
END
//************************************
//* JUST BE A TFTP SERVER *
//************************************
DEVICE TSERVER
PRINT [TSERVER] Now serving for two minutes.
TFTPSERVER
PRINT [TSERVER] Stopped serving.
END
// *************************************************************************
// This script file defines the action to update a DECagent 90 using DECndu
// Plus. This file should be appended to the sddf.stp file which is shipped
// with the DECndu Plus kit.
// *************************************************************************
// *************************************************************************
// * DECAGENT *
// *************************************************************************
DEVICE DECAGENT
PRINT [DECAGENT] Getting sysDescr
GET STRING 1.3.6.1.2.1.1.1.0
PRINT [DECAGENT] Setting server IP address (da90LoadIpHostAddr).
SET IPADDRESS 1.3.6.1.4.1.36.2.18.10.2.14.0 SERVER
PRINT [DECAGENT] Getting Server IP Address
GET IPADDRESS 1.3.6.1.4.1.36.2.18.10.2.14.0
PRINT [DECAGENT] Setting filename (da90LoadFilename).
SET STRING 1.3.6.1.4.1.36.2.18.10.2.13.0 DLUFILENAME
PRINT [DECAGENT] Get filename.
GET STRING 1.3.6.1.4.1.36.2.18.10.2.13.0
PRINT [DECAGENT] Setting AdminStatus/trigger (da90LoadAdminStatus).
SET INTEGER 1.3.6.1.4.1.36.2.18.10.2.11.0 2
PRINT [DECAGENT] TFTP serve.
TFTPSERVER
PRINT [DECAGENT] TFTP server completed.
PRINT [DECAGENT] Polling for sysDescr
// Count, Interval in seconds
POLL STRING 1.3.6.1.2.1.1.1.0 15 10
CASE DEC C SUCCESS
CASE DEC C SUCCESS
ENDCASE
PRINT [DECAGENT] Getting sysDescr
GET STRING 1.3.6.1.2.1.1.1.0
// DECAGENT
END
|